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 Context(ctx context.Context) Option
- func Endpoint(endpoints ...*url.URL) Option
- func ID(id string) Option
- func Logger(logger log.Logger) Option
- func Metadata(md map[string]string) Option
- func Name(name string) Option
- func Registrar(r registry.Registrar) Option
- func RegistrarTimeout(t time.Duration) Option
- func Server(srv ...transport.Server) Option
- func Signal(sigs ...os.Signal) Option
- func StopTimeout(t time.Duration) Option
- func Version(version string) Option
Constants ¶
View Source
const Release = "v2.8.2"
Release 是当前 kratos 库的版本号
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is an application components lifecycle manager.
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 是应用程序的选项。
func BeforeStart ¶
BeforeStart 在应用程序启动前运行函数。
Directories
¶
| Path | Synopsis |
|---|---|
|
api
|
|
|
cmd
|
|
|
kratos
module
|
|
|
contrib
|
|
|
registry/consul
module
|
|
|
proto
Package proto 定义了 protobuf 编解码器。
|
Package proto 定义了 protobuf 编解码器。 |
|
nolint:mnd
|
nolint:mnd |
|
internal
|
|
|
group
Package group provides a sample lazy load container.
|
Package group provides a sample lazy load container. |
Click to show internal directories.
Click to hide internal directories.