Documentation
¶
Index ¶
- type DataStore
- func (ds *DataStore[T]) DeleteByKey(key string, ctx context.Context) error
- func (ds *DataStore[T]) GetByKey(key string, ctx context.Context) (*T, error)
- func (ds *DataStore[T]) GetEntityKey(entity *T) string
- func (ds *DataStore[T]) Kind() string
- func (ds *DataStore[T]) ListEntities(offset int, count int, ctx context.Context) ([]T, bool, error)
- func (ds *DataStore[T]) SaveEntity(entity *T, ctx context.Context) (*T, *datastore.Key, error)
- func (ds *DataStore[T]) SetEntityKey(entity *T, key string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataStore ¶
type DataStore[T any] struct { DSClient *datastore.Client AutoCreateKey bool KeyGetter func(*T) *datastore.Key KeySetter func(*T, *datastore.Key) ToDBValue func(*T) map[string]interface{} FromDBValue func(map[string]interface{}) T GetByKeyQuery func(key string) datastore.Query // contains filtered or unexported fields }
func (*DataStore[T]) DeleteByKey ¶
func (*DataStore[T]) GetEntityKey ¶
func (*DataStore[T]) ListEntities ¶
func (*DataStore[T]) SaveEntity ¶
func (*DataStore[T]) SetEntityKey ¶
Click to show internal directories.
Click to hide internal directories.