topicModel

package
v0.0.0-...-ada85f3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetMongoDB

func SetMongoDB(m *mgo.Database)

SetMongoDB is a function to set a mgo.Database

Types

type Topic

type Topic struct {
	ID   bson.ObjectId `json:"_id,omitempty" bson:"_id,omitempty"`
	Name string        `bson:"name" json:"name"`
}

Topic is a type for topic collection in mongo

func (*Topic) Delete

func (t *Topic) Delete() error

Delete is a function that can delete a topic

func (*Topic) GetOneByID

func (t *Topic) GetOneByID(id string) error

GetOneByID function for get topic by id

func (*Topic) GetOneByName

func (t *Topic) GetOneByName(name string) error

GetOneByName function for get topic by name

func (*Topic) Save

func (t *Topic) Save() error

Save function for topic

func (*Topic) Update

func (t *Topic) Update(doc bson.M) error

Update function is a function that will query and update value of topic

type Topics

type Topics []Topic

Topics is a array of Topic

func (*Topics) GetAll

func (t *Topics) GetAll() error

GetAll function for get all topics

Jump to

Keyboard shortcuts

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