models

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Album

type Album struct {
	ID             int32          `json:"id"`
	MbzID          *uuid.UUID     `json:"musicbrainz_id"`
	Title          string         `json:"title"`
	Image          *uuid.UUID     `json:"image"`
	Artists        []SimpleArtist `json:"artists"`
	VariousArtists bool           `json:"is_various_artists"`
	ListenCount    int64          `json:"listen_count"`
	TimeListened   int64          `json:"time_listened"`
	FirstListen    int64          `json:"first_listen"`
}

type Alias

type Alias struct {
	ID      int32  `json:"id,omitempty"`
	Alias   string `json:"alias"`
	Source  string `json:"source"`
	Primary bool   `json:"is_primary"`
}

type ApiKey

type ApiKey struct {
	ID        int32     `json:"id"`
	Key       string    `json:"key"`
	Label     string    `json:"label"`
	UserID    int32     `json:"user_id"`
	CreatedAt time.Time `json:"created_at"`
}

type Artist

type Artist struct {
	ID           int32      `json:"id"`
	MbzID        *uuid.UUID `json:"musicbrainz_id"`
	Name         string     `json:"name"`
	Aliases      []string   `json:"aliases"`
	Image        *uuid.UUID `json:"image"`
	ListenCount  int64      `json:"listen_count"`
	TimeListened int64      `json:"time_listened"`
	FirstListen  int64      `json:"first_listen"`
	IsPrimary    bool       `json:"is_primary,omitempty"`
}

type ArtistWithFullAliases

type ArtistWithFullAliases struct {
	ID           int32      `json:"id"`
	MbzID        *uuid.UUID `json:"musicbrainz_id"`
	Name         string     `json:"name"`
	Aliases      []Alias    `json:"aliases"`
	Image        *uuid.UUID `json:"image"`
	ImageSource  string     `json:"image_source,omitempty"`
	ListenCount  int64      `json:"listen_count"`
	TimeListened int64      `json:"time_listened"`
	FirstListen  int64      `json:"first_listen"`
	IsPrimary    bool       `json:"is_primary,omitempty"`
}

type Listen

type Listen struct {
	Time  time.Time `json:"time"`
	Track Track     `json:"track"`
}

a Listen is the same thing as a 'scrobble' but i despise the word scrobble so i will not use it

type Session

type Session struct {
	ID         uuid.UUID
	UserID     int32
	CreatedAt  time.Time
	ExpiresAt  time.Time
	Persistent bool
}

type SimpleArtist

type SimpleArtist struct {
	ID   int32  `json:"id"`
	Name string `json:"name"`
}

type Track

type Track struct {
	ID           int32          `json:"id"`
	Title        string         `json:"title"`
	Artists      []SimpleArtist `json:"artists"`
	MbzID        *uuid.UUID     `json:"musicbrainz_id"`
	ListenCount  int64          `json:"listen_count"`
	Duration     int32          `json:"duration"`
	Image        *uuid.UUID     `json:"image"`
	AlbumID      int32          `json:"album_id"`
	Album        *string        `json:"album,omitempty"`
	TimeListened int64          `json:"time_listened"`
	FirstListen  int64          `json:"first_listen"`
}

type User

type User struct {
	ID       int32    `json:"id"`
	Username string   `json:"username"`
	Role     UserRole `json:"role"` // 'admin' | 'user'
	Password []byte   `json:"-"`
}

type UserRole

type UserRole string
const (
	UserRoleUser  UserRole = "user"
	UserRoleAdmin UserRole = "admin"
)

Jump to

Keyboard shortcuts

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