ice

package
v0.0.0-...-9992a52 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2018 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

Close the database.

func Echo

func Echo(c echo.Context, x ...Data) error

Echo gets d from c.

func Find

func Find(d Data) error

Find gets the rest of d.

func FormImportFile

func FormImportFile(file *multipart.FileHeader) (string, error)

FormImportFile imports file into a temporary folder and checks it.

func New

func New(d Data) error

New creates d.

func Remove

func Remove(d Data) error

Remove deletes d.

func Start

func Start() error

Start the database.

func Update

func Update(d Data, i interface{}) error

Update d with the data from i.

Types

type Data

type Data interface {
	Create() error
	Delete() error
	Get() error
	Update(interface{}) error
	Echo(echo.Context) error
}

Data is the interface.

func GetUserFromContext

func GetUserFromContext(c echo.Context) (Data, error)

GetUserFromContext returns a user from a JWT token.

func InitStation

func InitStation() Data

InitStation is used the create a empty station variable.

func InitStream

func InitStream() Data

InitStream is used to create a empty stream variable.

func InitTrack

func InitTrack() Data

InitTrack is used to create a empty track variable.

func InitUser

func InitUser() Data

InitUser is used to create a empty user variable.

type Station

type Station struct {
	database.Station
}

Station info

func (*Station) Create

func (s *Station) Create() error

Create s

func (*Station) Delete

func (s *Station) Delete() error

Delete the station.

func (*Station) Echo

func (s *Station) Echo(c echo.Context) error

Echo gets the station struct from the echo context.

func (*Station) Get

func (s *Station) Get() error

Get the station information.

func (*Station) Update

func (s *Station) Update(i interface{}) error

Update s with info

type Stream

type Stream struct {
	database.Stream
}

Stream information

func (*Stream) Create

func (s *Stream) Create() error

Create a stream

func (*Stream) Delete

func (s *Stream) Delete() error

Delete a stream

func (*Stream) Echo

func (s *Stream) Echo(c echo.Context) error

Echo gets the stream struct from the echo context.

func (*Stream) Get

func (s *Stream) Get() error

Get stream information

func (Stream) Play

func (s Stream) Play(t Track) error

Play will play the track in the stream.

func (*Stream) Update

func (s *Stream) Update(i interface{}) error

Update a stream

type Track

type Track struct {
	database.Track
}

Track information

func (*Track) Create

func (t *Track) Create() error

Create makes a new track entry.

func (*Track) Delete

func (t *Track) Delete() error

Delete the track

func (*Track) Echo

func (t *Track) Echo(c echo.Context) error

Echo fills in t from data in c.

func (*Track) FixTags

func (t *Track) FixTags()

FixTags fixes any issues with the tags.

func (*Track) Get

func (t *Track) Get() error

Get the first track with this info.

func (*Track) Update

func (t *Track) Update(i interface{}) error

Update the track with the data from info.

type User

type User struct {
	database.User
}

User info

func (*User) Create

func (user *User) Create() error

Create a user.

func (User) CreateStation

func (user User) CreateStation(info Station) error

CreateStation allows for user to create a station from info.

func (User) Delete

func (user User) Delete() error

Delete the user

func (*User) Echo

func (user *User) Echo(c echo.Context) error

Echo gets the user from the echo context jwt.

func (*User) Get

func (user *User) Get() error

Get a user

func (User) Login

func (user User) Login() (string, error)

Login as the user.

func (*User) Update

func (user *User) Update(i interface{}) error

Update user with the data from info func (user *User) Update(info User) error {

Jump to

Keyboard shortcuts

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