Documentation ¶
Index ¶
- Constants
- func LoadConfig(cfg string, defaultName string)
- func RequestShutdown() bool
- func SetupSignalHandler() <-chan struct{}
- type CertKey
- type CompletedConfig
- type Config
- type GRPCServingInfo
- type GenericGRPCServer
- func (s *GenericGRPCServer) Close()
- func (s *GenericGRPCServer) InstallMiddlewares()
- func (s *GenericGRPCServer) InstallRAClient()
- func (s *GenericGRPCServer) InstallServices()
- func (s *GenericGRPCServer) RegisterServices(registers map[string]service_register.ServiceRegister)
- func (s *GenericGRPCServer) Run() error
- func (s *GenericGRPCServer) Setup()
- type InsecureServingInfo
- type RAInfo
- type SecureServingInfo
Constants ¶
const ( // RecommendedHomeDir defines the default directory used to place all bifrost service configurations. RecommendedHomeDir = ".bifrost" // RecommendedEnvPrefix defines the ENV prefix used by all bifrost service. RecommendedEnvPrefix = "BIFROST" )
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
LoadConfig reads in config file and ENV variables if set.
func RequestShutdown ¶
func RequestShutdown() bool
RequestShutdown emulates a received event that is considered as shutdown signal (SIGTERM/SIGINT) This returns whether a handler was notified.
func SetupSignalHandler ¶
func SetupSignalHandler() <-chan struct{}
SetupSignalHandler registered for SIGTERM and SIGINT. A stop channel is returned which is closed on one of these signals. If a second signal is caught, the program is terminated with exit code 1.
Types ¶
type CertKey ¶
type CertKey struct { // CertFile is a file containing a PEM-encoded certificate, and possibly the complete certificate chain CertFile string // KeyFile is a file containing a PEM-encoded private key for the certificate specified by CertFile KeyFile string }
CertKey contains configuration items related to certificate.
type CompletedConfig ¶
type CompletedConfig struct {
*Config
}
CompletedConfig is the completed configuration for GenericServer.
func (CompletedConfig) NewGRPCServer ¶
func (c CompletedConfig) NewGRPCServer() (*GenericGRPCServer, error)
NewGRPCServer returns a new instance of GenericGRPCServer from the given config.
type Config ¶
type Config struct { SecureServing *SecureServingInfo InsecureServing *InsecureServingInfo RA *RAInfo GRPCServing *GRPCServingInfo Middlewares []string Healthz bool EnableProfiling bool EnableMetrics bool }
Config is a structure used to configure a GenericGRPCServer. Its members are sorted roughly in order of importance for composers.
func NewConfig ¶
func NewConfig() *Config
NewConfig returns a Config struct with the default values.
func (*Config) Complete ¶
func (c *Config) Complete() CompletedConfig
Complete fills in any fields not set that are required to have valid data and can be derived from other fields. If you're going to `ApplyOptions`, do that first. It's mutating the receiver.
type GRPCServingInfo ¶
func NewGRPCSeringInfo ¶
func NewGRPCSeringInfo() *GRPCServingInfo
type GenericGRPCServer ¶
type GenericGRPCServer struct { // SecureServingInfo holds configuration of the TLS server. SecureServingInfo *SecureServingInfo // InsecureServingInfo holds configuration of the insecure grpc server. InsecureServingInfo *InsecureServingInfo // RAInfo holds configuration of th Registration Authority server. RAInfo *RAInfo // ChunkSize set chunk size of the grpc server. ChunkSize int // ReceiveTimeout is the timeout used for the grpc server receiving data. ReceiveTimeout time.Duration // ShutdownTimeout is the timeout used for server shutdown. This specifies the timeout before server // gracefully shutdown returns. ShutdownTimeout time.Duration // contains filtered or unexported fields }
GenericGRPCServer contains state for a bifrost api server.
func (*GenericGRPCServer) Close ¶
func (s *GenericGRPCServer) Close()
Close graceful shutdown the api server.
func (*GenericGRPCServer) InstallMiddlewares ¶
func (s *GenericGRPCServer) InstallMiddlewares()
func (*GenericGRPCServer) InstallRAClient ¶
func (s *GenericGRPCServer) InstallRAClient()
func (*GenericGRPCServer) InstallServices ¶
func (s *GenericGRPCServer) InstallServices()
func (*GenericGRPCServer) RegisterServices ¶
func (s *GenericGRPCServer) RegisterServices(registers map[string]service_register.ServiceRegister)
func (*GenericGRPCServer) Run ¶
func (s *GenericGRPCServer) Run() error
Run spawns the http server. It only returns when the port cannot be listened on initially.
func (*GenericGRPCServer) Setup ¶
func (s *GenericGRPCServer) Setup()
type InsecureServingInfo ¶
InsecureServingInfo holds configuration of the insecure grpc server.
func (*InsecureServingInfo) Address ¶
func (i *InsecureServingInfo) Address() string
type SecureServingInfo ¶
SecureServingInfo holds configuration of the TLS server.
func (*SecureServingInfo) Address ¶
func (s *SecureServingInfo) Address() string
Address join host IP address and host port number into an address string, like: 0.0.0.0:8443.