Documentation
¶
Index ¶
- type InMemoryKeyValueStore
- func (store *InMemoryKeyValueStore[Type]) Delete(key string) error
- func (store *InMemoryKeyValueStore[Type]) Get(key string) (Type, error)
- func (store *InMemoryKeyValueStore[Type]) Set(key string, value Type) error
- func (store *InMemoryKeyValueStore[Type]) WithContext(ctx context.Context) KeyValueStore[string, Type]
- type KeyValueStore
- type List
- type Repository
- type SecretValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMemoryKeyValueStore ¶
type InMemoryKeyValueStore[Type interface{}] struct {
// contains filtered or unexported fields
}
func NewInMemoryKeyValueStore ¶
func NewInMemoryKeyValueStore[Type interface{}]() *InMemoryKeyValueStore[Type]
func (*InMemoryKeyValueStore[Type]) Delete ¶
func (store *InMemoryKeyValueStore[Type]) Delete(key string) error
func (*InMemoryKeyValueStore[Type]) Get ¶
func (store *InMemoryKeyValueStore[Type]) Get(key string) (Type, error)
func (*InMemoryKeyValueStore[Type]) Set ¶
func (store *InMemoryKeyValueStore[Type]) Set(key string, value Type) error
func (*InMemoryKeyValueStore[Type]) WithContext ¶
func (store *InMemoryKeyValueStore[Type]) WithContext(ctx context.Context) KeyValueStore[string, Type]
type KeyValueStore ¶
type KeyValueStore[Key comparable, Type interface{}] interface { // Get returns the value associated with the given key. Get(key Key) (Type, error) // Set associates the given value with the given value. Set(key Key, value Type) error // Delete removes the value associated with the given key. Delete(key Key) error WithContext(ctx context.Context) KeyValueStore[Key, Type] }
A Cache stores values of a given type under a given key.
type Repository ¶
type Repository[IdType comparable, Type interface{}] interface { FindAll(ctx context.Context) ([]Type, error) FindById(ctx context.Context, id IdType) (Type, error) Save(ctx context.Context, entity Type) error Update(ctx context.Context, entity Type) error DeleteById(ctx context.Context, id IdType) error }
A repository persists entities of a given type. Entities must be unique by their id.
type SecretValue ¶
type SecretValue struct {
// contains filtered or unexported fields
}
func NewSecretValue ¶
func NewSecretValue(value string) *SecretValue
func (*SecretValue) MarshalJSON ¶
func (s *SecretValue) MarshalJSON() ([]byte, error)
func (*SecretValue) String ¶
func (s *SecretValue) String() string
Click to show internal directories.
Click to hide internal directories.