ondeck

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 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          Status   `json:"status"`
	Statuses        []Status `json:"statuses"`
	Tags            []string `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 GetVenueParams

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

type Querier

type Querier interface {
	CreateCity(ctx context.Context, arg CreateCityParams) (City, error)
	CreateVenue(ctx context.Context, arg CreateVenueParams) (int32, error)
	DeleteVenue(ctx context.Context, slug string) 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) (int32, 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) (City, error)

Create a new city. The slug must be unique. This is the second line of the comment This is the third line

func (*Queries) CreateVenue

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

func (*Queries) DeleteVenue

func (q *Queries) DeleteVenue(ctx context.Context, slug string) 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) (int32, 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 Status

type Status string

Venues can be either open or closed

const (
	StatusOpen   Status = "op!en"
	StatusClosed Status = "clo@sed"
)

func (*Status) Scan

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

type UpdateCityNameParams

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

type UpdateVenueNameParams

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

type Venue

type Venue struct {
	ID       int32    `json:"id"`
	Status   Status   `json:"status"`
	Statuses []Status `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            []string       `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"`
}

Jump to

Keyboard shortcuts

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