settings

package
v0.0.0-...-0dad8b8 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package settings is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

func All

func All() []setting

func Bool

func Bool(key string) (bool, error)

func DecodeOtherSliceOrMap

func DecodeOtherSliceOrMap(other, res any) error

func Delete

func Delete(key string) error

func Exists

func Exists(key string) bool

func Float

func Float(key string) (float64, error)

func Init

func Init() error

func Int

func Int(key string) (int64, error)

func Json

func Json(key string, res any) error

func Persist

func Persist() error

func SetBool

func SetBool(key string, val bool)

func SetFloat

func SetFloat(key string, val float64)

func SetInt

func SetInt(key string, val int64)

func SetJson

func SetJson(key string, val any) error

func SetString

func SetString(key string, val string)

func SetTime

func SetTime(key string, val time.Time)

func SetYaml

func SetYaml(key string, val any) error

func String

func String(key string) (string, error)

func Time

func Time(key string) (time.Time, error)

func Yaml

func Yaml(key string, other, res any) error

Types

type API

type API interface {
	String(key string) (string, error)
	SetString(key string, value string)
}

type MockAPI

type MockAPI struct {
	// contains filtered or unexported fields
}

MockAPI is a mock of API interface.

func NewMockAPI

func NewMockAPI(ctrl *gomock.Controller) *MockAPI

NewMockAPI creates a new mock instance.

func (*MockAPI) EXPECT

func (m *MockAPI) EXPECT() *MockAPIMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockAPI) SetString

func (m *MockAPI) SetString(key, value string)

SetString mocks base method.

func (*MockAPI) String

func (m *MockAPI) String(key string) (string, error)

String mocks base method.

type MockAPIMockRecorder

type MockAPIMockRecorder struct {
	// contains filtered or unexported fields
}

MockAPIMockRecorder is the mock recorder for MockAPI.

func (*MockAPIMockRecorder) SetString

func (mr *MockAPIMockRecorder) SetString(key, value any) *gomock.Call

SetString indicates an expected call of SetString.

func (*MockAPIMockRecorder) String

func (mr *MockAPIMockRecorder) String(key any) *gomock.Call

String indicates an expected call of String.

type Settings

type Settings struct{}

wrapping Settings into a struct for better decoupling

func (Settings) SetString

func (s Settings) SetString(key string, value string)

func (Settings) String

func (s Settings) String(key string) (string, error)

Jump to

Keyboard shortcuts

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