Documentation ¶
Index ¶
Constants ¶
View Source
const ( Name = "grpc_entry" // The register expiry time RegisterTTL = time.Minute // The interval on which to register RegisterInterval = time.Second * 30 // DefaultMaxMsgSize define maximum message size that server can send // or receive. Default value is 4MB. DefaultMaxMsgSize = 1024 * 1024 * 4 DefaultSleepAfterDeregister = time.Second * 2 // The register expiry time DefaultRegisterTTL = time.Minute // The interval on which to register DefaultRegisterInterval = time.Second * 30 )
Variables ¶
View Source
var DefaultCfg = Cfg{
MaxReceiveMessageSize: 1,
MaxSendMessageSize: 1,
}
View Source
var (
DefaultId = uuid.New().String()
)
Functions ¶
func GetDefaultServerOpts ¶
func GetDefaultServerOpts() []grpc.ServerOption
Types ¶
type Cfg ¶
type Cfg struct { Gw struct { Addr string `json:"addr"` } `json:"gw"` SleepAfterDeregister time.Duration `json:"SleepAfterDeregister"` RegisterInterval time.Duration `json:"RegisterInterval"` RegisterTTL string `json:"register_ttl"` Address string `json:"address"` Advertise string `json:"advertise"` Codec string `json:"codec"` ConnectionTimeout string `json:"connection_timeout"` Cp string `json:"cp"` Creds string `json:"creds"` Dc string `json:"dc"` HeaderTableSize int64 `json:"header_table_size"` InitialConnWindowSize int64 `json:"initial_conn_window_size"` InitialWindowSize int64 `json:"initial_window_size"` KeepaliveParams struct { MaxConnectionAge string `json:"max_connection_age"` MaxConnectionAgeGrace string `json:"max_connection_age_grace"` MaxConnectionIdle string `json:"max_connection_idle"` Time string `json:"time"` Timeout string `json:"timeout"` } `json:"keepalive_params"` KeepalivePolicy struct { MinTime string `json:"min_time"` PermitWithoutStream bool `json:"permit_without_stream"` } `json:"keepalive_policy"` MaxConcurrentStreams int64 `json:"max_concurrent_streams"` MaxHeaderListSize int64 `json:"max_header_list_size"` MaxReceiveMessageSize int `json:"max_receive_message_size"` MaxSendMessageSize int `json:"max_send_message_size"` ReadBufferSize int64 `json:"read_buffer_size"` WriteBufferSize int64 `json:"write_buffer_size"` // contains filtered or unexported fields }
type Entry ¶
type Entry interface { entry.Entry Register(handler interface{}, opts ...Option) InitOpts(opts ...grpc.ServerOption) UnaryInterceptor(interceptors ...grpc.UnaryServerInterceptor) StreamInterceptor(interceptors ...grpc.StreamServerInterceptor) }
type WrappedServerStream ¶
type WrappedServerStream = grpcMiddleware.WrappedServerStream
func WrapServerStream ¶
func WrapServerStream(stream grpc.ServerStream) *WrappedServerStream
Source Files ¶
Click to show internal directories.
Click to hide internal directories.