Documentation ¶
Index ¶
- Constants
- func NewContext(ctx context.Context, s AppContext) context.Context
- type App
- type AppContext
- 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 Context(ctx context.Context) Option
- func Endpoint(endpoints ...*url.URL) Option
- func ID(id string) Option
- func Logger(logger *logrus.Logger) Option
- func Metadata(md map[string]string) Option
- func Name(name string) Option
- func Signal(sigs ...os.Signal) Option
- func Version(version string) Option
- type ServiceInstance
Constants ¶
View Source
const Release = "v0.0.1"
Release is the current kratos version.
Variables ¶
This section is empty.
Functions ¶
func NewContext ¶
func NewContext(ctx context.Context, s AppContext) context.Context
NewContext returns a new Context that carries value.
Types ¶
type AppContext ¶
type AppContext interface { ID() string Name() string Version() string Metadata() map[string]string Endpoint() []string }
AppContext is a application context value
func FromContext ¶
func FromContext(ctx context.Context) (s AppContext, ok bool)
FromContext returns the Transport value stored in ctx, if any.
type Option ¶
type Option func(o *options)
func AfterStart ¶
AfterStart run funcs after app starts
func BeforeStart ¶
Before and Afters BeforeStart run funcs before app starts
func BeforeStop ¶
BeforeStop run funcs before app stops
type ServiceInstance ¶
type ServiceInstance struct {
Endpoint []string
}
Click to show internal directories.
Click to hide internal directories.