Documentation ¶
Index ¶
- Variables
- type API
- type GRPCOptions
- type GRPCRegistrations
- type Gateway
- type GatewayOptions
- type HandlerRegistrations
- type Health
- type Service
- type ServiceFactory
- type ServiceInterface
- type ServiceManager
- func (s *ServiceManager) AddGRPCServer(server *Service) error
- func (s *ServiceManager) SetupHealthServer(address string, certCfg *aserto.TLSConfig) error
- func (s *ServiceManager) SetupMetricsServer(address string, certCfg *aserto.TLSConfig, enableZpages bool) ([]grpc.ServerOption, error)
- func (s *ServiceManager) StartServers(ctx context.Context) error
- func (s *ServiceManager) StopServers(ctx context.Context)
- func (s *ServiceManager) WithShutdownTimeout(seconds int) *ServiceManager
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultGatewayAllowedHeaders = []string{ headers.Authorization, headers.ContentType, headers.IfMatch, headers.IfNoneMatch, "Depth", }
View Source
var DefaultGatewayAllowedMethods = []string{ http.MethodGet, http.MethodPost, http.MethodHead, http.MethodDelete, http.MethodPut, http.MethodPatch, "PROPFIND", "MKCOL", "COPY", "MOVE", }
View Source
var DefaultGatewayAllowedOrigins = []string{
"http://localhost",
"http://localhost:*",
"https://localhost",
"https://localhost:*",
"http://127.0.0.1",
"http://127.0.0.1:*",
"https://127.0.0.1",
"https://127.0.0.1:*",
}
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { Needs []string `json:"needs"` GRPC struct { FQDN string `json:"fqdn"` 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 aserto.TLSConfig `json:"certs"` } `json:"grpc"` Gateway struct { FQDN string `json:"fqdn"` ListenAddress string `json:"listen_address"` AllowedOrigins []string `json:"allowed_origins"` AllowedHeaders []string `json:"allowed_headers"` AllowedMethods []string `json:"allowed_methods"` Certs aserto.TLSConfig `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"` }
type GRPCOptions ¶
type GRPCOptions struct { ServerOptions []grpc.ServerOption Registrations GRPCRegistrations }
type GRPCRegistrations ¶
type Gateway ¶
func (*Gateway) AddHandler ¶
func (g *Gateway) AddHandler(pattern string, handler http.HandlerFunc)
type GatewayOptions ¶
type GatewayOptions struct { HandlerRegistrations HandlerRegistrations ErrorHandler runtime.ErrorHandlerFunc }
type HandlerRegistrations ¶
type Health ¶
func (*Health) SetServiceStatus ¶
func (h *Health) SetServiceStatus(service string, status healthpb.HealthCheckResponse_ServingStatus)
type ServiceFactory ¶
type ServiceFactory struct{}
func NewServiceFactory ¶
func NewServiceFactory() *ServiceFactory
func (*ServiceFactory) CreateService ¶
func (f *ServiceFactory) CreateService( config *API, grpcOpts *GRPCOptions, gatewayOpts *GatewayOptions, cleanup ...func(), ) (*Service, error)
type ServiceInterface ¶
type ServiceManager ¶
type ServiceManager struct { Context context.Context Servers map[string]*Service DependencyMap map[string][]string HealthServer *Health MetricServer *http.Server // contains filtered or unexported fields }
func NewServiceManager ¶
func NewServiceManager(logger *zerolog.Logger) *ServiceManager
func (*ServiceManager) AddGRPCServer ¶
func (s *ServiceManager) AddGRPCServer(server *Service) error
func (*ServiceManager) SetupHealthServer ¶
func (s *ServiceManager) SetupHealthServer(address string, certCfg *aserto.TLSConfig) error
func (*ServiceManager) SetupMetricsServer ¶
func (s *ServiceManager) SetupMetricsServer(address string, certCfg *aserto.TLSConfig, enableZpages bool) ([]grpc.ServerOption, error, )
func (*ServiceManager) StartServers ¶
func (s *ServiceManager) StartServers(ctx context.Context) error
func (*ServiceManager) StopServers ¶
func (s *ServiceManager) StopServers(ctx context.Context)
func (*ServiceManager) WithShutdownTimeout ¶
func (s *ServiceManager) WithShutdownTimeout(seconds int) *ServiceManager
Click to show internal directories.
Click to hide internal directories.