-
Notifications
You must be signed in to change notification settings - Fork 5
/
grpc.go
66 lines (63 loc) · 3.07 KB
/
grpc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Code generated by counterfeiter. DO NOT EDIT.
// with command: counterfeiter -p -o /Users/pivotal/workspace/diego-release/src/code.cloudfoundry.org/goshims/grpcshim google.golang.org/grpc
package grpcshim
import (
"net"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/naming"
"google.golang.org/grpc/stats"
"google.golang.org/grpc/tap"
)
//go:generate counterfeiter -o grpc_fake/fake_grpc.go . Grpc
type Grpc interface {
RoundRobin(r naming.Resolver) grpc.Balancer
Invoke(ctx context.Context, method string, args, reply interface{}, cc *grpc.ClientConn, opts ...grpc.CallOption) error
WithCodec(c grpc.Codec) grpc.DialOption
WithCompressor(cp grpc.Compressor) grpc.DialOption
WithDecompressor(dc grpc.Decompressor) grpc.DialOption
WithBalancer(b grpc.Balancer) grpc.DialOption
WithServiceConfig(c <-chan grpc.ServiceConfig) grpc.DialOption
WithBackoffMaxDelay(md time.Duration) grpc.DialOption
WithBackoffConfig(b grpc.BackoffConfig) grpc.DialOption
WithBlock() grpc.DialOption
WithInsecure() grpc.DialOption
WithTransportCredentials(creds credentials.TransportCredentials) grpc.DialOption
WithPerRPCCredentials(creds credentials.PerRPCCredentials) grpc.DialOption
WithTimeout(d time.Duration) grpc.DialOption
WithDialer(f func(string, time.Duration) (net.Conn, error)) grpc.DialOption
WithStatsHandler(h stats.Handler) grpc.DialOption
FailOnNonTempDialError(f bool) grpc.DialOption
WithUserAgent(s string) grpc.DialOption
WithUnaryInterceptor(f grpc.UnaryClientInterceptor) grpc.DialOption
WithStreamInterceptor(f grpc.StreamClientInterceptor) grpc.DialOption
Dial(target string, opts ...grpc.DialOption) (ClientConn, error)
DialContext(ctx context.Context, target string, opts ...grpc.DialOption) (conn *grpc.ClientConn, err error)
NewGZIPCompressor() grpc.Compressor
NewGZIPDecompressor() grpc.Decompressor
Header(md *metadata.MD) grpc.CallOption
Trailer(md *metadata.MD) grpc.CallOption
FailFast(failFast bool) grpc.CallOption
Code(err error) codes.Code
ErrorDesc(err error) string
Errorf(c codes.Code, format string, a ...interface{}) error
CustomCodec(codec grpc.Codec) grpc.ServerOption
RPCCompressor(cp grpc.Compressor) grpc.ServerOption
RPCDecompressor(dc grpc.Decompressor) grpc.ServerOption
MaxMsgSize(m int) grpc.ServerOption
MaxConcurrentStreams(n uint32) grpc.ServerOption
Creds(c credentials.TransportCredentials) grpc.ServerOption
UnaryInterceptor(i grpc.UnaryServerInterceptor) grpc.ServerOption
StreamInterceptor(i grpc.StreamServerInterceptor) grpc.ServerOption
InTapHandle(h tap.ServerInHandle) grpc.ServerOption
StatsHandler(h stats.Handler) grpc.ServerOption
NewServer(opt ...grpc.ServerOption) *grpc.Server
SetHeader(ctx context.Context, md metadata.MD) error
SendHeader(ctx context.Context, md metadata.MD) error
SetTrailer(ctx context.Context, md metadata.MD) error
NewClientStream(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, opts ...grpc.CallOption) (_ grpc.ClientStream, err error)
}