Documentation ¶
Index ¶
- type ConfigRepo
- type ConfigService
- func (cs *ConfigService) GetArrayStringValue(ctx context.Context, key string) (val []string, err error)
- func (cs *ConfigService) GetConfigByID(ctx context.Context, id int) (c *entity.Config, err error)
- func (cs *ConfigService) GetConfigByKey(ctx context.Context, key string) (c *entity.Config, err error)
- func (cs *ConfigService) GetIDByKey(ctx context.Context, key string) (id int, err error)
- func (cs *ConfigService) GetIntValue(ctx context.Context, key string) (val int, err error)
- func (cs *ConfigService) GetJsonConfigByIDAndSetToObject(ctx context.Context, id int, obj any) (err error)
- func (cs *ConfigService) GetStringValue(ctx context.Context, key string) (val string, err error)
- func (cs *ConfigService) UpdateConfig(ctx context.Context, key, value string) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigRepo ¶
type ConfigRepo interface { GetConfigByID(ctx context.Context, id int) (c *entity.Config, err error) GetConfigByKey(ctx context.Context, key string) (c *entity.Config, err error) UpdateConfig(ctx context.Context, key, value string) (err error) }
ConfigRepo config repository
type ConfigService ¶
type ConfigService struct {
// contains filtered or unexported fields
}
ConfigService user service
func NewConfigService ¶
func NewConfigService(configRepo ConfigRepo) *ConfigService
NewConfigService new config service
func (*ConfigService) GetArrayStringValue ¶
func (cs *ConfigService) GetArrayStringValue(ctx context.Context, key string) (val []string, err error)
GetArrayStringValue get config array string value
func (*ConfigService) GetConfigByID ¶
GetConfigByID get config by id
func (*ConfigService) GetConfigByKey ¶
func (*ConfigService) GetIDByKey ¶
GetIDByKey get config id by key
func (*ConfigService) GetIntValue ¶
GetIntValue get config int value
func (*ConfigService) GetJsonConfigByIDAndSetToObject ¶
func (*ConfigService) GetStringValue ¶
GetStringValue get config string value
func (*ConfigService) UpdateConfig ¶
func (cs *ConfigService) UpdateConfig(ctx context.Context, key, value string) (err error)
Click to show internal directories.
Click to hide internal directories.