Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
Needs string `json:"needs"`
GRPC struct {
ListenAddress string `json:"listen_address"`
// Default connection timeout is 120 seconds
// https://godoc.org/google.golang.org/grpc#ConnectionTimeout
ConnectionTimeoutSeconds uint32 `json:"connection_timeout_seconds"`
Certs certs.TLSCredsConfig `json:"certs"`
} `json:"grpc"`
Gateway struct {
ListenAddress string `json:"listen_address"`
AllowedOrigins []string `json:"allowed_origins"`
Certs certs.TLSCredsConfig `json:"certs"`
HTTP bool `json:"http"`
ReadTimeout time.Duration `json:"read_timeout"`
ReadHeaderTimeout time.Duration `json:"read_header_timeout"`
WriteTimeout time.Duration `json:"write_timeout"`
IdleTimeout time.Duration `json:"idle_timeout"`
} `json:"gateway"`
Health struct {
ListenAddress string `json:"listen_address"`
} `json:"health"`
}
type GRPCRegistrations ¶
type HandlerRegistrations ¶
type HealthServer ¶
HealthServer contains everything we need to be able to serve a health status endpoint.
type Server ¶
type Server struct {
Config *API
Server *grpc.Server
Listener net.Listener
Registrations GRPCRegistrations
Gateway Gateway
Health *HealthServer
Started chan bool
}
type ServiceFactory ¶
type ServiceFactory struct{}
func NewServiceFactory ¶
func NewServiceFactory() *ServiceFactory
func (*ServiceFactory) CreateService ¶
func (f *ServiceFactory) CreateService(config *API, opts []grpc.ServerOption, registrations GRPCRegistrations, handlerRegistrations HandlerRegistrations, withGateway bool) (*Server, error)
type ServiceInterface ¶
type ServiceManager ¶
type ServiceManager struct {
Context context.Context
Servers map[string]*Server
DependencyMap map[string]string
// contains filtered or unexported fields
}
func NewServiceManager ¶
func NewServiceManager(logger *zerolog.Logger) *ServiceManager
func (*ServiceManager) AddGRPCServer ¶
func (s *ServiceManager) AddGRPCServer(server *Server) error
func (*ServiceManager) StartServers ¶
func (s *ServiceManager) StartServers(ctx context.Context) error
func (*ServiceManager) StopServers ¶
func (s *ServiceManager) StopServers(ctx context.Context)
Click to show internal directories.
Click to hide internal directories.