Documentation
¶
Index ¶
- Constants
- type JSONDatastore
- func (j *JSONDatastore) Add(ctx context.Context, entity datastore.Entity) error
- func (j *JSONDatastore) BatchAdd(ctx context.Context, entities []datastore.Entity) error
- func (j *JSONDatastore) Commit(ctx context.Context) error
- func (j *JSONDatastore) Count(ctx context.Context, entity datastore.Entity, options *datastore.FilterOptions) (int64, error)
- func (j *JSONDatastore) Delete(ctx context.Context, entity datastore.Entity) error
- func (j *JSONDatastore) Get(ctx context.Context, entity datastore.Entity) error
- func (j *JSONDatastore) Init() error
- func (j *JSONDatastore) IsExist(ctx context.Context, entity datastore.Entity) (bool, error)
- func (j *JSONDatastore) List(ctx context.Context, query datastore.Entity, options *datastore.ListOptions) ([]datastore.Entity, error)
- func (j *JSONDatastore) Put(ctx context.Context, entity datastore.Entity) error
Constants ¶
View Source
const ModelQueryKey = "name"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONDatastore ¶
type JSONDatastore struct {
// contains filtered or unexported fields
}
JSONDatastore implements datastore.Datastore interface using JSON files
func NewJSONDatastore ¶
func NewJSONDatastore(fs embed.FS) *JSONDatastore
NewJSONDatastore creates a new JSON datastore instance
func (*JSONDatastore) Commit ¶
func (j *JSONDatastore) Commit(ctx context.Context) error
Commit implements datastore.Datastore interface
func (*JSONDatastore) Count ¶
func (j *JSONDatastore) Count(ctx context.Context, entity datastore.Entity, options *datastore.FilterOptions) (int64, error)
Count implements datastore.Datastore interface
func (*JSONDatastore) Init ¶
func (j *JSONDatastore) Init() error
Init implements datastore.Datastore interface
Click to show internal directories.
Click to hide internal directories.