mongogo

package module
v0.0.0-...-bff4167 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection interface {
	Close() error
	InsertOne(entity any) error
	UpdateOne(entity any) error
	GetAll() (any, error)
	GetOne(id ObjectID) any
}

func NewConnection

func NewConnection(ctx context.Context, host string, database string, collection string) (Connection, error)

type MongoConnection

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

func (MongoConnection) Close

func (c MongoConnection) Close() error

func (MongoConnection) DeleteOne

func (c MongoConnection) DeleteOne(id primitive.ObjectID) error

func (MongoConnection) GetAll

func (c MongoConnection) GetAll() (any, error)

func (MongoConnection) GetOne

func (c MongoConnection) GetOne(id ObjectID) any

func (MongoConnection) InsertOne

func (c MongoConnection) InsertOne(entity any) error

func (MongoConnection) UpdateOne

func (c MongoConnection) UpdateOne(entity any) error

type ObjectID

type ObjectID primitive.ObjectID

Jump to

Keyboard shortcuts

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