models

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IdAlbum  = iota // Album mode id
	IdAlbums        // Albums mode id
)

Variables

This section is empty.

Functions

func Register

func Register(profile Profile) error

Register setup models profile to init model logic

Types

type Album

type Album struct {
	Id          string `json:"id,omitempty"`
	Title       string `json:"title"`
	Artist      string `json:"artist"`
	ReleaseYear string `json:"releaseYear"`
	Genre       string `json:"genre"`
	TrackCount  int    `json:"-"`
	AlbumId     string `json:"albumId,omitempty"`
}

Album indicate album info

func (*Album) Create

func (m *Album) Create() error

Create add album to repository

func (*Album) Delete

func (m *Album) Delete() error

Delete remove album by id from repository

func (*Album) Reset

func (m *Album) Reset()

Reset reset album used to recycle to pool

func (*Album) Retrieve

func (m *Album) Retrieve() error

Retrieve get album from repository

func (*Album) Update

func (m *Album) Update() error

Update update album by id to repository

type Albums

type Albums []*Album

Albums indicate album slice

func (*Albums) Reset

func (m *Albums) Reset()

Reset reset albums

func (*Albums) Retrieve

func (m *Albums) Retrieve() error

Retrieve get albums

type Profile

type Profile int

Profile indicate model config

const (
	MemoryProfile Profile = iota
)

Profiles items

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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