Documentation ¶
Index ¶
- Constants
- type OptionFunc
- type Options
- type RegistryOptions
- type Server
- func (srv *Server) AddAfterServerStopFunc(fns ...bootstrap.AfterServerStopFunc)
- func (srv *Server) AddBeforeServerStartFunc(fns ...bootstrap.BeforeServerStartFunc)
- func (srv *Server) AddPlugins(plugins ...server.Plugin)
- func (srv *Server) ConfigureOptions(options ...OptionFunc)
- func (srv *Server) DisableHTTPGateway() bootstrap.BeforeServerStartFunc
- func (srv *Server) InitConfig() bootstrap.BeforeServerStartFunc
- func (srv *Server) InitRegistry() bootstrap.BeforeServerStartFunc
- func (srv *Server) InitRpcxAuth(fns ...ValidAccess) bootstrap.BeforeServerStartFunc
- func (srv *Server) InitRpcxPlugin(plugins ...rpcxplugin.Options) bootstrap.BeforeServerStartFunc
- func (srv *Server) RegisterPlugin() bootstrap.BeforeServerStartFunc
- func (srv *Server) RegisterServiceWithName(name string, recv interface{}, metadata string) bootstrap.BeforeServerStartFunc
- func (srv *Server) RegisterServiceWithPlugin(name string, recv interface{}, metadata string) bootstrap.BeforeServerStartFunc
- func (srv *Server) Serve() error
- func (srv *Server) Server() *server.Server
- type ValidAccess
Constants ¶
View Source
const ( //StatusOn 启用 StatusOn = "on" //StatusOff 关闭 StatusOff = "off" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OptionFunc ¶
type OptionFunc func(*Options)
func Addr ¶
func Addr(a string) OptionFunc
func Network ¶
func Network(n string) OptionFunc
func Port ¶
func Port(p string) OptionFunc
func ReadTimeout ¶
func ReadTimeout(t time.Duration) OptionFunc
func WithRegistryOptions ¶
func WithRegistryOptions(registryOpts RegistryOptions) OptionFunc
func WriteTimeout ¶
func WriteTimeout(t time.Duration) OptionFunc
type Options ¶
type Options struct { Network string `ini:"network"` Addr string `ini:"addr"` Port string `ini:"port"` WriteTimeout time.Duration `ini:"writeTimeout"` ReadTimeout time.Duration `ini:"readTimeout"` RegistryOpts RegistryOptions }
Options server options
type RegistryOptions ¶
type RegistryOptions struct { Status string `ini:"status"` Addrs []string `ini:"addrs"` BasePath string `ini:"basePath"` UpdateInterval time.Duration `ini:"updateInterval"` UserName string `ini:"username"` Password string `ini:"password"` Group string `ini:"group"` }
RegistryOptions 服务注册中心配置
type Server ¶
type Server struct { Opts Options // contains filtered or unexported fields }
Server struct
func NewServerWithOptions ¶
NewServerWithOptions with options
func (*Server) AddAfterServerStopFunc ¶
func (srv *Server) AddAfterServerStopFunc(fns ...bootstrap.AfterServerStopFunc)
AddAfterServerStopFunc add after function
func (*Server) AddBeforeServerStartFunc ¶
func (srv *Server) AddBeforeServerStartFunc(fns ...bootstrap.BeforeServerStartFunc)
AddBeforeServerStartFunc add before function
func (*Server) AddPlugins ¶
AddPlugins 添加rpcx plugin
func (*Server) ConfigureOptions ¶
func (srv *Server) ConfigureOptions(options ...OptionFunc)
ConfigureOptions 更新配置
func (*Server) DisableHTTPGateway ¶
func (srv *Server) DisableHTTPGateway() bootstrap.BeforeServerStartFunc
DisableHTTPGateway 禁用本地网关模式
func (*Server) InitConfig ¶
func (srv *Server) InitConfig() bootstrap.BeforeServerStartFunc
InitRegistry 初始化注册中心
func (*Server) InitRegistry ¶
func (srv *Server) InitRegistry() bootstrap.BeforeServerStartFunc
InitRegistry 初始化注册中心
func (*Server) InitRpcxAuth ¶
func (srv *Server) InitRpcxAuth(fns ...ValidAccess) bootstrap.BeforeServerStartFunc
InitRpcxAuth 初始化rpcx鉴权
func (*Server) InitRpcxPlugin ¶
func (srv *Server) InitRpcxPlugin(plugins ...rpcxplugin.Options) bootstrap.BeforeServerStartFunc
InitRpcxPlugin 初始化rpcx插件
func (*Server) RegisterPlugin ¶
func (srv *Server) RegisterPlugin() bootstrap.BeforeServerStartFunc
RegisterPlugin 添加rcpx plugin
func (*Server) RegisterServiceWithName ¶
func (srv *Server) RegisterServiceWithName(name string, recv interface{}, metadata string) bootstrap.BeforeServerStartFunc
RegisterServiceWithName 用于注册自己的服务
func (*Server) RegisterServiceWithPlugin ¶
func (srv *Server) RegisterServiceWithPlugin(name string, recv interface{}, metadata string) bootstrap.BeforeServerStartFunc
RegisterServiceWithName 用于注册带插件功能的服务
type ValidAccess ¶
Click to show internal directories.
Click to hide internal directories.