Documentation ¶
Index ¶
Constants ¶
View Source
const ( DevMode = "dev" TestMode = "test" RtMode = "rt" PreMode = "pre" ProMode = "pro" ReleaseMode = "release" )
Variables ¶
View Source
var ( WithDialOption = internal.WithDialOption WithNonBlock = internal.WithNonBlock WithStreamClientInterceptor = internal.WithStreamClientInterceptor WithTimeout = internal.WithTimeout WithTransportCredentials = internal.WithTransportCredentials WithUnaryClientInterceptor = internal.WithUnaryClientInterceptor )
Functions ¶
func DontLogContextForMethod ¶
func DontLogContextForMethod(method string)
func SetClientSlowThreshold ¶
func SetServerSlowThreshold ¶
Types ¶
type Client ¶
func MustNewClient ¶
func MustNewClient(c RpcClientConf, options ...ClientOption) Client
func NewClient ¶
func NewClient(c RpcClientConf, options ...ClientOption) (Client, error)
func NewClientWithTarget ¶
func NewClientWithTarget(target string, opts ...ClientOption) (Client, error)
type ClientOption ¶
type ClientOption = internal.ClientOption
type RpcClient ¶
type RpcClient struct {
// contains filtered or unexported fields
}
func (*RpcClient) Conn ¶
func (rc *RpcClient) Conn() *grpc.ClientConn
type RpcClientConf ¶
type RpcServer ¶
type RpcServer struct {
// contains filtered or unexported fields
}
func MustNewServer ¶
func MustNewServer(c RpcServerConf, register internal.RegisterFn) *RpcServer
func NewServer ¶
func NewServer(c RpcServerConf, register internal.RegisterFn) (*RpcServer, error)
func (*RpcServer) AddOptions ¶
func (rs *RpcServer) AddOptions(options ...grpc.ServerOption)
func (*RpcServer) AddStreamInterceptors ¶
func (rs *RpcServer) AddStreamInterceptors(interceptors ...grpc.StreamServerInterceptor)
func (*RpcServer) AddUnaryInterceptors ¶
func (rs *RpcServer) AddUnaryInterceptors(interceptors ...grpc.UnaryServerInterceptor)
type RpcServerConf ¶
type RpcServerConf struct { ServiceConf `mapstructure:",squash"` Addr string `json:"Addr"` Timeout int64 `json:"Timeout"` }
Click to show internal directories.
Click to hide internal directories.