Documentation ¶
Index ¶
- Constants
- func New(opts ...Option) *kratos.App
- type Context
- type ContextOption
- type ContextOptionFunc
- type Option
- func Config(source kratosConfig.Source) Option
- func GrpcServerOptions(opts ...grpc.ServerOption) Option
- func HttpServerOptions(opts ...http.ServerOption) Option
- func LoggerWith(fields logger.LogField) Option
- func MiddlewareOptions(opts ...middleware.Middleware) Option
- func Options(opts ...kratos.Option) Option
- func RegistrarServer(fn RegistrarServerFn) Option
- type RegistrarServerFn
Constants ¶
View Source
const ( AppName = "APP_NAME" AppVersion = "APP_VERSION" )
View Source
const Release = "v1.0.5"
Release is the current resource version.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context interface { Env() string Logger() *log.Helper DB(name ...string) *gorm.DB Transaction(fn func(ctx Context) error, name ...string) error Redis(name ...string) *redis.Client Go(runner pool.Runner) error Loader(name string) []byte Email() email.Email ClientIP() string Captcha() captcha.Captcha JWT() jwt.Jwt Token() string Authentication() authentication.Authentication Ctx() context.Context GetMetadata(string) string SetMetadata(key, value string) WaitRunner() pool.WaitRunner Http() http.Request GrpcConn(srvName string) (*grpc.ClientConn, error) ID() string Name() string Version() string Metadata() map[string]string Config() config.Config Endpoint() []string Clone() Context Deadline() (deadline time.Time, ok bool) Done() <-chan struct{} Err() error Value(key any) any }
func MustContext ¶
func MustContext(c context.Context, opts ...ContextOptionFunc) Context
MustContext returns the Transport value stored in ctx, if any.
type ContextOption ¶
type ContextOptionFunc ¶
type ContextOptionFunc func(*ContextOption)
type Option ¶
type Option func(o *options)
func GrpcServerOptions ¶
func GrpcServerOptions(opts ...grpc.ServerOption) Option
GrpcServerOptions grpc server option
func HttpServerOptions ¶
func HttpServerOptions(opts ...http.ServerOption) Option
HttpServerOptions http server option
func MiddlewareOptions ¶
func MiddlewareOptions(opts ...middleware.Middleware) Option
MiddlewareOptions middleware option
Source Files ¶
Click to show internal directories.
Click to hide internal directories.