mongo

package
v0.0.0-...-a573f87 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option struct {
	Key   OptionEnum
	Value string
}

type OptionEnum

type OptionEnum uint
const (
	Server OptionEnum = iota
	Database
	Collection
)

type Storage

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

Storage is a storage system backed by MongoDB that stores Payment structs indexed by UUID.

func New

func New(mo ...Option) *Storage

func (*Storage) Create

func (s *Storage) Create(newPayment storage.Payment) (uuid.UUID, error)

func (*Storage) CreateSpecificID

func (s *Storage) CreateSpecificID(newID uuid.UUID, newPayment storage.Payment) error

func (*Storage) Delete

func (s *Storage) Delete(id uuid.UUID) error

func (*Storage) Initialise

func (s *Storage) Initialise() error

func (*Storage) Read

func (s *Storage) Read(id uuid.UUID) (storage.Payment, error)

func (*Storage) ReadAll

func (s *Storage) ReadAll(rao storage.ReadAllOptions) (map[uuid.UUID]storage.Payment, error)

func (*Storage) Terminate

func (s *Storage) Terminate(drop ...bool) error

Terminate will keep or destroy data, depending on whether true or false is passed in. Will default to keeping data if no bool is given.

func (*Storage) Update

func (s *Storage) Update(id uuid.UUID, p storage.Payment) error

Jump to

Keyboard shortcuts

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