Documentation
¶
Index ¶
- Variables
- type Client
- type ClientOption
- type ClientOptions
- type Server
- type ServerOption
- func Address(a string) ServerOption
- func Id(id string) ServerOption
- func Metadata(md map[string]string) ServerOption
- func MetricsAddress(a string) ServerOption
- func MetricsPath(p string) ServerOption
- func Name(n string) ServerOption
- func RegisterInterval(t time.Duration) ServerOption
- func RegisterTTL(t time.Duration) ServerOption
- func StreamServerInterceptor(u ...grpc.StreamServerInterceptor) ServerOption
- func UnaryServerInterceptor(u ...grpc.UnaryServerInterceptor) ServerOption
- func Version(v string) ServerOption
- type ServerOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultAddress = ":0" DefaultName = "stark.rpc.server" DefaultVersion = time.Now().Format("2006.01.02.15.04") DefaultId = uuid.New().String() DefaultRegisterInterval = time.Second * 30 DefaultRegisterTTL = time.Minute )
View Source
var (
DefaultTimeout = time.Second * 2
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Conn ¶
func (c *Client) Conn() *grpc.ClientConn
type ClientOption ¶
type ClientOption func(*ClientOptions)
func GrpcDialOption ¶
func GrpcDialOption(do ...grpc.DialOption) ClientOption
func StreamClientInterceptors ¶
func StreamClientInterceptors(u ...grpc.StreamClientInterceptor) ClientOption
func Timeout ¶
func Timeout(t time.Duration) ClientOption
func UnaryClientInterceptor ¶
func UnaryClientInterceptor(u ...grpc.UnaryClientInterceptor) ClientOption
type ClientOptions ¶
type ClientOptions struct { Timeout time.Duration GrpcOpts []grpc.DialOption }
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) GrpcServer ¶
func (*Server) Options ¶
func (g *Server) Options() ServerOptions
func (*Server) RegisterEndpoints ¶
func (g *Server) RegisterEndpoints(service ...interface{})
type ServerOption ¶
type ServerOption func(*ServerOptions)
func Metadata ¶
func Metadata(md map[string]string) ServerOption
Metadata associated with the server
func MetricsAddress ¶
func MetricsAddress(a string) ServerOption
func MetricsPath ¶
func MetricsPath(p string) ServerOption
func RegisterInterval ¶
func RegisterInterval(t time.Duration) ServerOption
RegisterInterval register the service with at interval
func RegisterTTL ¶
func RegisterTTL(t time.Duration) ServerOption
RegisterTTL register the service with a TTL
func StreamServerInterceptor ¶
func StreamServerInterceptor(u ...grpc.StreamServerInterceptor) ServerOption
StreamServerInterceptor to be used to configure gRPC options
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(u ...grpc.UnaryServerInterceptor) ServerOption
UnaryServerInterceptor to be used to configure gRPC options
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
client
|
|
selector/static
Package static provides a static resolver which returns the name/ip passed in without any change
|
Package static provides a static resolver which returns the name/ip passed in without any change |
server
|
|
Click to show internal directories.
Click to hide internal directories.