Documentation ¶
Index ¶
- func NewContext(ctx context.Context, s Application) context.Context
- type App
- type Application
- type Option
- func Context(ctx context.Context) Option
- func Endpoint(endpoints ...*url.URL) Option
- func GrpcServer(srv *grpc.Server) Option
- func HttpServer(srv *http.Server) Option
- func ID(id string) Option
- func Logger(logger zlog.Logger) Option
- func Metadata(md map[string]string) Option
- func Name(name string) Option
- func Registrar(r registry.Registrar) Option
- func Server(srv ...transport.Server) Option
- func Signal(sigs ...os.Signal) Option
- func Version(version string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContext ¶
func NewContext(ctx context.Context, s Application) context.Context
NewContext returns a new Context that carries value.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is an application components lifecycle manager.
func (*App) GrpcServer ¶
func (*App) HttpServer ¶
type Application ¶
type Application interface { ID() string Name() string Version() string Metadata() map[string]string Endpoint() []string GrpcServer() *grpc.Server HttpServer() *http.Server }
Application
func FromContext ¶
func FromContext(ctx context.Context) (s Application, ok bool)
FromContext returns the Transport value stored in ctx, if any.
type Option ¶
type Option func(o *options)
Option is an application option.
func GrpcServer ¶
func HttpServer ¶
Click to show internal directories.
Click to hide internal directories.