config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 added in v1.1.0

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

GetArrayStringValue get config array string value

func (*ConfigService) GetConfigByID added in v1.1.0

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

GetConfigByID get config by id

func (*ConfigService) GetConfigByKey added in v1.1.0

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

func (*ConfigService) GetIDByKey added in v1.1.0

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

GetIDByKey get config id by key

func (*ConfigService) GetIntValue added in v1.1.0

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

GetIntValue get config int value

func (*ConfigService) GetJsonConfigByIDAndSetToObject added in v1.1.0

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

func (*ConfigService) GetStringValue added in v1.1.0

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

GetStringValue get config string value

func (*ConfigService) UpdateConfig added in v1.1.0

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