mongodb

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Insert

func Insert(ctx context.Context, info *InfoToDB) error

Insert : Function description of the function, input, output, and notes if any

func NewConnection

func NewConnection(uri string, dbname string, timeout time.Duration) (err error)

NewConnection : Function description of the function, input, output, and notes if any

func Update

func Update(ctx context.Context, info *InfoToDB) error

Update : Function description of the function, input, output, and notes if any

Types

type InfoToDB

type InfoToDB struct {
	ID       primitive.ObjectID `bson:"_id,omitempty"`
	Name     string             `bson:"name"`
	CreateAt time.Time          `bson:"createAt"`
}

InfoToDB : Descriptions of the data type and notes if any

func GetOne

func GetOne(ctx context.Context, id primitive.ObjectID) (*InfoToDB, error)

GetOne : Function description of the function, input, output, and notes if any

func (*InfoToDB) Validate

func (ins *InfoToDB) Validate() error

Validate : This function checks the validity of data fields in the Info structure

Jump to

Keyboard shortcuts

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