Documentation
¶
Index ¶
- 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 WithAppID(id string) Option
- func WithEndpoints(endpoints []*url.URL) Option
- func WithGinServer(router func(e *gin.Engine, a *Options)) Option
- func WithGrpcServer(svr func(s *grpc.Server, a *Options)) Option
- func WithLogger() Option
- func WithMustDB() Option
- func WithMustLocalCache() Option
- func WithMustRedis() Option
- func WithRegistrar(registrar registry.ServiceRegistrar) Option
- func WithScanConfig[T any](c *T) 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 WithEndpoints ¶
func WithLogger ¶
func WithLogger() Option
func WithMustDB ¶
func WithMustDB() Option
func WithMustLocalCache ¶
func WithMustLocalCache() Option
func WithMustRedis ¶
func WithMustRedis() Option
func WithRegistrar ¶
func WithRegistrar(registrar registry.ServiceRegistrar) Option
func WithScanConfig ¶ added in v0.1.1
func WithSignal ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func (Options) LocalCache ¶
LocalCache 获取本地缓存 Interface CacheLocal 1.一级缓存 变动小、容量少。容量固定,有淘汰策略。 2.不适合分布式数据共享。
func (Options) Redis ¶
func (o Options) Redis() redis.UniversalClient
Redis 获取redis client CacheDB 二级缓存 容量大,有网络IO延迟
Click to show internal directories.
Click to hide internal directories.