Documentation ¶
Index ¶
- type FileStoreHandler
- func (self *FileStoreHandler) Clear(ctx context.Context, lookup *resource.Lookup) (total int, err error)
- func (self *FileStoreHandler) Delete(ctx context.Context, item *resource.Item) (err error)
- func (self *FileStoreHandler) Find(ctx context.Context, lookup *resource.Lookup, page, perPage int) (list *resource.ItemList, err error)
- func (self *FileStoreHandler) Insert(ctx context.Context, items []*resource.Item) (err error)
- func (self *FileStoreHandler) Update(ctx context.Context, item *resource.Item, original *resource.Item) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileStoreHandler ¶
type FileStoreHandler struct { sync.RWMutex // If latency is set, the handler will introduce an artificial latency on // all operations Latency time.Duration UniqueFields []string // contains filtered or unexported fields }
func NewHandler ¶
func NewHandler(directory string, collection string, uniqueFields []string) *FileStoreHandler
NewHandler creates an empty memory handler
func NewSlowHandler ¶
func NewSlowHandler(latency time.Duration) *FileStoreHandler
NewSlowHandler creates an empty memory handler with specified latency
func (*FileStoreHandler) Clear ¶
func (self *FileStoreHandler) Clear(ctx context.Context, lookup *resource.Lookup) (total int, err error)
Clear clears all items from the memory store matching the lookup
func (*FileStoreHandler) Find ¶
func (self *FileStoreHandler) Find(ctx context.Context, lookup *resource.Lookup, page, perPage int) (list *resource.ItemList, err error)
Find items from memory matching the provided lookup
Click to show internal directories.
Click to hide internal directories.