_gamesdatanih

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 7 Imported by: 0

README

BE_UTS_Webservice

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MongoString string = os.Getenv("MONGOSTRING")

Functions

func InsertDataGame

func InsertDataGame(title string, genre string, developer string, publisher string, realeseyear int, platform string, mode string, price float64, rating float64) (InsertedID interface{})

func InsertOneDoc

func InsertOneDoc(db string, collection string, doc interface{}) (insertedID interface{})

func MongoConnect

func MongoConnect(dbname string) (db *mongo.Database)

Types

type GameData

type GameData struct {
	ID          primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	Title       string             `bson:"title" json:"title"`
	Genre       string             `bson:"genre" json:"genre"`
	Developer   string             `bson:"developer" json:"developer"`
	Publisher   string             `bson:"publisher" json:"publisher"`
	ReleaseYear int                `bson:"release_year" json:"release_year"`
	Platform    string             `bson:"platform" json:"platform"`
	Mode        string             `bson:"mode" json:"mode"`
	Price       float64            `bson:"price" json:"price"`
	Rating      float64            `bson:"rating" json:"rating"`
}

func GetAllGamme

func GetAllGamme() ([]GameData, error)

func GetGamebyID

func GetGamebyID(id primitive.ObjectID) (GameData, error)

Jump to

Keyboard shortcuts

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