Documentation ¶
Index ¶
- Constants
- func NewContext(ctx context.Context, s AppInfo) context.Context
- type App
- type AppInfo
- 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 Signal(sigs ...os.Signal) Option
- func WithContext(ctx context.Context) Option
- func WithEndpoint(endpoints ...*url.URL) Option
- func WithID(id string) Option
- func WithLogger(logger log.Logger) Option
- func WithMetadata(md map[string]string) Option
- func WithName(name string) Option
- func WithRegistrar(r registry.Registrar) Option
- func WithRegistrarTimeout(t time.Duration) Option
- func WithServer(srv ...transport.Server) Option
- func WithStopTimeout(t time.Duration) Option
- func WithVersion(version string) Option
Constants ¶
View Source
const Release = "v0.0.0"
lori 当前版本
View Source
const Website = "https://github.com/cr-mao/lori"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
type AppInfo ¶
type AppInfo interface { ID() string Name() string Version() string Metadata() map[string]string Endpoint() []string }
AppInfo is application context value.
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 WithRegistrar ¶
Registrar with service registry.
func WithRegistrarTimeout ¶
RegistrarTimeout with registrar timeout.
func WithStopTimeout ¶
StopTimeout with app stop timeout.
Directories ¶
Path | Synopsis |
---|---|
Package errors provides simple error handling primitives.
|
Package errors provides simple error handling primitives. |
internal
|
|
consul
Module
|
|
rtcp/iface
@Title iclient.go @Description Provides all interface declarations for the Client abstraction layer.
|
@Title iclient.go @Description Provides all interface declarations for the Client abstraction layer. |
Click to show internal directories.
Click to hide internal directories.