Documentation
¶
Index ¶
Constants ¶
const ( // RecommendedHomeDir defines the default directory used to place all generic service configurations. RecommendedHomeDir = ".echoryn" // RecommendedEnvPrefix defines the ENV prefix used by all generic service. RecommendedEnvPrefix = "echoryn" )
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
LoadConfig reads in config file and ENV variables if set. When optional is true, missing config files are silently ignored (CLI Tool behaviour, like kubectl). When false, a WARN is emitted (server behaviour)
Types ¶
type CompletedConfig ¶
type CompletedConfig struct {
*Config
}
CompletedConfig is the completed configuration for GenericAPIServer.
func (CompletedConfig) New ¶
func (c CompletedConfig) New() (*GenericAPIServer, error)
New returns a new instance of GenericAPIServer from the given config.
type Config ¶
type Config struct {
Serving *ServingInfo
Mode string
Middlewares []string
Healthz bool
EnableProfiling bool
EnableMetrics bool
}
Config is a structure used to configure a GenericAPIServer. Its members are sorted roughly in order of importance for composers.
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 GRPCAPIServer ¶
func NewGRPCAPIServer ¶
func NewGRPCAPIServer(srv *grpc.Server, address string) *GRPCAPIServer
func (*GRPCAPIServer) Close ¶
func (s *GRPCAPIServer) Close()
func (*GRPCAPIServer) Run ¶
func (s *GRPCAPIServer) Run()
type GenericAPIServer ¶
type GenericAPIServer struct {
// ServingInfo holds configuration of the TLS server.
ServingInfo *ServingInfo
// ShutdownTimeout is the timeout used for server shutdown. This specifies the timeout before server
// gracefully shutdown returns.
ShutdownTimeout time.Duration
*gin.Engine
Server *http.Server
// contains filtered or unexported fields
}
GenericAPIServer contains state for a generic api server. type GenericAPIServer gin.Engine.
func (*GenericAPIServer) Close ¶
func (s *GenericAPIServer) Close()
Close graceful shutdown the api server.
func (*GenericAPIServer) InstallAPIs ¶
func (s *GenericAPIServer) InstallAPIs()
func (*GenericAPIServer) InstallMiddlewares ¶
func (s *GenericAPIServer) InstallMiddlewares()
InstallMiddlewares installs middlewares to gin engine.
func (*GenericAPIServer) Run ¶
func (s *GenericAPIServer) Run() error
func (*GenericAPIServer) Setup ¶
func (s *GenericAPIServer) Setup()
Setup do some setup work for gin engine.
type ServingInfo ¶
ServingInfo holds configuration
func (*ServingInfo) Address ¶
func (s *ServingInfo) Address() string
Address join host IP address and host port number into an address string, like: 0.0.0.0:11789.