oomg

package module
v0.0.0-...-08a5ed1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

README

oomg

oomg stands for "Other OMD Mongodb for Go"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(models interface{}) error

func Connect

func Connect(co ConnectOptions) (err error)

func Create

func Create(model interface{}) error

Create a model into the DB if you are looking to save a none struct create a Scribe calling with the S() function the name of collection

func One

func One(model interface{}) error

Types

type ConnectOptions

type ConnectOptions struct {
	URL        string
	CtxTimeout time.Duration
	DbName     string
}

Most likely to change to work as mongo have many many other options to connect

type M

type M map[string]interface{}

Esentially mongo.M but for omiting importing bson

type Query

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

func Filter

func Filter(m M) *Query

func Q

func Q(m interface{}) *Query

func (*Query) All

func (q *Query) All(models interface{}) (err error)

func (*Query) Collection

func (q *Query) Collection(i interface{}) *Query

func (*Query) Filter

func (q *Query) Filter(m M) *Query

func (*Query) One

func (q *Query) One(model interface{}) (err error)

type Scribe

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

func S

func S(model interface{}) *Scribe

func (*Scribe) Create

func (s *Scribe) Create(model interface{}) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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