database

package
v0.0.0-...-99a26cb Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Content

type Content struct {
	ID   primitive.ObjectID `json:"id" bson:"_id,omitempty"`
	Name string             `json:"name"`
}

type Mongodb

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

func NewMongodb

func NewMongodb() *Mongodb

func (*Mongodb) GetContent

func (db *Mongodb) GetContent(id string) (Content, error)

func (*Mongodb) GetStream

func (db *Mongodb) GetStream(id string) (Stream, error)

func (*Mongodb) Init

func (db *Mongodb) Init() error

func (*Mongodb) InsertContent

func (db *Mongodb) InsertContent(content Content) (string, error)

func (*Mongodb) InsertStream

func (db *Mongodb) InsertStream(stream Stream) (string, error)

func (*Mongodb) UpdateStreamStatus

func (db *Mongodb) UpdateStreamStatus(id string, status string) error

func (*Mongodb) UpdateStreamUrl

func (db *Mongodb) UpdateStreamUrl(id string, url string) error

type Stream

type Stream struct {
	ID        primitive.ObjectID `json:"id" bson:"_id,omitempty"`
	ContentID string             `json:"content_id"`
	Key       string             `json:"key"`
	Kid       string             `json:"kid"`
	Status    string             `json:"status"`
	Url       string             `json:"url"`
}

Jump to

Keyboard shortcuts

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