mk

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicURI

func BasicURI() *options.ClientOptions

func BsonD

func BsonD(v interface{}) (doc *bson.D, err error)

func ObjectID

func ObjectID(id string) primitive.ObjectID

Types

type CTXTimeoutFunc

type CTXTimeoutFunc func(...time.Duration) context.Context

type MongoKit

type MongoKit interface {
	Error() error

	Client() *mongo.Client

	Connection(clientOptions *options.ClientOptions) MongoKit
	InitDB(db string, option ...*options.DatabaseOptions) MongoKit
	DB() *mongo.Database
	Ping() MongoKit

	InitCollection(interface{}, ...string) MongoKit
	Collection() *mongo.Collection

	CtxTB(...time.Duration) context.Context
}

func InitMongoKit

func InitMongoKit() MongoKit

type Schema

type Schema struct {
	CreatedAt time.Time `json:"created_at,omitempty" bson:"created_at,omitempty" faker:"-"`
	UpdatedAt time.Time `json:"updated_at,omitempty" bson:"updated_at,omitempty" faker:"-"`
}

func SchemaCreated

func SchemaCreated() Schema

func SchemaUpdated

func SchemaUpdated() Schema

Jump to

Keyboard shortcuts

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