Documentation ¶
Index ¶
- Constants
- func Apply(opts ...Option) *options
- func NewContext(ctx context.Context, s AppInfo) context.Context
- type AppInfo
- type Gaea
- type Option
- func AfterStart(fn func(context.Context) error) Option
- func AfterStop(fn func(context.Context) error) Option
- func BeforeStart(fn func(context.Context) error) Option
- func BeforeStop(fn func(context.Context) error) Option
- func WithContext(ctx context.Context) Option
- func WithEndpoint(endpoints ...*url.URL) Option
- func WithID(id string) Option
- func WithMetadata(md map[string]string) Option
- func WithName(name string) Option
- func WithRegistry(r registry.Registry) Option
- func WithRegistryTimeout(t time.Duration) Option
- func WithServer(srv ...server.Server) Option
- func WithSignal(sigs ...os.Signal) Option
- func WithStopTimeout(t time.Duration) Option
- func WithVersion(version string) Option
Constants ¶
View Source
const ( Name = "Gaea" Version = "v0.2.1" )
Name and Version info of this framework, used for statistics and debug
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AppInfo ¶
type Gaea ¶
type Gaea struct {
// contains filtered or unexported fields
}
func (*Gaea) RegisterServer ¶ added in v0.2.0
type Option ¶
type Option func(o *options)
Option is an application option.
func AfterStart ¶
AfterStart run funcs after app starts
func BeforeStart ¶
BeforeStart run funcs before app starts
func BeforeStop ¶
BeforeStop run funcs before app stops
func WithEndpoint ¶
WithEndpoint with service endpoint.
func WithMetadata ¶
WithMetadata with service metadata.
func WithRegistry ¶
WithRegistry with service registry.
func WithRegistryTimeout ¶
WithRegistryTimeout with registrar timeout.
func WithStopTimeout ¶
WithStopTimeout with app stop timeout.
Click to show internal directories.
Click to hide internal directories.