backend

package
v0.0.0-...-f3b78e2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2018 License: GPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NextId

func NextId(db *mgo.Database, objectType string) (int, error)

Types

type Account

type Account struct {
	Id        int    `bson:"_id"`
	Email     string `bson:"email"`
	Password  string `bson:"password"`
	CreatedAt int64  `bson:"created_at,minsize"`
}

type AccountAuthParams

type AccountAuthParams struct {
	Email    string
	Password string
}

type AccountAuthResult

type AccountAuthResult struct {
	Success bool
	Account Account
}

type AccountCreateParams

type AccountCreateParams struct {
	Email    string
	Password string
}

type AccountCreateResult

type AccountCreateResult struct {
	Id int
}

type AccountService

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

func NewAccountService

func NewAccountService(db *mgo.Database) *AccountService

func (*AccountService) Auth

func (a *AccountService) Auth(params AccountAuthParams, result *AccountAuthResult) error

func (*AccountService) Create

func (a *AccountService) Create(params AccountCreateParams, result *AccountCreateResult) error

type Audio

type Audio struct {
	Id       int    `bson:"_id"`
	RadioId  int    `bson:"radio_id"`
	Title    string `bson:"title"`
	Duration int    `bson:"duration"`
	Date     int64  `bson:"ts"`
}

type AudioGetParams

type AudioGetParams struct {
	RadioId int
	Day     string
}

type AudioResult

type AudioResult struct {
	Items []Audio
}

type AudioService

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

func NewAudioService

func NewAudioService(db *mgo.Database) *AudioService

func (*AudioService) Get

func (a *AudioService) Get(params AudioGetParams, result *AudioResult) error

type ChannelsResult

type ChannelsResult struct {
	Items []StreamChannel
}

type Playlist

type Playlist struct {
	Id      int      `bson:"_id"`
	Content string   `bson:"content"`
	OwnerId int      `bson:"owner_id"`
	Streams []string `bson:"streams"`
	AddedAt int64    `bson:"added_at,omitempty,minsize"`
}

type PlaylistAddParams

type PlaylistAddParams struct {
	Id      int
	Content string
	OwnerId int
}

type PlaylistGetParams

type PlaylistGetParams struct {
	OwnerId int
	Id      []int
}

type PlaylistInfo

type PlaylistInfo struct {
	Url   string
	Error string
	Info  *radio.StreamInfo
}

type PlaylistResult

type PlaylistResult struct {
	Items []Playlist
}

type PlaylistService

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

func NewPlaylistService

func NewPlaylistService(db *mgo.Database) *PlaylistService

func (*PlaylistService) Add

func (p *PlaylistService) Add(params PlaylistAddParams, result *int) error

func (*PlaylistService) Get

func (p *PlaylistService) Get(params PlaylistGetParams, result *PlaylistResult) error

type Radio

type Radio struct {
	Id        int   `bson:"_id"`
	OwnerId   int   `bson:"owner_id,omitempty"`
	DeletedAt int64 `bson:"deleted_at,minsize"`
	AddedAt   int64 `bson:"added_at,omitempty,minsize"`
	Title     string
}

type RadioDeleteParams

type RadioDeleteParams struct {
	OwnerId int
	RadioId int
}

type RadioGetParams

type RadioGetParams struct {
	OwnerId int
	Id      []int
}

type RadioResult

type RadioResult struct {
	Items []Radio
}

type RadioSearchParams

type RadioSearchParams struct {
	Query string
}

type RadioService

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

func NewRadioService

func NewRadioService(db *mgo.Database) *RadioService

func (*RadioService) Add

func (r *RadioService) Add(radio Radio, result *int) error

func (*RadioService) Delete

func (r *RadioService) Delete(params *RadioDeleteParams, response *bool) error

func (*RadioService) Edit

func (r *RadioService) Edit(radio Radio, result *int) error

func (*RadioService) Get

func (r *RadioService) Get(params RadioGetParams, result *RadioResult) error

func (*RadioService) Search

func (r *RadioService) Search(params RadioSearchParams, result *RadioResult) error

type Stream

type Stream struct {
	Id        int    `bson:"_id"`
	Name      string `bson:"name,omitempty" json:"-"`
	RadioId   int    `bson:"radio_id,minsize,omitempty"`
	OwnerId   int    `bson:"owner_id,omitempty"`
	DeletedAt int64  `bson:"deleted_at,minsize" json:"-"`
	AddedAt   int64  `bson:"added_at,omitempty,minsize" json:"-"`
	Url       string `bson:"url"`
	// info from headers
	Info radio.StreamInfo `bson:"info,omitempty"`
}

type StreamChannel

type StreamChannel struct {
	Title       string   `bson:"_id"`
	RadioId     int      `bson:"radio_id"`
	Bitrate     []int    `bson:"bitrate"`
	StreamId    []int    `bson:"stream_id"`
	ContentType []string `bson:"content_type"`
}

type StreamDeleteParams

type StreamDeleteParams struct {
	OwnerId int
	RadioId int
}

type StreamFetchInfoParams

type StreamFetchInfoParams struct {
	Url string
}

type StreamGetChannelsParams

type StreamGetChannelsParams struct {
	OwnerId     int
	ContentType []string
}

type StreamGetListenParams

type StreamGetListenParams struct {
	RadioId int
	OwnerId int
	Bitrate int
}

type StreamGetListenResult

type StreamGetListenResult struct {
}

type StreamGetParams

type StreamGetParams struct {
	OwnerId     int
	RadioId     int
	Bitrate     int
	ContentType []string
	Id          []int
}

type StreamInfo

type StreamInfo struct {
	Url  string           `bson:"_id"`
	Date int64            `bson:"date,minsize"`
	Info radio.StreamInfo `bson:"info"`
}

type StreamListen

type StreamListen struct {
	Bitrate int      `bson:"_id"`
	Url     []string `bson:"url"`
}

type StreamResult

type StreamResult struct {
	Items []Stream
}

type StreamSearchParams

type StreamSearchParams struct {
	Query string
}

type StreamService

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

func NewStreamService

func NewStreamService(db *mgo.Database, bd *rpc.Client) *StreamService

func (*StreamService) Delete

func (s *StreamService) Delete(params StreamDeleteParams, response *bool) error

func (*StreamService) Edit

func (s *StreamService) Edit(stream Stream, result *int) error

func (*StreamService) FetchInfo

func (s *StreamService) FetchInfo(params StreamFetchInfoParams, result *radio.StreamInfo) error

func (*StreamService) Get

func (s *StreamService) Get(params StreamGetParams, result *StreamResult) error

func (*StreamService) GetChannels

func (s *StreamService) GetChannels(params StreamGetChannelsParams, result *ChannelsResult) error

func (*StreamService) GetListen

func (s *StreamService) GetListen(params StreamGetListenParams, result *StreamListen) error

func (*StreamService) Save

func (s *StreamService) Save(stream Stream, result *int) error

func (*StreamService) Search

func (s *StreamService) Search(params StreamSearchParams, result *StreamResult) error

Jump to

Keyboard shortcuts

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