query

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 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 {
	LoginName    string       `json:"login_name"`
	Name         string       `json:"name"`
	Digest       string       `json:"digest"`
	Created      int64        `json:"created"`
	Size         int64        `json:"size"`
	Labels       pgtype.JSONB `json:"labels"`
	AptPackages  pgtype.JSONB `json:"apt_packages"`
	PypiCommands pgtype.JSONB `json:"pypi_commands"`
	Services     pgtype.JSONB `json:"services"`
}

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 GetImageInfoByDigestParams added in v0.0.18

type GetImageInfoByDigestParams struct {
	LoginName string `json:"login_name"`
	Digest    string `json:"digest"`
}

type GetImageInfoByNameParams added in v0.0.18

type GetImageInfoByNameParams struct {
	LoginName string `json:"login_name"`
	Name      string `json:"name"`
}

type ImageInfo

type ImageInfo struct {
	ID           int64        `json:"id"`
	Name         string       `json:"name"`
	Digest       string       `json:"digest"`
	Created      int64        `json:"created"`
	Size         int64        `json:"size"`
	Labels       pgtype.JSONB `json:"labels"`
	LoginName    string       `json:"login_name"`
	AptPackages  pgtype.JSONB `json:"apt_packages"`
	PypiCommands pgtype.JSONB `json:"pypi_commands"`
	Services     pgtype.JSONB `json:"services"`
}

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
	GetImageInfoByDigest(ctx context.Context, arg GetImageInfoByDigestParams) (ImageInfo, error)
	GetImageInfoByName(ctx context.Context, arg GetImageInfoByNameParams) (ImageInfo, error)
	GetUser(ctx context.Context, loginName string) (User, error)
	ListImageByOwner(ctx context.Context, loginName 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) GetImageInfoByDigest added in v0.0.18

func (q *Queries) GetImageInfoByDigest(ctx context.Context, arg GetImageInfoByDigestParams) (ImageInfo, error)

func (*Queries) GetImageInfoByName added in v0.0.18

func (q *Queries) GetImageInfoByName(ctx context.Context, arg GetImageInfoByNameParams) (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, loginName 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