ondeck

package
v1.17.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type City

type City struct {
	Slug string `json:"slug"`
	Name string `json:"name"`
}

type CreateCityParams

type CreateCityParams struct {
	Name string `json:"name"`
	Slug string `json:"slug"`
}

type CreateVenueParams

type CreateVenueParams struct {
	Slug            string         `json:"slug"`
	Name            string         `json:"name"`
	City            string         `json:"city"`
	SpotifyPlaylist string         `json:"spotify_playlist"`
	Status          VenuesStatus   `json:"status"`
	Statuses        sql.NullString `json:"statuses"`
	Tags            sql.NullString `json:"tags"`
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type DeleteVenueParams

type DeleteVenueParams struct {
	Slug   string `json:"slug"`
	Slug_2 string `json:"slug_2"`
}

type GetVenueParams

type GetVenueParams struct {
	Slug string `json:"slug"`
	City string `json:"city"`
}

type NullVenuesStatus added in v1.15.0

type NullVenuesStatus struct {
	VenuesStatus VenuesStatus
	Valid        bool // Valid is true if VenuesStatus is not NULL
}

func (*NullVenuesStatus) Scan added in v1.15.0

func (ns *NullVenuesStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullVenuesStatus) Value added in v1.15.0

func (ns NullVenuesStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Querier

type Querier interface {
	CreateCity(ctx context.Context, arg CreateCityParams) error
	CreateVenue(ctx context.Context, arg CreateVenueParams) (sql.Result, error)
	DeleteVenue(ctx context.Context, arg DeleteVenueParams) error
	GetCity(ctx context.Context, slug string) (City, error)
	GetVenue(ctx context.Context, arg GetVenueParams) (Venue, error)
	ListCities(ctx context.Context) ([]City, error)
	ListVenues(ctx context.Context, city string) ([]Venue, error)
	UpdateCityName(ctx context.Context, arg UpdateCityNameParams) error
	UpdateVenueName(ctx context.Context, arg UpdateVenueNameParams) error
	VenueCountByCity(ctx context.Context) ([]VenueCountByCityRow, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func Prepare

func Prepare(ctx context.Context, db DBTX) (*Queries, error)

func (*Queries) Close

func (q *Queries) Close() error

func (*Queries) CreateCity

func (q *Queries) CreateCity(ctx context.Context, arg CreateCityParams) error

func (*Queries) CreateVenue

func (q *Queries) CreateVenue(ctx context.Context, arg CreateVenueParams) (sql.Result, error)

func (*Queries) DeleteVenue

func (q *Queries) DeleteVenue(ctx context.Context, arg DeleteVenueParams) error

func (*Queries) GetCity

func (q *Queries) GetCity(ctx context.Context, slug string) (City, error)

func (*Queries) GetVenue

func (q *Queries) GetVenue(ctx context.Context, arg GetVenueParams) (Venue, error)

func (*Queries) ListCities

func (q *Queries) ListCities(ctx context.Context) ([]City, error)

func (*Queries) ListVenues

func (q *Queries) ListVenues(ctx context.Context, city string) ([]Venue, error)

func (*Queries) UpdateCityName

func (q *Queries) UpdateCityName(ctx context.Context, arg UpdateCityNameParams) error

func (*Queries) UpdateVenueName

func (q *Queries) UpdateVenueName(ctx context.Context, arg UpdateVenueNameParams) error

func (*Queries) VenueCountByCity

func (q *Queries) VenueCountByCity(ctx context.Context) ([]VenueCountByCityRow, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type UpdateCityNameParams

type UpdateCityNameParams struct {
	Name string `json:"name"`
	Slug string `json:"slug"`
}

type UpdateVenueNameParams

type UpdateVenueNameParams struct {
	Name string `json:"name"`
	Slug string `json:"slug"`
}

type Venue

type Venue struct {
	ID int64 `json:"id"`
	// Venues can be either open or closed
	Status   VenuesStatus   `json:"status"`
	Statuses sql.NullString `json:"statuses"`
	// This value appears in public URLs
	Slug            string         `json:"slug"`
	Name            string         `json:"name"`
	City            string         `json:"city"`
	SpotifyPlaylist string         `json:"spotify_playlist"`
	SongkickID      sql.NullString `json:"songkick_id"`
	Tags            sql.NullString `json:"tags"`
	CreatedAt       time.Time      `json:"created_at"`
}

Venues are places where muisc happens

type VenueCountByCityRow

type VenueCountByCityRow struct {
	City  string `json:"city"`
	Count int64  `json:"count"`
}

type VenuesStatus

type VenuesStatus string
const (
	VenuesStatusOpen   VenuesStatus = "open"
	VenuesStatusClosed VenuesStatus = "closed"
)

func (*VenuesStatus) Scan

func (e *VenuesStatus) Scan(src interface{}) error

Jump to

Keyboard shortcuts

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