models

package
v0.0.0-...-27a7f96 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func CreateDBClient

func CreateDBClient() *mongo.Client

create Mongo client

func GetCollection

func GetCollection(collectionName string) *mongo.Collection

returns collection

func Ping

func Ping() bool

used by /readyz endpoint, used to gauge app readiness/liveliness

Types

type CreateMovieInput

type CreateMovieInput struct {
	Title           string   `json:"title" binding:"required"`
	Genre           string   `json:"genre" binding:"required"`
	Director        string   `json:"director" binding:"required"`
	Language        string   `json:"language" binding:"required"`
	CountryOfOrigin string   `json:"country_of_origin" binding:"required"`
	Actors          []string `json:"actors" binding:"required"`
	ReleaseDate     string   `json:"release_date" binding:"required"`
}

input used to marshal for POST /movies endpoint

type Movie

type Movie struct {
	ID              primitive.ObjectID `bson:"_id,omitempty" json:"id"`
	Title           string             `json:"title"`
	Genre           string             `json:"genre"`
	Director        string             `json:"director"`
	Language        string             `json:"language"`
	CountryOfOrigin string             `json:"country_of_origin"`
	Actors          []string           `json:"actors"`
	ReleaseDate     string             `json:"release_date"`
}

Jump to

Keyboard shortcuts

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