Documentation ¶
Index ¶
- func ListenAndServe(c Server, svcDisc ServiceRegisterInterface, cancel context.CancelFunc) error
- func StartServer(ctx context.Context, cancel context.CancelFunc, e *Engine, ...) error
- type BackboneParameter
- type CCContextInterface
- type Config
- type Engine
- func (e *Engine) ApiMachineryConfig() *util.APIMachineryConfig
- func (e *Engine) Discovery() discovery.DiscoveryInterface
- func (e *Engine) Metric() *metrics.Service
- func (e *Engine) Ping() error
- func (e *Engine) ServiceManageClient() *zk.ZkClient
- func (e *Engine) WithMongo(prefixes ...string) (mongo.Config, error)
- func (e *Engine) WithRedis(prefixes ...string) (redis.Config, error)
- type Server
- type ServiceRegisterInterface
- type TLSConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListenAndServe ¶
func ListenAndServe(c Server, svcDisc ServiceRegisterInterface, cancel context.CancelFunc) error
Types ¶
type BackboneParameter ¶
type BackboneParameter struct { // ConfigUpdate handle process config change ConfigUpdate cc.ProcHandlerFunc ExtraUpdate cc.ProcHandlerFunc // service component addr Regdiscv string // config path ConfigPath string // http server parameter SrvInfo *types.ServerInfo }
BackboneParameter Used to constrain different services to ensure consistency of service startup capabilities
type CCContextInterface ¶
type CCContextInterface interface {
WithCancel() (context.Context, context.CancelFunc)
}
type Config ¶
type Config struct { RegisterPath string RegisterInfo types.ServerInfo CoreAPI apimachinery.ClientSetInterface }
type Engine ¶
type Engine struct { CoreAPI apimachinery.ClientSetInterface ServiceManageInterface discovery.ServiceManageInterface SvcDisc ServiceRegisterInterface sync.Mutex ServerInfo types.ServerInfo Language language.CCLanguageIf CCErr errors.CCErrorIf CCCtx CCContextInterface // contains filtered or unexported fields }
func NewBackbone ¶
func NewBackbone(ctx context.Context, input *BackboneParameter) (*Engine, error)
func NewMockBackbone ¶
func (*Engine) ApiMachineryConfig ¶
func (e *Engine) ApiMachineryConfig() *util.APIMachineryConfig
func (*Engine) Discovery ¶
func (e *Engine) Discovery() discovery.DiscoveryInterface
func (*Engine) ServiceManageClient ¶
type ServiceRegisterInterface ¶
type ServiceRegisterInterface interface { // Ping to ping server Ping() error // register local server info, it can only be called for once. Register(path string, c types.ServerInfo) error // Cancel to stop server register and discover Cancel() // ClearRegisterPath to delete server register path from zk ClearRegisterPath() error }
func NewServiceRegister ¶
func NewServiceRegister(client *zk.ZkClient) (ServiceRegisterInterface, error)
type TLSConfig ¶
type TLSConfig struct { // Server should be accessed without verifying the TLS certificate. For testing only. InsecureSkipVerify bool // Server requires TLS client certificate authentication CertFile string // Server requires TLS client certificate authentication KeyFile string // Trusted root certificates for server CAFile string // the password to decrypt the certificate Password string }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.