Documentation
¶
Overview ¶
Package server is a package for protocol of a micro service
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrRuntime = make(chan error)
ErrRuntime is an error channel, if it receive any signal will cause graceful shutdown of go chassis, process will exit
Functions ¶
func InstallPlugin ¶
InstallPlugin For developer
func UnRegistrySelfInstances ¶
func UnRegistrySelfInstances() error
UnRegistrySelfInstances this function removes the self instance
Types ¶
type NewFunc ¶
type NewFunc func(Options) ProtocolServer
NewFunc returns a ProtocolServer
func GetServerFunc ¶
GetServerFunc returns the server function
type Options ¶
type Options struct {
Address string
ChainName string
Provider provider.Provider
TLSConfig *tls.Config
}
Options is the options for service initiating
type ProtocolServer ¶
type ProtocolServer interface {
//Register a schema of microservice,return unique schema id,you can specify schema id and microservice name of this schema
Register(interface{}, ...RegisterOption) (string, error)
Start() error
Stop() error
String() string
}
ProtocolServer interface for the protocol server, a server should implement init, register, start, and stop
func GetServer ¶
func GetServer(protocol string) (ProtocolServer, error)
GetServer return the server based on protocol
type RegisterOption ¶
type RegisterOption func(*RegisterOptions)
RegisterOption is option when you register a schema to chassis
func WithSchemaID ¶
func WithSchemaID(schemaID string) RegisterOption
WithSchemaID you can specify a unique id for schema
type RegisterOptions ¶
type RegisterOptions struct {
SchemaID string
}
RegisterOptions is options when you register a schema to chassis