query

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateImageInfoParams

type CreateImageInfoParams struct {
	OwnerToken string       `json:"owner_token"`
	Name       string       `json:"name"`
	Digest     string       `json:"digest"`
	Created    int64        `json:"created"`
	Size       int64        `json:"size"`
	Labels     pgtype.JSONB `json:"labels"`
}

type CreateUserParams

type CreateUserParams struct {
	LoginName    string `json:"login_name"`
	PasswordHash string `json:"password_hash"`
	PublicKey    []byte `json:"public_key"`
}

type CreateUserRow added in v0.0.13

type CreateUserRow struct {
	LoginName string `json:"login_name"`
	PublicKey []byte `json:"public_key"`
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type GetImageInfoParams

type GetImageInfoParams struct {
	OwnerToken string `json:"owner_token"`
	Name       string `json:"name"`
}

type ImageInfo

type ImageInfo struct {
	ID         int64        `json:"id"`
	OwnerToken string       `json:"owner_token"`
	Name       string       `json:"name"`
	Digest     string       `json:"digest"`
	Created    int64        `json:"created"`
	Size       int64        `json:"size"`
	Labels     pgtype.JSONB `json:"labels"`
}

type Querier added in v0.0.10

type Querier interface {
	CreateImageInfo(ctx context.Context, arg CreateImageInfoParams) (ImageInfo, error)
	CreateUser(ctx context.Context, arg CreateUserParams) (CreateUserRow, error)
	DeleteUser(ctx context.Context, id int64) error
	GetImageInfo(ctx context.Context, arg GetImageInfoParams) (ImageInfo, error)
	GetUser(ctx context.Context, loginName string) (User, error)
	ListImageByOwner(ctx context.Context, ownerToken string) ([]ImageInfo, error)
	ListUsers(ctx context.Context) ([]User, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateImageInfo

func (q *Queries) CreateImageInfo(ctx context.Context, arg CreateImageInfoParams) (ImageInfo, error)

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (CreateUserRow, error)

func (*Queries) DeleteUser added in v0.0.10

func (q *Queries) DeleteUser(ctx context.Context, id int64) error

func (*Queries) GetImageInfo

func (q *Queries) GetImageInfo(ctx context.Context, arg GetImageInfoParams) (ImageInfo, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, loginName string) (User, error)

func (*Queries) ListImageByOwner

func (q *Queries) ListImageByOwner(ctx context.Context, ownerToken string) ([]ImageInfo, error)

func (*Queries) ListUsers

func (q *Queries) ListUsers(ctx context.Context) ([]User, error)

func (*Queries) WithTx

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

type User

type User struct {
	ID           int64  `json:"id"`
	PublicKey    []byte `json:"public_key"`
	LoginName    string `json:"login_name"`
	PasswordHash string `json:"password_hash"`
}

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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