Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter uses for converting bkbcs service discovery information to inner register data structures
func NewAdapter ¶
func NewAdapter(option *ServerOptions, standardModules []string) *Adapter
NewAdapter create service data conversion
func (*Adapter) GetGrpcService ¶
GetGrpcService interface for go-micro grpc module data conversion @param: module, all kind module name, such as logmanager, usermanager @param: svc, go-micro service definition, came form etcd registry
func (*Adapter) GetHTTPService ¶
GetHTTPService interface for go-micro http module data conversion only support standard new module api registration
func (*Adapter) GetService ¶
GetService interface for all service data conversion
type DiscoveryServer ¶
type DiscoveryServer struct {
// contains filtered or unexported fields
}
DiscoveryServer holds all resources for services discovery
func (*DiscoveryServer) Init ¶
func (s *DiscoveryServer) Init(option *ServerOptions) error
Init init all running resources, including 1. configuration validation 2. connecting gateway admin api 3. init backend service information adapter
func (*DiscoveryServer) Run ¶
func (s *DiscoveryServer) Run() error
Run running all necessary convertion logic, block
type EtcdRegistry ¶
type EtcdRegistry struct { Feature bool `json:"etcd_feature" value:"false" usage:"switch that turn on etcd registry feature"` GrpcModules string `json:"etcd_grpc_modules" value:"MeshManager,LogManager" usage:"modules that support grpc interface"` HTTPModules string `json:"etcd_http_modules" value:"MeshManager,LogManager" usage:"modules that support http interface"` Address string `json:"etcd_address" value:"127.0.0.1:2379" usage:"etcd registry feature, multiple ip addresses splited by comma"` CA string `json:"etcd_ca" value:"" usage:"etcd registry CA"` Cert string `json:"etcd_cert" value:"" usage:"etcd registry tls cert file"` Key string `json:"etcd_key" value:"" usage:"etcd registry tls key file"` }
EtcdRegistry config item for etcd discovery
type Handler ¶
Handler for module automatic reflection @param: module, bkbcs module name, like usermanager, logmanager @param: svcs, bkbcs service instance definition
type MicroHandler ¶
MicroHandler compatible for old module that registe in micro registry
type ModuleEvent ¶
type ModuleEvent struct { // Module name Module string // GoMicro flag for go-micro registry GoMicro bool // flag for delete Deletion bool // Svc api-gateway service definition Svc *register.Service }
ModuleEvent event
type ServerOptions ¶
type ServerOptions struct { conf.FileConfig conf.ServiceConfig conf.MetricConfig conf.ZkConfig conf.CertConfig conf.LogConfig conf.ProcessConfig IPv6Mode bool `` /* 196-byte string literal not displayed */ //gateway admin api info AdminAPI string `` /* 266-byte string literal not displayed */ AdminToken string `json:"amdin_token" value:"" usage:"api-gateway admin api token"` AdminType string `json:"admin_type" value:"apisix" usage:"select apisix or kong as gateway"` Modules string `` /* 151-byte string literal not displayed */ AuthToken string `json:"auth_token" usage:"token for request bcs-user-manager" mapstructure:"auth_token" ` Etcd EtcdRegistry `json:"etcdRegistry"` }
ServerOptions command flags for gateway-discovery
func NewServerOptions ¶
func NewServerOptions() *ServerOptions
NewServerOptions create default ServerOptions
func (*ServerOptions) GetClientTLS ¶
func (opt *ServerOptions) GetClientTLS() (*tls.Config, error)
GetClientTLS construct client tls configuration
func (*ServerOptions) GetEtcdRegistryTLS ¶
func (opt *ServerOptions) GetEtcdRegistryTLS() (*tls.Config, error)
GetEtcdRegistryTLS get specified etcd registry tls config
func (*ServerOptions) Valid ¶
func (opt *ServerOptions) Valid() error
Valid check if necessary paramter is setting correctly