aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/google.golang.org/grpc/interceptor.go
diff options
context:
space:
mode:
authorAlex Pilon <apilon@hashicorp.com>2019-02-22 18:24:37 -0500
committerAlex Pilon <apilon@hashicorp.com>2019-02-22 18:24:37 -0500
commit15c0b25d011f37e7c20aeca9eaf461f78285b8d9 (patch)
tree255c250a5c9d4801c74092d33b7337d8c14438ff /vendor/google.golang.org/grpc/interceptor.go
parent07971ca38143c5faf951d152fba370ddcbe26ad5 (diff)
downloadterraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.tar.gz
terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.tar.zst
terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.zip
deps: github.com/hashicorp/terraform@sdk-v0.11-with-go-modules
Updated via: go get github.com/hashicorp/terraform@sdk-v0.11-with-go-modules and go mod tidy
Diffstat (limited to 'vendor/google.golang.org/grpc/interceptor.go')
-rw-r--r--vendor/google.golang.org/grpc/interceptor.go75
1 files changed, 75 insertions, 0 deletions
diff --git a/vendor/google.golang.org/grpc/interceptor.go b/vendor/google.golang.org/grpc/interceptor.go
new file mode 100644
index 0000000..06dc825
--- /dev/null
+++ b/vendor/google.golang.org/grpc/interceptor.go
@@ -0,0 +1,75 @@
1/*
2 *
3 * Copyright 2016 gRPC authors.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 */
18
19package grpc
20
21import (
22 "golang.org/x/net/context"
23)
24
25// UnaryInvoker is called by UnaryClientInterceptor to complete RPCs.
26type UnaryInvoker func(ctx context.Context, method string, req, reply interface{}, cc *ClientConn, opts ...CallOption) error
27
28// UnaryClientInterceptor intercepts the execution of a unary RPC on the client. invoker is the handler to complete the RPC
29// and it is the responsibility of the interceptor to call it.
30// This is an EXPERIMENTAL API.
31type UnaryClientInterceptor func(ctx context.Context, method string, req, reply interface{}, cc *ClientConn, invoker UnaryInvoker, opts ...CallOption) error
32
33// Streamer is called by StreamClientInterceptor to create a ClientStream.
34type Streamer func(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (ClientStream, error)
35
36// StreamClientInterceptor intercepts the creation of ClientStream. It may return a custom ClientStream to intercept all I/O
37// operations. streamer is the handler to create a ClientStream and it is the responsibility of the interceptor to call it.
38// This is an EXPERIMENTAL API.
39type StreamClientInterceptor func(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, streamer Streamer, opts ...CallOption) (ClientStream, error)
40
41// UnaryServerInfo consists of various information about a unary RPC on
42// server side. All per-rpc information may be mutated by the interceptor.
43type UnaryServerInfo struct {
44 // Server is the service implementation the user provides. This is read-only.
45 Server interface{}
46 // FullMethod is the full RPC method string, i.e., /package.service/method.
47 FullMethod string
48}
49
50// UnaryHandler defines the handler invoked by UnaryServerInterceptor to complete the normal
51// execution of a unary RPC.
52type UnaryHandler func(ctx context.Context, req interface{}) (interface{}, error)
53
54// UnaryServerInterceptor provides a hook to intercept the execution of a unary RPC on the server. info
55// contains all the information of this RPC the interceptor can operate on. And handler is the wrapper
56// of the service method implementation. It is the responsibility of the interceptor to invoke handler
57// to complete the RPC.
58type UnaryServerInterceptor func(ctx context.Context, req interface{}, info *UnaryServerInfo, handler UnaryHandler) (resp interface{}, err error)
59
60// StreamServerInfo consists of various information about a streaming RPC on
61// server side. All per-rpc information may be mutated by the interceptor.
62type StreamServerInfo struct {
63 // FullMethod is the full RPC method string, i.e., /package.service/method.
64 FullMethod string
65 // IsClientStream indicates whether the RPC is a client streaming RPC.
66 IsClientStream bool
67 // IsServerStream indicates whether the RPC is a server streaming RPC.
68 IsServerStream bool
69}
70
71// StreamServerInterceptor provides a hook to intercept the execution of a streaming RPC on the server.
72// info contains all the information of this RPC the interceptor can operate on. And handler is the
73// service method implementation. It is the responsibility of the interceptor to invoke handler to
74// complete the RPC.
75type StreamServerInterceptor func(srv interface{}, ss ServerStream, info *StreamServerInfo, handler StreamHandler) error