models

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TaskStatusNew        = "new"
	TaskStatusInProgress = "in_progress"
	TaskStatusError      = "error"
	TaskStatusSuccess    = "success"
)

Task statuses

Variables

This section is empty.

Functions

This section is empty.

Types

type Album

type Album struct {
	ID          int64  `db:"album_id"`
	Year        int16  `db:"album_year"`
	TotalTracks int16  `db:"album_total_tracks"`
	DiscNumber  int16  `db:"album_disc_number"`
	Name        string `db:"album_name"`
	Image       string `db:"album_image"`
	Description string `db:"album_description"`
}

Album is a music album

type AlbumWithArtists

type AlbumWithArtists struct {
	Album   *Album
	Artists []*Artist
}

AlbumWithArtist row of the album with artist

type AlbumWithArtistsAggr

type AlbumWithArtistsAggr struct {
	*Album
	*ArtistsAggr
}

AlbumWithArtistAggr is AlbumWithArtists with aggregate fields of the artist

type Artist

type Artist struct {
	ID          int64  `db:"artist_id"`
	Name        string `db:"artist_name"`
	Image       string `db:"artist_image"`
	Description string `db:"artist_description"`
}

Artist is a artist of the album/track

type ArtistsAggr

type ArtistsAggr struct {
	ArtistsID   pq.Int64Array  `db:"artists_id"`
	ArtistsName pq.StringArray `db:"artists_name"`
}

ArtistsAggr list of the artists with aggregate fields

type Genre

type Genre struct {
	ID          int64  `db:"genre_id"`
	Name        string `db:"genre_name"`
	Description string `db:"genre_description"`
}

Genre is a music genre

type Music

type Music struct {
	UserID int64
	*Artist
	*Album
	*Track
	*Genre
}

Music contains full information

type PreMusicData

type PreMusicData struct {
	ArtistID         int64
	AlbumID          int64
	GenreID          int64
	TrackNumber      int64
	IsTrackNameSet   bool
	IsTrackLyricsSet bool
	TrackName        string
	TrackLyrics      string
}

PreMusicData preload data about music file

type Setting

type Setting struct {
	Name  string `db:"setting_name"`
	Value string `db:"setting_value"`
}

Setting is a element of the settings table

type Tag

type Tag struct {
	ID          int64  `db:"tag_id"`
	Name        string `db:"tag_name"`
	Value       string `db:"tag_value"`
	Description string `db:"tag_description"`
}

Tag of the track, album or artist. Value may be empty

type TagVariant

type TagVariant struct {
	ID          int64
	Value       string
	Description string
}

TagVariant element of the tag variant with id, value and description

type TagWithAggr

type TagWithAggr struct {
	Name            string         `db:"tag_name"`
	TagsID          pq.Int64Array  `db:"tags_id"`
	TagsValue       pq.StringArray `db:"tags_value"`
	TagsDescription pq.StringArray `db:"tags_description"`
}

TagWithAggr tag with aggregated fields

type TagWithVariants

type TagWithVariants struct {
	Name     string
	Variants []*TagVariant
}

TagWithValuesList is a tag grouped by name

type Task

type Task struct {
	ID        int64     `db:"task_id"`
	CreatedAt time.Time `db:"task_created_at"`
	UserID    int64     `db:"task_user_id"`
	TrackID   int64     `db:"task_track_id"`
	Status    string    `db:"task_status"`
	FileName  string    `db:"task_file_name"`
	ErrorText string    `db:"task_error_text"`
}

Task is a tasker type

type Track

type Track struct {
	ID         int64     `db:"track_id"`
	AlbumID    int64     `db:"track_album_id"`
	Duration   int64     `db:"track_duration"`
	CreatedAt  time.Time `db:"track_created_at"`
	Number     int16     `db:"track_number"`
	FileMiddle string    `db:"track_file_middle"`
	FileHigh   string    `db:"track_file_high"`
	Name       string    `db:"track_name"`
	Lyrics     string    `db:"track_lyrics"`
}

Track is a music tracks

type TrackWithAlbumArtists

type TrackWithAlbumArtists struct {
	*Track
	*Album
	Artists []*Artist
}

TrackWithAlbumArtists row of the track with album and artist info

type TrackWithAlbumArtistsAggr

type TrackWithAlbumArtistsAggr struct {
	*Track
	*Album
	*ArtistsAggr
}

TrackWithAlbumArtistsAggr is TrackWithAlbumArtist with aggregate fields of the artist

type TrackWithGenresAlbumArtists

type TrackWithGenresAlbumArtists struct {
	*Track
	*Album
	Artists []*Artist
	Genres  []*Genre
}

TrackWithGenresAlbumArtist row of the track with genres list, album and artist info

type TrackWithGenresAlbumArtistsAggr

type TrackWithGenresAlbumArtistsAggr struct {
	*Track
	*Album
	*ArtistsAggr
	Genres []*Genre `db:"-"`
}

TrackWithGenresAlbumArtistAggr is TrackWithGenresAlbumArtist with aggregate fields of the artist

Jump to

Keyboard shortcuts

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