database

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddDomainParams

type AddDomainParams struct {
	Domain string `json:"domain"`
	Active bool   `json:"active"`
}

type AddRedirectParams

type AddRedirectParams struct {
	Source      string       `json:"source"`
	Destination string       `json:"destination"`
	Description string       `json:"description"`
	Flags       target.Flags `json:"flags"`
	Code        int64        `json:"code"`
	Active      bool         `json:"active"`
}

type AddRouteParams

type AddRouteParams struct {
	Source      string       `json:"source"`
	Destination string       `json:"destination"`
	Description string       `json:"description"`
	Flags       target.Flags `json:"flags"`
	Active      bool         `json:"active"`
}

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 Domain

type Domain struct {
	ID     int64  `json:"id"`
	Domain string `json:"domain"`
	Active bool   `json:"active"`
}

type Favicon

type Favicon struct {
	ID   int64          `json:"id"`
	Host string         `json:"host"`
	Svg  sql.NullString `json:"svg"`
	Png  sql.NullString `json:"png"`
	Ico  sql.NullString `json:"ico"`
}

type GetActiveRedirectsRow

type GetActiveRedirectsRow struct {
	Source      string       `json:"source"`
	Destination string       `json:"destination"`
	Flags       target.Flags `json:"flags"`
	Code        int64        `json:"code"`
}

type GetActiveRoutesRow

type GetActiveRoutesRow struct {
	Source      string       `json:"source"`
	Destination string       `json:"destination"`
	Flags       target.Flags `json:"flags"`
}

type GetAllRedirectsRow

type GetAllRedirectsRow struct {
	Source      string       `json:"source"`
	Destination string       `json:"destination"`
	Description string       `json:"description"`
	Flags       target.Flags `json:"flags"`
	Code        int64        `json:"code"`
	Active      bool         `json:"active"`
}

type GetAllRoutesRow

type GetAllRoutesRow struct {
	Source      string       `json:"source"`
	Destination string       `json:"destination"`
	Description string       `json:"description"`
	Flags       target.Flags `json:"flags"`
	Active      bool         `json:"active"`
}

type GetFaviconsRow

type GetFaviconsRow struct {
	Host string         `json:"host"`
	Svg  sql.NullString `json:"svg"`
	Png  sql.NullString `json:"png"`
	Ico  sql.NullString `json:"ico"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddDomain

func (q *Queries) AddDomain(ctx context.Context, arg AddDomainParams) error

func (*Queries) AddRedirect

func (q *Queries) AddRedirect(ctx context.Context, arg AddRedirectParams) error

func (*Queries) AddRoute

func (q *Queries) AddRoute(ctx context.Context, arg AddRouteParams) error

func (*Queries) DeleteDomain

func (q *Queries) DeleteDomain(ctx context.Context, domain string) error

func (*Queries) GetActiveDomains

func (q *Queries) GetActiveDomains(ctx context.Context) ([]string, error)

func (*Queries) GetActiveRedirects

func (q *Queries) GetActiveRedirects(ctx context.Context) ([]GetActiveRedirectsRow, error)

func (*Queries) GetActiveRoutes

func (q *Queries) GetActiveRoutes(ctx context.Context) ([]GetActiveRoutesRow, error)

func (*Queries) GetAllRedirects

func (q *Queries) GetAllRedirects(ctx context.Context) ([]GetAllRedirectsRow, error)

func (*Queries) GetAllRoutes

func (q *Queries) GetAllRoutes(ctx context.Context) ([]GetAllRoutesRow, error)

func (*Queries) GetFavicons

func (q *Queries) GetFavicons(ctx context.Context) ([]GetFaviconsRow, error)

func (*Queries) RemoveRedirect

func (q *Queries) RemoveRedirect(ctx context.Context, source string) error

func (*Queries) RemoveRoute

func (q *Queries) RemoveRoute(ctx context.Context, source string) error

func (*Queries) UpdateFaviconCache

func (q *Queries) UpdateFaviconCache(ctx context.Context, arg UpdateFaviconCacheParams) error

func (*Queries) WithTx

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

type Redirect

type Redirect struct {
	ID          int64        `json:"id"`
	Source      string       `json:"source"`
	Destination string       `json:"destination"`
	Description string       `json:"description"`
	Flags       target.Flags `json:"flags"`
	Code        int64        `json:"code"`
	Active      bool         `json:"active"`
}

type Route

type Route struct {
	ID          int64        `json:"id"`
	Source      string       `json:"source"`
	Destination string       `json:"destination"`
	Description string       `json:"description"`
	Flags       target.Flags `json:"flags"`
	Active      bool         `json:"active"`
}

type UpdateFaviconCacheParams

type UpdateFaviconCacheParams struct {
	Host string         `json:"host"`
	Svg  sql.NullString `json:"svg"`
	Png  sql.NullString `json:"png"`
	Ico  sql.NullString `json:"ico"`
}

Jump to

Keyboard shortcuts

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