Documentation ¶
Overview ¶
Package servers ...
Package servers ...
Package servers ...
Package servers ...
Package servers ...
Package servers ...
Package servers ...
Package servers ...
Package servers ...
Index ¶
- type ConnectivityState
- func (cs *ConnectivityState) GetCurrentState() int64
- func (cs *ConnectivityState) GetStateByName(state string) int64
- func (cs *ConnectivityState) SetState(state string) error
- func (cs *ConnectivityState) SetStateConnecting()
- func (cs *ConnectivityState) SetStateDown()
- func (cs *ConnectivityState) SetStateFailed()
- func (cs *ConnectivityState) SetStateIdle()
- func (cs *ConnectivityState) SetStateReady()
- func (cs *ConnectivityState) SetStateShutdown()
- func (cs *ConnectivityState) String() string
- type Grpc
- type GrpcRest
- type HTTP
- type Serverer
- func NewGrpcRestServer(serv services.Servicer, opts options.Options, logger *logging.Entry) (Serverer, error)
- func NewGrpcServer(serv services.Servicer, opts options.Options, logger *logging.Entry) (Serverer, error)
- func NewHTTPServer(serv services.Servicer, opts options.Options, logger *logging.Entry) (Serverer, error)
- type WebSocket
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectivityState ¶
type ConnectivityState struct {
// contains filtered or unexported fields
}
ConnectivityState - Designed to keep track of server current connection state
func (*ConnectivityState) GetCurrentState ¶
func (cs *ConnectivityState) GetCurrentState() int64
GetCurrentState - Will return current state. If state is not set, it will return 0 which equals to state DOWN
func (*ConnectivityState) GetStateByName ¶
func (cs *ConnectivityState) GetStateByName(state string) int64
GetStateByName - Will attempt to figure out state by name. If state is not found it will return 0 which equals to DOWN
func (*ConnectivityState) SetState ¶
func (cs *ConnectivityState) SetState(state string) error
SetState - Will connection state. In case that state is not available it will return error
func (*ConnectivityState) SetStateConnecting ¶
func (cs *ConnectivityState) SetStateConnecting()
SetStateConnecting - Will set current state to CONNECTING
func (*ConnectivityState) SetStateDown ¶
func (cs *ConnectivityState) SetStateDown()
SetStateDown - Will set current state to DOWN
func (*ConnectivityState) SetStateFailed ¶
func (cs *ConnectivityState) SetStateFailed()
SetStateFailed - Will set current state to FAILED
func (*ConnectivityState) SetStateIdle ¶
func (cs *ConnectivityState) SetStateIdle()
SetStateIdle - Will set current state to IDLE
func (*ConnectivityState) SetStateReady ¶
func (cs *ConnectivityState) SetStateReady()
SetStateReady - Will set current state to READY
func (*ConnectivityState) SetStateShutdown ¶
func (cs *ConnectivityState) SetStateShutdown()
SetStateShutdown - Will set current state to SHUTDOWN
func (*ConnectivityState) String ¶
func (cs *ConnectivityState) String() string
String - Will return name of the state. If state cannot be found, empty string will be returned
type Grpc ¶
type Grpc struct { // IF grpc fails, it will restart it immediately... ListenForever bool // ConnectivityState indicates the state of a grpc connection. *ConnectivityState // Interrupt signals the listener to stop serving connections, // and the server to shut down. Interrupt chan os.Signal options.Options net.Listener *logging.Entry services.Servicer *grpc.Server // contains filtered or unexported fields }
Grpc - Wrapper on top of googles grpc.io server
func (*Grpc) Interface ¶
func (g *Grpc) Interface() interface{}
Interface - Will return current server as interface. This is useful in case you need to access portion of the struct that is not acccessibble via interface
func (*Grpc) Start ¶
Start - Proxy on top of grpc.Server with functionallity to auto restart if Grpc.ListenForever is set to be true.
func (*Grpc) State ¶
func (g *Grpc) State() *ConnectivityState
State - indicates the state of a grpc connection.
type GrpcRest ¶
type GrpcRest struct { options.Options *logging.Entry services.Servicer // ConnectivityState indicates the state of a http connection. *ConnectivityState *http.Server // ListenForever if set to true will restart it immediately if listening fails ListenForever bool // Limit the number of outstanding requests ListenLimit int // TLS Certificate TLSCertFile string // TLS Key TLSKeyFile string // Interrupt signals the listener to stop serving connections, // and the server to shut down. Interrupt chan os.Signal // Mutex is used to protect against concurrent calls to Stop sync.Mutex // contains filtered or unexported fields }
GrpcRest -
func (*GrpcRest) SetHandler ¶
SetHandler -
func (*GrpcRest) Start ¶
Start - Will attempt to start HTTP server depending on actual configuration In case that ListenForever is enabled we are going to try to restart server until server starts In case of interruption we are going to stop http server
func (*GrpcRest) State ¶
func (gr *GrpcRest) State() *ConnectivityState
State - State of the GRPC REST API connection @TODO
type HTTP ¶
type HTTP struct { options.Options *logging.Entry services.Servicer // ConnectivityState indicates the state of a http connection. *ConnectivityState *http.Server // ListenForever if set to true will restart it immediately if listening fails ListenForever bool // Limit the number of outstanding requests ListenLimit int TLSCertFile string TLSKeyFile string UseTLS bool // Interrupt signals the listener to stop serving connections, // and the server to shut down. Interrupt chan os.Signal // Mutex is used to protect against concurrent calls to Stop sync.Mutex // contains filtered or unexported fields }
HTTP -
func (*HTTP) Start ¶
Start - Will attempt to start HTTP server depending on actual configuration In case that ListenForever is enabled we are going to try to restart server until server starts In case of interruption we are going to stop http server
func (*HTTP) State ¶
func (h *HTTP) State() *ConnectivityState
State - State of the HTTP connection @TODO
type Serverer ¶
type Serverer interface { Start() error Stop() error Restart() error Interface() interface{} State() *ConnectivityState }
Serverer - Global server interface that ALL servers should satisfy
func NewGrpcRestServer ¶
func NewGrpcRestServer(serv services.Servicer, opts options.Options, logger *logging.Entry) (Serverer, error)
NewGrpcRestServer -