Documentation ¶
Index ¶
- func NewHealthServer() health.HealthServer
- type MicroService
- type Option
- func Auth(a auth.Tokens) Option
- func HealthCheck(enabled bool) Option
- func Listen(addr string) Option
- func Logger(logger *zap.Logger) Option
- func Name(name string) Option
- func Reflection(enabled bool) Option
- func Registry(registry registry.Registry) Option
- func TLS(certFile, keyFile string) Option
- func TTL(ttl int) Option
- func Version(version string) Option
- func WithConfig(conf *config.ServerConfig) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHealthServer ¶
func NewHealthServer() health.HealthServer
Types ¶
type MicroService ¶
type MicroService interface { // Register 将GRPC服务实例关联至到微服务容器 Register(registerDesc *grpc.ServiceDesc, srv interface{}) MicroService // Options 获取微服务容器内的全部选项 Options() *Options // Instances 获取已注册的GRPC服务实例 Instances() []interface{} // Server 获取内置的gRPC服务器实例 Server() *grpc.Server // Start 启动微服务 Start() }
func New ¶
func New(options ...Option) MicroService
type Option ¶
type Option func(*Options)
func HealthCheck ¶
func Reflection ¶
func WithConfig ¶
func WithConfig(conf *config.ServerConfig) Option
Click to show internal directories.
Click to hide internal directories.