Documentation ¶
Index ¶
- type GRPCRegistrator
- type RouteRegistrator
- type Server
- func (e *Server) AddService(svc Service)
- func (e *Server) Audit(source string, eventType string, identity string, contextID string, ...)
- func (e *Server) Close()
- func (e *Server) Configuration() *config.HTTPServer
- func (e *Server) Discovery() appcontainer.Discovery
- func (e *Server) Err() <-chan error
- func (e *Server) Hostname() string
- func (e *Server) IsReady() bool
- func (e *Server) ListenURLs() []string
- func (e *Server) LocalIP() string
- func (e *Server) Name() string
- func (e *Server) Service(name string) Service
- func (e *Server) StartedAt() time.Time
- type Service
- type ServiceFactory
- type StartSubcriber
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GRPCRegistrator ¶
GRPCRegistrator provides interface to register gRPC service
type RouteRegistrator ¶
RouteRegistrator provides interface to register HTTP route
type Server ¶
Server contains a running trusty server and its listeners.
func Start ¶
func Start( name string, cfg *config.HTTPServer, container *dig.Container, serviceFactories map[string]ServiceFactory, ) (e *Server, err error)
Start returns running Server
func (*Server) Audit ¶
func (e *Server) Audit( source string, eventType string, identity string, contextID string, raftIndex uint64, message string)
Audit create an audit event
func (*Server) Close ¶
func (e *Server) Close()
Close gracefully shuts down all servers/listeners. Client requests will be terminated with request timeout. After timeout, enforce remaning requests be closed immediately.
func (*Server) Configuration ¶
func (e *Server) Configuration() *config.HTTPServer
Configuration of the server
func (*Server) Discovery ¶
func (e *Server) Discovery() appcontainer.Discovery
Discovery returns Discovery interface
func (*Server) ListenURLs ¶
ListenURLs is the list of URLs that the server listens on
type Service ¶
type Service interface { Name() string Close() // IsReady indicates that service is ready to serve its end-points IsReady() bool }
Service provides a way for subservices to be registered so they get added to the http API.
type ServiceFactory ¶
type ServiceFactory func(*Server) interface{}
ServiceFactory is interface to create Services
type StartSubcriber ¶
type StartSubcriber interface { // OnStarted is called when the server started and // is ready to serve requests OnStarted() error }
StartSubcriber provides