config

package
v1.2.5-RC1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

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

func (cs *ConfigService) GetConfigByID(ctx context.Context, id int) (c *entity.Config, err error)

GetConfigByID get config by id

func (*ConfigService) GetConfigByKey

func (cs *ConfigService) GetConfigByKey(ctx context.Context, key string) (c *entity.Config, err error)

func (*ConfigService) GetIDByKey

func (cs *ConfigService) GetIDByKey(ctx context.Context, key string) (id int, err error)

GetIDByKey get config id by key

func (*ConfigService) GetIntValue

func (cs *ConfigService) GetIntValue(ctx context.Context, key string) (val int, err error)

GetIntValue get config int value

func (*ConfigService) GetJsonConfigByIDAndSetToObject

func (cs *ConfigService) GetJsonConfigByIDAndSetToObject(ctx context.Context, id int, obj any) (err error)

func (*ConfigService) GetStringValue

func (cs *ConfigService) GetStringValue(ctx context.Context, key string) (val string, err error)

GetStringValue get config string value

func (*ConfigService) UpdateConfig

func (cs *ConfigService) UpdateConfig(ctx context.Context, key, value string) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL