Documentation ¶
Index ¶
- func RpcDial(serverName string) (*grpc.ClientConn, error)
- func RunMustHttpServer(app *App, register func(e *gin.Engine, a *Options))
- func RunMustRpcServer(app *App, register func(server *grpc.Server, app *Options))
- type App
- type Option
- func WithAfterStart(fn func(context.Context) error) Option
- func WithAfterStop(fn func(context.Context) error) Option
- func WithAppId(id string) Option
- func WithBeforeStart(fn func(context.Context) error) Option
- func WithBeforeStop(fn func(context.Context) error) Option
- func WithEndpoints(endpoints []*url.URL) Option
- func WithGinServer(router func(e *gin.Engine, a *Options)) Option
- func WithGrpcServer(svr func(rpcServer *grpc.Server, a *Options)) Option
- func WithLogger() Option
- func WithMustConfig[T any](filename string, fn func(cfg *conf.ServiceConfig[T])) Option
- func WithMustDB(tables ...[]string) Option
- func WithMustLocalCache() Option
- func WithMustRedis() Option
- func WithRegistrar(registrar registry.ServiceRegistrar) Option
- func WithRegistrarTimeout(rt time.Duration) Option
- func WithSignal(sigs []os.Signal) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(o *Options)
func WithAfterStart ¶
WithAfterStart run funcs after app starts
func WithAfterStop ¶
WithAfterStop run funcs after app stops
func WithBeforeStart ¶
WithBeforeStart run funcs before app starts
func WithBeforeStop ¶
WithBeforeStop run funcs before app stops
func WithEndpoints ¶
func WithLogger ¶
func WithLogger() Option
func WithMustConfig ¶
func WithMustConfig[T any](filename string, fn func(cfg *conf.ServiceConfig[T])) Option
func WithMustDB ¶
func WithMustLocalCache ¶
func WithMustLocalCache() Option
func WithMustRedis ¶
func WithMustRedis() Option
func WithRegistrar ¶
func WithRegistrar(registrar registry.ServiceRegistrar) Option
func WithRegistrarTimeout ¶
func WithSignal ¶
Click to show internal directories.
Click to hide internal directories.