Documentation ¶
Index ¶
- func GetCmds(options *Options) []cli.Command
- func GetSrvConfig(app *ServiceApp, args ...string) *service.Config
- func NewContext(ctx context.Context, s AppInfo) context.Context
- func RegisterFunc(f ...func(cfg *Options) cli.Command)
- type App
- type AppInfo
- type AppMode
- type AppService
- type Option
- func Command(cmd cli.Command) Option
- func ID(id string) Option
- func IpMask(mask string) Option
- func LogParams(opts ...log.ConfigOption) Option
- func Metadata(md map[string]string) Option
- func RegistrarTimeout(timeout int64) Option
- func Server(srv ...transport.Server) Option
- func ServiceDependencies(dependencies ...string) Option
- func ServiceOption(key string, val interface{}) Option
- func StartedHook(hook func(context.Context) error) Option
- func StartingHook(hook func(context.Context) error) Option
- func TraceAddr(addr string) Option
- func WithAppMode(mode AppMode) Option
- func WithConfigSource(fileList ...config.Source) Option
- type Options
- type ServiceApp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSrvConfig ¶
func GetSrvConfig(app *ServiceApp, args ...string) *service.Config
GetSrvConfig SrvCfg
func NewContext ¶
NewContext returns a new Context that carries value.
Types ¶
type AppInfo ¶
type AppService ¶
type Option ¶
type Option func(*Options)
Option 配置选项
func LogParams ¶ added in v0.5.12
func LogParams(opts ...log.ConfigOption) Option
ServiceDependencies
func RegistrarTimeout ¶ added in v0.5.11
func ServiceDependencies ¶
ServiceDependencies
func StartedHook ¶ added in v0.1.4
StartedHook
func StartingHook ¶ added in v0.1.11
StartingHook
func WithConfigSource ¶ added in v0.2.6
WithAppMode
type Options ¶
type Options struct { Id string Metadata map[string]string Endpoints []*url.URL Registrar registry.Registrar Config config.Config RegistrarTimeout time.Duration StopTimeout time.Duration Servers []transport.Server StartingHooks []func(ctx context.Context) error StartedHooks []func(ctx context.Context) error // contains filtered or unexported fields }
type ServiceApp ¶
type ServiceApp struct {
// contains filtered or unexported fields
}
ServiceApp ServiceApp
func (*ServiceApp) Endpoint ¶
func (p *ServiceApp) Endpoint() []registry.ServerItem
func (*ServiceApp) ID ¶
func (p *ServiceApp) ID() string
func (*ServiceApp) Metadata ¶
func (p *ServiceApp) Metadata() map[string]string
Click to show internal directories.
Click to hide internal directories.