store

package
v0.0.0-...-b9c0c2f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

func OpenStore

func OpenStore(file string) Store

func (Store) Add

func (s Store) Add(data map[string]interface{}) (result StoreSingleResult, err error)

func (Store) Close

func (s Store) Close()

func (Store) Delete

func (s Store) Delete(id string) (result StoreDeleteResult, err error)

func (Store) Find

func (s Store) Find(params map[string]interface{}) (result StoreMultiResult, err error)

func (Store) Get

func (s Store) Get(id string) (result StoreSingleResult, err error)

func (Store) Update

func (s Store) Update(id string, data map[string]interface{}) (result StoreUpdateResult, err error)

type StoreDeleteResult

type StoreDeleteResult struct {
	Id       string                 `json:"_id"`
	PrevData map[string]interface{} `json:"prevData"`
}

type StoreMultiResult

type StoreMultiResult struct {
	Data []StoreSingleResult `json:"data"`
}

type StoreSingleResult

type StoreSingleResult struct {
	Id   string                 `json:"_id"`
	Data map[string]interface{} `json:"data"`
}

type StoreUpdateResult

type StoreUpdateResult struct {
	Id       string                 `json:"_id"`
	Data     map[string]interface{} `json:"data"`
	PrevData map[string]interface{} `json:"prevData"`
	Replaced bool                   `json:"replaced"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL