Documentation
¶
Index ¶
- func ClientAuthTypeMap(ca ClientAuthType) tls.ClientAuthType
- func GenClientTLSConfig(cfg *GRPCClientTLSConfig) (tlsConfig *tls.Config, err error)
- func GenServerTLSConfig(cfg *GRPCServerTLSConfig) (tlsConfig *tls.Config, err error)
- func GetDiscoveryHostAndPort(externalAddress, listeningAddress string) (host string, port int, err error)
- func NewGRPCWebHandler(parameters GRPCWebHandlerInputParameters) (http.Handler, error)
- func SignalContext(ctx context.Context, logger l.Wrapper) context.Context
- type AbstractServer
- type BeforeServerStart
- type ClientAuthType
- type DiscoveryExConfig
- type GRPCClientTLSConfig
- type GRPCClientTLSFileConfig
- type GRPCServer
- type GRPCServerConfig
- type GRPCServerTLSConfig
- type GRPCServerTLSFileConfig
- type GRPCWebHandlerInputParameters
- type HTTPServer
- type HTTPServerConfig
- type ServerHelper
- type ServerToolset
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientAuthTypeMap ¶ added in v0.0.38
func ClientAuthTypeMap(ca ClientAuthType) tls.ClientAuthType
func GenClientTLSConfig ¶
func GenClientTLSConfig(cfg *GRPCClientTLSConfig) (tlsConfig *tls.Config, err error)
func GenServerTLSConfig ¶
func GenServerTLSConfig(cfg *GRPCServerTLSConfig) (tlsConfig *tls.Config, err error)
func GetDiscoveryHostAndPort ¶ added in v0.0.22
func NewGRPCWebHandler ¶
func NewGRPCWebHandler(parameters GRPCWebHandlerInputParameters) (http.Handler, error)
Types ¶
type AbstractServer ¶
type BeforeServerStart ¶
type ClientAuthType ¶ added in v0.0.38
type ClientAuthType int
const ( RequireAndVerifyClientCert ClientAuthType = iota NoClientCert RequestClientCert RequireAnyClientCert VerifyClientCertIfGiven )
type DiscoveryExConfig ¶
type GRPCClientTLSConfig ¶ added in v0.0.38
type GRPCClientTLSConfig struct {
DisableSystemPool bool `yaml:"DisableSystemPool" json:"disable_system_pool"`
ServerName string `yaml:"ServerName" json:"server_name"`
InsecureSkipVerify bool `yaml:"InsecureSkipVerify" json:"insecure_skip_verify"`
RootCAs [][]byte `yaml:"RootCAs" json:"root_cas" `
Cert []byte `yaml:"Cert" json:"cert"`
Key []byte `yaml:"Key" json:"key"`
}
func GRPCClientTLSConfigMap ¶ added in v0.0.38
func GRPCClientTLSConfigMap(fileCfg *GRPCClientTLSFileConfig) (*GRPCClientTLSConfig, error)
type GRPCClientTLSFileConfig ¶ added in v0.0.38
type GRPCClientTLSFileConfig struct {
DisableSystemPool bool `yaml:"DisableSystemPool" json:"disable_system_pool"`
ServerName string `yaml:"ServerName" json:"server_name"`
InsecureSkipVerify bool `yaml:"InsecureSkipVerify" json:"insecure_skip_verify"`
RootCAs []string `yaml:"RootCAs" json:"root_cas" `
Cert string `yaml:"Cert" json:"cert"`
Key string `yaml:"Key" json:"key"`
}
type GRPCServer ¶
type GRPCServer interface {
Start(init BeforeServerStart) (err error)
Wait()
Stop()
StopAndWait()
Run(ctx context.Context) (err error)
}
func NewGRPCServer ¶
func NewGRPCServer(routineMan routineman.RoutineMan, cfg *GRPCServerConfig, opts []grpc.ServerOption, defInit BeforeServerStart, logger l.Wrapper, extraInterceptors ...interface{}) (GRPCServer, error)
type GRPCServerConfig ¶
type GRPCServerConfig struct {
Address string `yaml:"address" json:"address"`
TLSConfig *GRPCServerTLSConfig `yaml:"tls_config" json:"tls_config"`
WebAddress string `yaml:"web_address" json:"web_address"`
Name string `yaml:"name" json:"name"`
MetaTransKeys []string `yaml:"meta_trans_keys" json:"meta_trans_keys"`
DiscoveryExConfig *DiscoveryExConfig `yaml:"discovery_ex_config" json:"discovery_ex_config"`
KeepAliveDuration time.Duration `yaml:"keep_alive_duration" json:"keep_alive_duration"`
EnforcementPolicyMinTime time.Duration `yaml:"enforcement_policy_min_time" json:"enforcement_policy_min_time"`
}
type GRPCServerTLSConfig ¶ added in v0.0.38
type GRPCServerTLSConfig struct {
DisableSystemPool bool `yaml:"DisableSystemPool" json:"disable_system_pool"`
ClientAuth ClientAuthType `yaml:"ClientAuth" json:"client_auth"`
RootCAs [][]byte `yaml:"RootCAs" json:"root_cas" `
Cert []byte `yaml:"Cert" json:"cert"`
Key []byte `yaml:"Key" json:"key"`
}
func GRPCServerTLSConfigMap ¶ added in v0.0.38
func GRPCServerTLSConfigMap(fileCfg *GRPCServerTLSFileConfig) (*GRPCServerTLSConfig, error)
type GRPCServerTLSFileConfig ¶ added in v0.0.38
type GRPCServerTLSFileConfig struct {
DisableSystemPool bool `yaml:"DisableSystemPool" json:"disable_system_pool"`
ClientAuth ClientAuthType `yaml:"ClientAuth" json:"client_auth"`
RootCAs []string `yaml:"RootCAs" json:"root_cas" `
Cert string `yaml:"Cert" json:"cert"`
Key string `yaml:"Key" json:"key"`
}
type HTTPServer ¶
func NewHTTPServer ¶
func NewHTTPServer(name, address string, handler http.Handler, discoveryExConfig *DiscoveryExConfig, logger l.Wrapper) HTTPServer
type HTTPServerConfig ¶ added in v0.0.18
type HTTPServerConfig struct {
Name string `yaml:"name" json:"name"`
Address string `yaml:"address" json:"address"`
Handler http.Handler `json:"-" yaml:"-"`
DiscoveryExConfig DiscoveryExConfig `yaml:"discovery_ex_config" json:"discovery_ex_config"`
}
type ServerHelper ¶
type ServerHelper struct {
// contains filtered or unexported fields
}
func NewServerHelper ¶
func NewServerHelper(ctx context.Context, logger l.Wrapper) *ServerHelper
func (*ServerHelper) StartServer ¶
func (sh *ServerHelper) StartServer(s AbstractServer)
func (*ServerHelper) Wait ¶
func (sh *ServerHelper) Wait()
type ServerToolset ¶
type ServerToolset struct {
// contains filtered or unexported fields
}
func NewServerToolset ¶
func NewServerToolset(ctx context.Context, logger l.Wrapper) *ServerToolset
func (*ServerToolset) CreateGRpcServer ¶
func (st *ServerToolset) CreateGRpcServer(cfg *GRPCServerConfig, opts []grpc.ServerOption, beforeServerStart BeforeServerStart) (err error)
func (*ServerToolset) CreateHTTPServer ¶ added in v0.0.18
func (st *ServerToolset) CreateHTTPServer(cfg *HTTPServerConfig) error
func (*ServerToolset) Start ¶
func (st *ServerToolset) Start() error
func (*ServerToolset) Wait ¶
func (st *ServerToolset) Wait()
Click to show internal directories.
Click to hide internal directories.