Documentation ¶
Index ¶
- Constants
- func GetIgnoreErrors(g Getter) func() string
- func GetOrPanic(g Getter) func() string
- func SetOrPanic(s Setter) func(v string)
- type Error
- type GetFunc
- type GetFuncDecorator
- type Getter
- type SetFunc
- type SetFuncDecorator
- type Setter
- type Singleton
- type SingletonAdapter
- type SingletonDecorator
Constants ¶
View Source
const ErrNotFound = Error("value not found in store")
Variables ¶
This section is empty.
Functions ¶
func GetIgnoreErrors ¶
func GetOrPanic ¶
GetOrPanic curries the result of a Getter invocation: the returned func only ever returns the string component when the error component of the underlying Get() call is nil. If Get() generates an error then the curried func panics.
func SetOrPanic ¶
SetOrPanic curries the result of a Setter invocation: the returned func only ever returns normally when the error component of the underlying Set() call is nil. If Set() generates an error then the curried func panics.
Types ¶
type GetFuncDecorator ¶
func DoGet ¶
func DoGet() GetFuncDecorator
func (GetFuncDecorator) AndThen ¶
func (f GetFuncDecorator) AndThen(f2 GetFuncDecorator) GetFuncDecorator
func (GetFuncDecorator) Decorate ¶
func (f GetFuncDecorator) Decorate(s Singleton) Singleton
type SetFuncDecorator ¶
func DoSet ¶
func DoSet() SetFuncDecorator
func (SetFuncDecorator) AndThen ¶
func (f SetFuncDecorator) AndThen(f2 SetFuncDecorator) SetFuncDecorator
func (SetFuncDecorator) Decorate ¶
func (f SetFuncDecorator) Decorate(s Singleton) Singleton
type Singleton ¶
Singleton is a thread-safe abstraction to load and store a string
func DecorateSingleton ¶
func DecorateSingleton(s Singleton, ds ...SingletonDecorator) Singleton
func NewInMemorySingleton ¶
func NewInMemorySingleton() Singleton
type SingletonAdapter ¶
type SingletonDecorator ¶
Click to show internal directories.
Click to hide internal directories.