Documentation ¶
Index ¶
- Constants
- func GetKeyValueStore[T any](ctx context.Context, dao *Dao, key string) (*T, error)
- func RemoveDuplicateAndZero[T cmp.Ordered](origin []T) []T
- func SetSystemConfig[T any](ctx context.Context, dao *Dao, key string, value *T) error
- func WithTx[T any](ctx context.Context, db *ent.Client, ...) (*T, error)
- func WithTxEx(ctx context.Context, db *ent.Client, ...) error
- type Dao
- func (d *Dao) GetAdmins(ctx context.Context, ids []int64) (map[int64]*ent.Admin, error)
- func (d *Dao) GetSystemConfig(ctx context.Context) (*SystemConfig, error)
- func (d *Dao) GetUserPlatforms(ctx context.Context, ids []int64) (map[int64][]*ent.UserPlatform, error)
- func (d *Dao) GetUsers(ctx context.Context, ids []int64) (map[int64]*ent.User, error)
- func (d *Dao) SetSystemConfig(ctx context.Context, config *SystemConfig) error
- type SystemConfig
Constants ¶
View Source
const SystemConfigKey = "system_config"
Variables ¶
This section is empty.
Functions ¶
func GetKeyValueStore ¶
func RemoveDuplicateAndZero ¶
func SetSystemConfig ¶
Types ¶
type Dao ¶
func (*Dao) GetSystemConfig ¶
func (d *Dao) GetSystemConfig(ctx context.Context) (*SystemConfig, error)
func (*Dao) GetUserPlatforms ¶
func (*Dao) SetSystemConfig ¶
func (d *Dao) SetSystemConfig(ctx context.Context, config *SystemConfig) error
type SystemConfig ¶
type SystemConfig struct {
ExampleField string `json:"example_field"`
}
Click to show internal directories.
Click to hide internal directories.