client

package
v0.0.0-...-9666ada Latest Latest
Warning

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

Go to latest
Published: May 5, 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 DbClient

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

func NewDbClient

func NewDbClient(uri string, database string) (*DbClient, error)

func (*DbClient) Collection

func (c *DbClient) Collection(name string) *mongo.Collection

func (*DbClient) GetMovieById

func (c *DbClient) GetMovieById(id string) (mov Movie, err error)

func (*DbClient) InsertMovies

func (c *DbClient) InsertMovies(movies []Movie) error

type Movie

type Movie struct {
	Id       string `bson:"_id"`
	Title    string `bson:"title"`
	Year     int    `bson:"year"`
	Director string `bson:"director"`
	Genre    string `bson:"genre"`
}

Jump to

Keyboard shortcuts

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