Documentation
¶
Index ¶
- Constants
- Variables
- type Album
- type AlbumRepository
- type Albums
- type AnnotatedModel
- type AnnotatedRepository
- type Annotations
- type Artist
- type ArtistIndex
- type ArtistIndexes
- type ArtistRepository
- type Artists
- type Bookmark
- type Bookmarkable
- type BookmarkableRepository
- type Bookmarks
- type DataStore
- type Genre
- type GenreRepository
- type Genres
- type MediaFile
- type MediaFileRepository
- type MediaFiles
- type MediaFolder
- type MediaFolderRepository
- type MediaFolders
- type PlayQueue
- type PlayQueueRepository
- type PlayQueues
- type Player
- type PlayerRepository
- type Players
- type Playlist
- type PlaylistRepository
- type PlaylistTrack
- type PlaylistTrackRepository
- type PlaylistTracks
- 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 ¶
View Source
var ( ErrNotFound = errors.New("data not found") ErrInvalidAuth = errors.New("invalid authentication") ErrNotAuthorized = errors.New("not authorized") )
View Source
var AnnotationFields = []string{"playCount", "playDate", "rating", "starred", "starredAt"}
While I can't find a better way to make these fields optional in the models, I keep this list here to be used in other packages
View Source
var BookmarkFields = []string{"bookmarkPosition"}
While I can't find a better way to make these fields optional in the models, I keep this list here to be used in other packages
Functions ¶
This section is empty.
Types ¶
type Album ¶
type Album struct {
Annotations
ID string `json:"id" orm:"column(id)"`
Name string `json:"name"`
CoverArtPath string `json:"coverArtPath"`
CoverArtId string `json:"coverArtId"`
ArtistID string `json:"artistId" orm:"pk;column(artist_id)"`
Artist string `json:"artist"`
AlbumArtistID string `json:"albumArtistId" orm:"pk;column(album_artist_id)"`
AlbumArtist string `json:"albumArtist"`
MaxYear int `json:"maxYear"`
MinYear int `json:"minYear"`
Compilation bool `json:"compilation"`
SongCount int `json:"songCount"`
Duration float32 `json:"duration"`
Genre string `json:"genre"`
FullText string `json:"fullText"`
SortAlbumName string `json:"sortAlbumName"`
SortArtistName string `json:"sortArtistName"`
SortAlbumArtistName string `json:"sortAlbumArtistName"`
OrderAlbumName string `json:"orderAlbumName"`
OrderAlbumArtistName string `json:"orderAlbumArtistName"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
func (Album) GetAnnotations ¶ added in v0.20.0
func (a Album) GetAnnotations() Annotations
type AlbumRepository ¶
type AlbumRepository interface {
CountAll(...QueryOptions) (int64, error)
Exists(id string) (bool, error)
Get(id string) (*Album, error)
FindByArtist(albumArtistId 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
AnnotatedRepository
}
type AnnotatedModel ¶ added in v0.20.0
type AnnotatedModel interface {
GetAnnotations() Annotations
}
type AnnotatedRepository ¶ added in v0.5.0
type Annotations ¶ added in v0.20.0
type Artist ¶
type Artist struct {
Annotations
ID string `json:"id" orm:"column(id)"`
Name string `json:"name"`
AlbumCount int `json:"albumCount"`
SongCount int `json:"songCount"`
FullText string `json:"fullText"`
SortArtistName string `json:"sortArtistName"`
OrderArtistName string `json:"orderArtistName"`
}
func (Artist) GetAnnotations ¶ added in v0.20.0
func (a Artist) GetAnnotations() Annotations
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)
AnnotatedRepository
}
type Bookmarkable ¶ added in v0.28.0
type Bookmarkable struct {
BookmarkPosition int64 `json:"bookmarkPosition"`
}
type BookmarkableRepository ¶ added in v0.28.0
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
PlayQueue(ctx context.Context) PlayQueueRepository
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 {
Annotations
Bookmarkable
ID string `json:"id" orm:"pk;column(id)"`
Path string `json:"path"`
Title string `json:"title"`
Album string `json:"album"`
ArtistID string `json:"artistId" orm:"pk;column(artist_id)"`
Artist string `json:"artist"`
AlbumArtistID string `json:"albumArtistId" orm:"pk;column(album_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"`
DiscSubtitle string `json:"discSubtitle"`
Year int `json:"year"`
Size int64 `json:"size"`
Suffix string `json:"suffix"`
Duration float32 `json:"duration"`
BitRate int `json:"bitRate"`
Genre string `json:"genre"`
FullText string `json:"fullText"`
SortTitle string `json:"sortTitle"`
SortAlbumName string `json:"sortAlbumName"`
SortArtistName string `json:"sortArtistName"`
SortAlbumArtistName string `json:"sortAlbumArtistName"`
OrderAlbumName string `json:"orderAlbumName"`
OrderArtistName string `json:"orderArtistName"`
OrderAlbumArtistName string `json:"orderAlbumArtistName"`
Compilation bool `json:"compilation"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
func (*MediaFile) ContentType ¶
func (MediaFile) GetAnnotations ¶ added in v0.20.0
func (mf MediaFile) GetAnnotations() Annotations
type MediaFileRepository ¶
type MediaFileRepository interface {
CountAll(options ...QueryOptions) (int64, error)
Exists(id string) (bool, error)
Put(m *MediaFile) error
Get(id string) (*MediaFile, error)
GetAll(options ...QueryOptions) (MediaFiles, error)
FindByAlbum(albumId string) (MediaFiles, error)
FindAllByPath(path string) (MediaFiles, error)
FindByPath(path string) (*MediaFile, error)
FindPathsRecursively(basePath string) ([]string, 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) (int64, error)
AnnotatedRepository
BookmarkableRepository
}
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 PlayQueue ¶ added in v0.28.0
type PlayQueue struct {
ID string `json:"id" orm:"column(id)"`
UserID string `json:"userId" orm:"column(user_id)"`
Current string `json:"current"`
Position int64 `json:"position"`
ChangedBy string `json:"changedBy"`
Items MediaFiles `json:"items,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
type PlayQueueRepository ¶ added in v0.28.0
type PlayQueues ¶ added in v0.28.0
type PlayQueues []PlayQueue
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 Playlist ¶
type Playlist struct {
ID string `json:"id" orm:"column(id)"`
Name string `json:"name"`
Comment string `json:"comment"`
Duration float32 `json:"duration"`
SongCount int `json:"songCount"`
Owner string `json:"owner"`
Public bool `json:"public"`
Tracks MediaFiles `json:"tracks,omitempty"`
Path string `json:"path"`
Sync bool `json:"sync"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
type PlaylistRepository ¶
type PlaylistRepository interface {
CountAll(options ...QueryOptions) (int64, error)
Exists(id string) (bool, error)
Put(pls *Playlist) error
Get(id string) (*Playlist, error)
GetAll(options ...QueryOptions) (Playlists, error)
FindByPath(path string) (*Playlist, error)
Delete(id string) error
Tracks(playlistId string) PlaylistTrackRepository
}
type PlaylistTrack ¶ added in v0.19.0
type PlaylistTrackRepository ¶ added in v0.19.0
type PlaylistTracks ¶ added in v0.19.0
type PlaylistTracks []PlaylistTrack
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 ¶
type UserRepository interface {
CountAll(...QueryOptions) (int64, error)
Get(id string) (*User, error)
Put(*User) error
FindFirstAdmin() (*User, error)
// FindByUsername must be case-insensitive
FindByUsername(username string) (*User, error)
UpdateLastLoginAt(id string) error
UpdateLastAccessAt(id string) error
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.