db

package
v0.0.0-...-5edcdca Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: Unlicense Imports: 8 Imported by: 0

Documentation

Overview

Package db provides CRUD operations

Package db provides CRUD operations

Package db provides CRUD operations

Package db provides CRUD operations

Package db provides CRUD operations

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidValueType = errors.New("internal error, invalid value type")

Functions

func CheckCollision

func CheckCollision(m, exception models.Motion) (models.Motion, bool)

CheckCollision checks the unique of the motion.

func Connect

func Connect()

Connect connects to the remote DB.

func Create

func Create(m models.Motion) error

Create creates a new motion and returns an error if any is occurred.

func Delete

func Delete(id string) error

Delete removes one document with a specific id.

func Disconnect

func Disconnect() error

Disconnect disconnects from the remote DB.

func IncMotionUsage

func IncMotionUsage(m models.Motion) error

IncMotionUsage increments usage of the motion.

func ReadAll

func ReadAll() (m []models.Motion, err error)

ReadAll return all motions in the collection.

func ReadOne

func ReadOne(search string) (models.Motion, error)

ReadOne finds the motion by any string and returns it.

func Update

func Update(id string, newMotion models.Motion) error

Update replace the motion with certain Name with a new motion.

Types

This section is empty.

Jump to

Keyboard shortcuts

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