api

package
v0.0.0-...-abddd1f Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApiServer

func NewApiServer(db *sqlx.DB, log *slog.Logger) *http.Server

func NewRouter

func NewRouter(db *sqlx.DB, log *slog.Logger) *chi.Mux

Types

type Address

type Address struct {
	Line1    string `json:"line1"`
	Line2    string `json:"line2"`
	City     string `json:"city"`
	State    string `json:"state"`
	PostalCd string `json:"zip"`
}

type Area

type Area struct {
	Section string   `json:"section_name"`
	Seats   []string `json:"seats"`
}

type AuthCreateRequest

type AuthCreateRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type BaseHandler

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

func (*BaseHandler) CreateCustomer

func (b *BaseHandler) CreateCustomer(cust Customer) error

func (*BaseHandler) HomeHandler

func (b *BaseHandler) HomeHandler(w http.ResponseWriter, r *http.Request)

type Customer

type Customer struct {
	Name     string  `json:"name"`
	Age      int     `json:"age"`
	Gender   string  `json:"gender"`
	PhoneNum string  `json:"phone_nm"`
	Address  Address `json:"addr"`
	Email    string  `json:"email"`
}

type Show

type Show struct {
	Name        string                 `json:"name"`
	Location    string                 `json:"location"`
	ShowTimes   []string               `json:"show_times"`
	Seats       []string               `json:"seats"`
	Prices      map[string]interface{} `json:"prices"`
	AgeRestrict bool                   `json:"age_restrict"`
}

type Space

type Space struct {
	Name    string `db:"space_nm"`
	Section string `db:"space_section_nm"`
	Seats   []byte `db:"space_section_seats"`
}

type SpaceCreateRequest

type SpaceCreateRequest struct {
	Name  string `json:"name"`
	Areas []Area `json:"areas,omitempty"`
}

Jump to

Keyboard shortcuts

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