Documentation
¶
Index ¶
- Constants
- Variables
- type Album
- type AlbumRepository
- type Albums
- type AnnotatedRepository
- type Artist
- type ArtistIndex
- type ArtistIndexes
- type ArtistRepository
- type Artists
- type DataStore
- type Genre
- type GenreRepository
- type Genres
- type MediaFile
- type MediaFileRepository
- type MediaFiles
- type MediaFolder
- type MediaFolderRepository
- type MediaFolders
- type Player
- type PlayerRepository
- type Players
- type Playlist
- type PlaylistRepository
- type Playlists
- type Property
- type PropertyRepository
- type QueryOptions
- type ResourceRepository
- type Transcoding
- type TranscodingRepository
- type Transcodings
- type User
- type UserRepository
- type Users
Constants ¶
View Source
const (
PropLastScan = "LastScan"
)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Album ¶
type Album struct {
ID string `json:"id" orm:"column(id)"`
Name string `json:"name"`
ArtistID string `json:"artistId" orm:"pk;column(artist_id)"`
CoverArtPath string `json:"coverArtPath"`
CoverArtId string `json:"coverArtId"`
Artist string `json:"artist"`
AlbumArtist string `json:"albumArtist"`
Year int `json:"year"`
Compilation bool `json:"compilation"`
SongCount int `json:"songCount"`
Duration float32 `json:"duration"`
Genre string `json:"genre"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
// Annotations
PlayCount int `json:"-" orm:"-"`
PlayDate time.Time `json:"-" orm:"-"`
Rating int `json:"-" orm:"-"`
Starred bool `json:"-" orm:"-"`
StarredAt time.Time `json:"-" orm:"-"`
}
type AlbumRepository ¶
type AlbumRepository interface {
CountAll(...QueryOptions) (int64, error)
Exists(id string) (bool, error)
Put(m *Album) error
Get(id string) (*Album, error)
FindByArtist(artistId string) (Albums, error)
GetAll(...QueryOptions) (Albums, error)
GetRandom(...QueryOptions) (Albums, error)
GetStarred(options ...QueryOptions) (Albums, error)
Search(q string, offset int, size int) (Albums, error)
Refresh(ids ...string) error
PurgeEmpty() error
AnnotatedRepository
}
type AnnotatedRepository ¶ added in v0.5.0
type Artist ¶
type Artist struct {
ID string `json:"id" orm:"column(id)"`
Name string `json:"name"`
AlbumCount int `json:"albumCount" orm:"column(album_count)"`
// Annotations
PlayCount int `json:"-" orm:"-"`
PlayDate time.Time `json:"-" orm:"-"`
Rating int `json:"-" orm:"-"`
Starred bool `json:"-" orm:"-"`
StarredAt time.Time `json:"-" orm:"-"`
}
type ArtistIndex ¶
type ArtistIndexes ¶
type ArtistIndexes []ArtistIndex
type ArtistRepository ¶
type ArtistRepository interface {
CountAll(options ...QueryOptions) (int64, error)
Exists(id string) (bool, error)
Put(m *Artist) error
Get(id string) (*Artist, error)
GetStarred(options ...QueryOptions) (Artists, error)
Search(q string, offset int, size int) (Artists, error)
Refresh(ids ...string) error
GetIndex() (ArtistIndexes, error)
PurgeEmpty() error
AnnotatedRepository
}
type DataStore ¶
type DataStore interface {
Album(ctx context.Context) AlbumRepository
Artist(ctx context.Context) ArtistRepository
MediaFile(ctx context.Context) MediaFileRepository
MediaFolder(ctx context.Context) MediaFolderRepository
Genre(ctx context.Context) GenreRepository
Playlist(ctx context.Context) PlaylistRepository
Property(ctx context.Context) PropertyRepository
User(ctx context.Context) UserRepository
Transcoding(ctx context.Context) TranscodingRepository
Player(ctx context.Context) PlayerRepository
Resource(ctx context.Context, model interface{}) ResourceRepository
WithTx(func(tx DataStore) error) error
GC(ctx context.Context) error
}
type GenreRepository ¶
type MediaFile ¶
type MediaFile struct {
ID string `json:"id" orm:"pk;column(id)"`
Path string `json:"path"`
Title string `json:"title"`
Album string `json:"album"`
Artist string `json:"artist"`
ArtistID string `json:"artistId" orm:"pk;column(artist_id)"`
AlbumArtist string `json:"albumArtist"`
AlbumID string `json:"albumId" orm:"pk;column(album_id)"`
HasCoverArt bool `json:"hasCoverArt"`
TrackNumber int `json:"trackNumber"`
DiscNumber int `json:"discNumber"`
Year int `json:"year"`
Size int `json:"size"`
Suffix string `json:"suffix"`
Duration float32 `json:"duration"`
BitRate int `json:"bitRate"`
Genre string `json:"genre"`
Compilation bool `json:"compilation"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
// Annotations
PlayCount int `json:"-" orm:"-"`
PlayDate time.Time `json:"-" orm:"-"`
Rating int `json:"-" orm:"-"`
Starred bool `json:"-" orm:"-"`
StarredAt time.Time `json:"-" orm:"-"`
}
func (*MediaFile) ContentType ¶
type MediaFileRepository ¶
type MediaFileRepository interface {
CountAll(options ...QueryOptions) (int64, error)
Exists(id string) (bool, error)
Put(m *MediaFile) error
Get(id string) (*MediaFile, error)
FindByAlbum(albumId string) (MediaFiles, error)
FindByPath(path string) (MediaFiles, error)
GetStarred(options ...QueryOptions) (MediaFiles, error)
GetRandom(options ...QueryOptions) (MediaFiles, error)
Search(q string, offset int, size int) (MediaFiles, error)
Delete(id string) error
DeleteByPath(path string) error
AnnotatedRepository
}
type MediaFiles ¶
type MediaFiles []MediaFile
type MediaFolder ¶
type MediaFolderRepository ¶
type MediaFolderRepository interface {
Get(id string) (*MediaFolder, error)
GetAll() (MediaFolders, error)
}
type MediaFolders ¶
type MediaFolders []MediaFolder
type Player ¶ added in v0.10.0
type Player struct {
ID string `json:"id" orm:"column(id)"`
Name string `json:"name"`
Type string `json:"type"`
UserName string `json:"userName"`
Client string `json:"client"`
IPAddress string `json:"ipAddress"`
LastSeen time.Time `json:"lastSeen"`
TranscodingId string `json:"transcodingId"`
MaxBitRate int `json:"maxBitRate"`
}
type PlayerRepository ¶ added in v0.10.0
type PlaylistRepository ¶
type PropertyRepository ¶
type QueryOptions ¶
type ResourceRepository ¶
type ResourceRepository interface {
rest.Repository
}
type Transcoding ¶ added in v0.10.0
type TranscodingRepository ¶ added in v0.10.0
type TranscodingRepository interface {
Get(id string) (*Transcoding, error)
CountAll(...QueryOptions) (int64, error)
Put(*Transcoding) error
FindByFormat(format string) (*Transcoding, error)
}
type Transcodings ¶ added in v0.10.0
type Transcodings []Transcoding
type User ¶
type User struct {
ID string `json:"id" orm:"column(id)"`
UserName string `json:"userName"`
Name string `json:"name"`
Email string `json:"email"`
Password string `json:"password"`
IsAdmin bool `json:"isAdmin"`
LastLoginAt *time.Time `json:"lastLoginAt"`
LastAccessAt *time.Time `json:"lastAccessAt"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
type UserRepository ¶
Click to show internal directories.
Click to hide internal directories.