store

package
v0.0.0-...-f87157e Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Things

type Things struct {
	DB *mongo.Database
}

Things stores and retrieves things collection

func (Things) Create

func (ts Things) Create(ctx context.Context, t model.Thing) error

Create creates the given thing in things collection

func (Things) GetByName

func (ts Things) GetByName(ctx context.Context, id string) (model.Thing, error)

GetByName returns the thing that has given identification

func (Things) GetByProjectID

func (ts Things) GetByProjectID(ctx context.Context, pid string) ([]model.Thing, error)

GetByProjectID returns all things that are associated with given project identification

func (Things) Remove

func (ts Things) Remove(ctx context.Context, id string) error

Remove removes the given thing from the things collection

func (Things) Update

func (ts Things) Update(ctx context.Context, id string, m *string, s *bool) (model.Thing, error)

Update update the given thing's model

Jump to

Keyboard shortcuts

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