models

package
v0.0.0-...-b15666a Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 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 Country

type Country struct {
	ID   int32  `db:"id"`
	Name string `db:"name"`
}

type ErrorCode

type ErrorCode int32
const (
	Unknown ErrorCode = iota
	Internal
	InvalidArgument
	Unauthenticated
	Conflict
	NotFound
	Canceled
	DeadlineExceeded
	PermissionDenied
)

func Code

func Code(err error) ErrorCode

func (ErrorCode) String

func (t ErrorCode) String() string

type Genre

type Genre struct {
	ID   int32  `db:"id"`
	Name string `db:"name"`
}

type Movie

type Movie struct {
	ID            int32
	TitleRU       string
	TitleEN       string
	Description   string
	Genres        []string
	Duration      int32
	PosterUrl     string
	BackgroundUrl string
	Countries     []string
	ReleaseYear   int32
	AgeRating     string
}

type MoviePreview

type MoviePreview struct {
	ID               int32
	TitleRU          string
	TitleEN          string
	Duration         int32
	PreviewPosterUrl string
	Genres           []string
	ShortDescription string
	Countries        []string
	ReleaseYear      int32
	AgeRating        string
}

type MoviesFilter

type MoviesFilter struct {
	MoviesIDs    string
	GenresIDs    string
	CountriesIDs string
	Title        string
	AgeRating    string
}

type RepositoryMovie

type RepositoryMovie struct {
	ID                  int32    `db:"id"`
	TitleRU             string   `db:"title_ru"`
	TitleEN             string   `db:"title_en"`
	Description         string   `db:"description"`
	Genres              []string `db:"genres"`
	Duration            int32    `db:"duration"`
	PosterID            string   `db:"poster_picture_id"`
	BackgroundPictureID string   `db:"background_picture_id"`
	Countries           []string `db:"countries"`
	ReleaseYear         int32    `db:"release_year"`
	AgeRating           string   `db:"age_rating"`
}

type RepositoryMoviePreview

type RepositoryMoviePreview struct {
	ID               int32    `db:"id"`
	TitleRU          string   `db:"title_ru"`
	TitleEN          string   `db:"title_en"`
	Duration         int32    `db:"duration"`
	PreviewPosterID  string   `db:"preview_poster_picture_id"`
	Genres           []string `db:"genres"`
	ShortDescription string   `db:"short_description"`
	Countries        []string `db:"countries"`
	ReleaseYear      int32    `db:"release_year"`
	AgeRating        string   `db:"age_rating"`
}

type ServiceError

type ServiceError struct {
	Msg  string
	Code ErrorCode
}

func Error

func Error(code ErrorCode, msg string) *ServiceError

func Errorf

func Errorf(code ErrorCode, format string, a ...any) *ServiceError

func (*ServiceError) Error

func (e *ServiceError) Error() string

Jump to

Keyboard shortcuts

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