dbproxy

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

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

Go to latest
Published: Mar 6, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DB ..
	DB = "micro_events"
	// USERS ...
	USERS = "users"
	// EVENTS ...
	EVENTS = "events"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	ID        bson.ObjectId `bson:"_id"`
	Name      string
	Duration  int
	StartDate int64
	EndDate   int64
	Location  Location
}

Event ...

type Hall

type Hall struct {
	ID       bson.ObjectId `bson:"_id"`
	Name     string        `json:"name"`
	Location string        `json:"location,omitempty"`
	Capacity int           `json:"capacity"`
}

Hall ...

type Location

type Location struct {
	ID        bson.ObjectId `bson:"_id"`
	Name      string
	Address   string
	Country   string
	OpenTime  int
	CloseTime int
	Halls     []Hall
}

Location ...

type MongoDBLayer

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

MongoDBLayer ...

func NewMongoDBLayer

func NewMongoDBLayer(uri string) (*MongoDBLayer, error)

NewMongoDBLayer ...

func (*MongoDBLayer) AddEvent

func (m *MongoDBLayer) AddEvent(e Event) (Event, error)

AddEvent ...

func (*MongoDBLayer) FindAllAvailableEvents

func (m *MongoDBLayer) FindAllAvailableEvents() ([]Event, error)

FindAllAvailableEvents ...

func (*MongoDBLayer) FindEvent

func (m *MongoDBLayer) FindEvent(id []byte) (Event, error)

FindEvent ...

func (*MongoDBLayer) FindEventByName

func (m *MongoDBLayer) FindEventByName(name string) (Event, error)

FindEventByName ...

Jump to

Keyboard shortcuts

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