models

package
v0.0.0-...-a1990c1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DateLayout = "02.01.2006"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Filters

type Filters struct {
	// contains filtered or unexported fields
}

func (Filters) Offset

func (f Filters) Offset() int

func (Filters) ToQueryParams

func (f Filters) ToQueryParams() (string, []any)

type Library

type Library struct {
	Songs      []Song     `json:"songs"`      // Songs list
	Pagination Pagination `json:"pagination"` // Pagination
}

Library contains filtered songs and pagination data. @Description Response with music library and pagination.

func (Library) MarshalEasyJSON

func (v Library) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Library) MarshalJSON

func (v Library) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Library) UnmarshalEasyJSON

func (v *Library) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Library) UnmarshalJSON

func (v *Library) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Lyrics

type Lyrics struct {
	Lyrics     string     `json:"lyrics"`     // Lyrics of the song
	Pagination Pagination `json:"pagination"` // Pagination
}

Lyrics contains filtered lyrics and pagination for song. @Description Response with lyrics and pagination.

func (Lyrics) MarshalEasyJSON

func (v Lyrics) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Lyrics) MarshalJSON

func (v Lyrics) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Lyrics) UnmarshalEasyJSON

func (v *Lyrics) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Lyrics) UnmarshalJSON

func (v *Lyrics) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Pagination

type Pagination struct {
	Limit  int `json:"limit"`
	Offset int `json:"offset"`
	Total  int `json:"total"`
}

type RawFilters

type RawFilters struct {
	Title       string
	Group       string
	ReleaseDate string
	Text        string
	Link        string
	Limit       string
	Offset      string
}

func (RawFilters) ToFilters

func (r RawFilters) ToFilters() (*Filters, error)

type Song

type Song struct {
	ID uuid.UUID `json:"id"` // ID is a unique identifier for the song
	SongTitle
	SongDetail
}

func (Song) MarshalEasyJSON

func (v Song) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Song) MarshalJSON

func (v Song) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Song) UnmarshalEasyJSON

func (v *Song) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Song) UnmarshalJSON

func (v *Song) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type SongDetail

type SongDetail struct {
	ReleaseDate string `json:"releaseDate"` // Realease date of song format: DD-MM-YYYY
	Text        string `json:"text"`        // Lyrics
	Link        string `json:"link"`        // Link to song
}

SongDetail contains song details. @Description Additional song data.

func (SongDetail) MarshalEasyJSON

func (v SongDetail) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SongDetail) MarshalJSON

func (v SongDetail) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SongDetail) UnmarshalEasyJSON

func (v *SongDetail) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SongDetail) UnmarshalJSON

func (v *SongDetail) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type SongTitle

type SongTitle struct {
	Group string `json:"group"` // Name of the band
	Song  string `json:"song"`  // Song title
}

SongTitle contains song band and title. @Description Song band and title.

func (SongTitle) MarshalEasyJSON

func (v SongTitle) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SongTitle) MarshalJSON

func (v SongTitle) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SongTitle) UnmarshalEasyJSON

func (v *SongTitle) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SongTitle) UnmarshalJSON

func (v *SongTitle) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

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