database

package
v0.0.0-...-e498ba9 Latest Latest
Warning

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

Go to latest
Published: May 1, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartSession

func StartSession() (mongo.Session, error)

Types

type Board

type Board struct {
	ID        primitive.ObjectID `json:"_id" bson:"_id"`
	Name      string             `json:"name" bson:"name"`
	ListOrder []string           `json:"listOrder" bson:"listOrder"`
	Archived  bool               `json:"archived,omitempty" bson:"archived,omitempty"`
}

type Card

type Card struct {
	ID            primitive.ObjectID `json:"_id" bson:"_id"`
	Name          string             `json:"name" bson:"name"`
	DueDate       *string            `json:"dueDate" bson:"dueDate"`
	ParentBoardID string             `json:"parentBoardId" bson:"parentBoardId"`
	ParentListID  string             `json:"parentListId" bson:"parentListId"`
	Archived      bool               `json:"archived,omitempty" bson:"archived,omitempty"`
}

type List

type List struct {
	ID            primitive.ObjectID `json:"_id" bson:"_id"`
	Name          string             `json:"name" bson:"name"`
	ParentBoardID string             `json:"parentBoardId" bson:"parentBoardId"`
	CardOrder     []string           `json:"cardOrder" bson:"cardOrder"`
	Archived      bool               `json:"archived,omitempty" bson:"archived,omitempty"`
}

type MongoCollection

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

func (*MongoCollection) BulkUpdateByIDs

func (coll *MongoCollection) BulkUpdateByIDs(idsToUpdate map[string]interface{}, ctx context.Context) error

func (*MongoCollection) BulkUpdateByIDsWithTimeout

func (coll *MongoCollection) BulkUpdateByIDsWithTimeout(idsToUpdate map[string]interface{}, timeout time.Duration, ctx context.Context) error

func (*MongoCollection) FindAll

func (coll *MongoCollection) FindAll(filter interface{}, ctx context.Context) (*mongo.Cursor, error)

func (*MongoCollection) FindAllWithTimeout

func (coll *MongoCollection) FindAllWithTimeout(filter interface{}, timeout time.Duration, ctx context.Context) (*mongo.Cursor, error)

func (*MongoCollection) FindByID

func (coll *MongoCollection) FindByID(ID string, ctx context.Context) (*mongo.SingleResult, error)

func (*MongoCollection) FindByIDWithTimeout

func (coll *MongoCollection) FindByIDWithTimeout(ID string, timeout time.Duration, ctx context.Context) (*mongo.SingleResult, error)

func (*MongoCollection) InsertOne

func (coll *MongoCollection) InsertOne(document interface{}, ctx context.Context) (string, error)

func (*MongoCollection) InsertOneWithTimeout

func (coll *MongoCollection) InsertOneWithTimeout(document interface{}, timeout time.Duration, ctx context.Context) (string, error)

func (*MongoCollection) UpdateByID

func (coll *MongoCollection) UpdateByID(ID string, update interface{}, ctx context.Context) error

func (*MongoCollection) UpdateByIDWithTimeout

func (coll *MongoCollection) UpdateByIDWithTimeout(ID string, update interface{}, timeout time.Duration, ctx context.Context) error

type MongoConnection

type MongoConnection struct {
	// contains filtered or unexported fields
}
var Client *MongoConnection

func InitConnectionFromConfig

func InitConnectionFromConfig(c *config.Config) (*MongoConnection, error)

func (*MongoConnection) InitDatabase

func (conn *MongoConnection) InitDatabase(database string) *MongoDatabase

type MongoDatabase

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

func (*MongoDatabase) InitCollection

func (database *MongoDatabase) InitCollection(collection string) *MongoCollection

Jump to

Keyboard shortcuts

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