Documentation ¶
Index ¶
- Variables
- func NewAuthClient(c *conf.Bootstrap) (auth.AuthClient, error)
- func NewCache(c *conf.Bootstrap, client redis.UniversalClient) biz.Cache
- func NewClient[T any](name, endpoint string, health bool, timeout time.Duration, ...) (client T, err error)
- func NewDB(c *conf.Bootstrap) (gormTenant *tenant.Tenant, err error)
- func NewGameRepo(data *Data) biz.GameRepo
- func NewRedis(c *conf.Bootstrap) (client redis.UniversalClient, err error)
- func NewSonyflake(c *conf.Bootstrap) (sf *id.Sonyflake, err error)
- func NewTracer(c *conf.Bootstrap) (tp *trace.TracerProvider, err error)
- func NewTransaction(d *Data) biz.Transaction
- type Cache
- func (c *Cache) Cache() redis.UniversalClient
- func (c *Cache) Del(ctx context.Context, action string)
- func (c *Cache) Flush(ctx context.Context, handler func(ctx context.Context) error) (err error)
- func (c *Cache) FlushByPrefix(ctx context.Context, prefix ...string) (err error)
- func (c *Cache) Get(ctx context.Context, action string, ...) (res string, err error)
- func (c *Cache) Lock(ctx context.Context, action string) (ok bool)
- func (c *Cache) Set(ctx context.Context, action, data string, short bool)
- func (c *Cache) SetWithExpiration(ctx context.Context, action, data string, seconds int64)
- func (c *Cache) Unlock(ctx context.Context, action string)
- func (c *Cache) WithPrefix(prefix string) biz.Cache
- func (c *Cache) WithRefresh() biz.Cache
- type Data
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet( NewRedis, NewDB, NewSonyflake, NewTracer, NewData, NewTransaction, NewCache, NewAuthClient, NewGameRepo, )
ProviderSet is data providers.
Functions ¶
func NewAuthClient ¶
func NewAuthClient(c *conf.Bootstrap) (auth.AuthClient, error)
func NewGameRepo ¶ added in v1.0.2
func NewSonyflake ¶
NewSonyflake is initialize sonyflake id generator
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache .
func (*Cache) FlushByPrefix ¶ added in v1.1.0
func (*Cache) SetWithExpiration ¶
func (*Cache) WithRefresh ¶ added in v1.1.2
type Data ¶
type Data struct {
// contains filtered or unexported fields
}
Data .
func NewData ¶
func NewData( redis redis.UniversalClient, gormTenant *tenant.Tenant, sonyflake *id.Sonyflake, tp *trace.TracerProvider, auth auth.AuthClient, ) (d *Data, cleanup func())
NewData .
Click to show internal directories.
Click to hide internal directories.