models

package
v0.0.0-...-ab8551a Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cinema

type Cinema struct {
	Name        string   `json:"name" db:"name"`
	Address     string   `json:"address" db:"address"`
	Coordinates GeoPoint `json:"coordinates" db:"coordinates"`
	ID          int32    `json:"id" db:"id"`
}

type City

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

type CityScreening

type CityScreening struct {
	ScreeningType string    `json:"screening_type" db:"screening_type"`
	TicketPrice   string    `json:"ticket_price" db:"ticket_price"`
	StartTime     time.Time `json:"start_time" db:"start_time"`
	ScreeningID   int64     `json:"id" db:"id"`
	HallID        int32     `json:"hall_id" db:"hall_id"`
	CinemaID      int32     `json:"cinema_id" db:"cinema_id"`
}

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 GeoPoint

type GeoPoint struct {
	Latityde, Longitude float64
}

func (*GeoPoint) Scan

func (p *GeoPoint) Scan(v any) error

func (GeoPoint) Value

func (p GeoPoint) Value() (driver.Value, error)

type Hall

type Hall struct {
	Type string `db:"hall_type" json:"hall_type"`
	Name string `db:"name" json:"name"`
	Size uint32 `db:"size" json:"size"`
	ID   int32  `db:"id" json:"id"`
}

type MoviesScreenings

type MoviesScreenings struct {
	ScreeningsTypes []string `json:"screenings_types" db:"screenings_types"`
	HallsTypes      []string `json:"halls_types" db:"halls_types"`
	MovieID         int32    `json:"movie_id" db:"movie_id"`
}

type Place

type Place struct {
	Row      int32   `json:"row" db:"row"`
	Seat     int32   `json:"seat" db:"seat"`
	GridPosX float32 `json:"grid_pos_x" db:"grid_pos_x"`
	GridPosY float32 `json:"grid_pos_y" db:"grid_pos_y"`
}

type Screening

type Screening struct {
	ScreeningID   int64     `json:"id" db:"id"`
	ScreeningType string    `json:"screening_type" db:"screening_type"`
	TicketPrice   string    `json:"ticket_price" db:"ticket_price"`
	StartTime     time.Time `json:"start_time" db:"start_time"`
	HallID        int32     `json:"hall_id" db:"hall_id"`
	MovieID       int32     `json:"movie_id" db:"movie_id"`
	CinemaID      int32     `json:"cinema_id" db:"cinema_id"`
}

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