db

package module
v0.0.0-...-fcff28b Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionStatusEnum

type ActionStatusEnum string
const (
	ActionStatusEnumPending   ActionStatusEnum = "pending"
	ActionStatusEnumSucceeded ActionStatusEnum = "succeeded"
	ActionStatusEnumFailed    ActionStatusEnum = "failed"
)

func (*ActionStatusEnum) Scan

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

type ActionTypeEnum

type ActionTypeEnum string
const (
	ActionTypeEnumBind   ActionTypeEnum = "bind"
	ActionTypeEnumCreate ActionTypeEnum = "create"
	ActionTypeEnumDelete ActionTypeEnum = "delete"
	ActionTypeEnumMove   ActionTypeEnum = "move"
	ActionTypeEnumSwapX  ActionTypeEnum = "swap_x"
	ActionTypeEnumSwapY  ActionTypeEnum = "swap_y"
)

func (*ActionTypeEnum) Scan

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

type CreateActionParams

type CreateActionParams struct {
	ID                  uuid.UUID
	ActionType          ActionTypeEnum
	ActionStatus        ActionStatusEnum
	ActionEndTime       *time.Time
	ActionReason        pgtype.Text
	PodParentName       pgtype.Text
	PodParentType       pgtype.Text
	PodParentUid        *uuid.UUID
	CreatedPodName      pgtype.Text
	CreatedPodNamespace pgtype.Text
	CreatedNodeName     pgtype.Text
	DeletedPodName      pgtype.Text
	DeletedPodNamespace pgtype.Text
	DeletedNodeName     pgtype.Text
	BoundPodName        pgtype.Text
	BoundPodNamespace   pgtype.Text
	BoundNodeName       pgtype.Text
}

type CreateActionStartTimeParams

type CreateActionStartTimeParams struct {
	ID                  uuid.UUID
	ActionType          ActionTypeEnum
	ActionStatus        ActionStatusEnum
	ActionStartTime     *time.Time
	ActionEndTime       *time.Time
	ActionReason        pgtype.Text
	PodParentName       pgtype.Text
	PodParentType       pgtype.Text
	PodParentUid        *uuid.UUID
	CreatedPodName      pgtype.Text
	CreatedPodNamespace pgtype.Text
	CreatedNodeName     pgtype.Text
	DeletedPodName      pgtype.Text
	DeletedPodNamespace pgtype.Text
	DeletedNodeName     pgtype.Text
	BoundPodName        pgtype.Text
	BoundPodNamespace   pgtype.Text
	BoundNodeName       pgtype.Text
}

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 ListActionsByTypeAndStatusParams

type ListActionsByTypeAndStatusParams struct {
	ActionType   ActionTypeEnum
	ActionStatus ActionStatusEnum
}

type NullActionStatusEnum

type NullActionStatusEnum struct {
	ActionStatusEnum ActionStatusEnum
	Valid            bool // Valid is true if ActionStatusEnum is not NULL
}

func (*NullActionStatusEnum) Scan

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

Scan implements the Scanner interface.

func (NullActionStatusEnum) Value

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

Value implements the driver Valuer interface.

type NullActionTypeEnum

type NullActionTypeEnum struct {
	ActionTypeEnum ActionTypeEnum
	Valid          bool // Valid is true if ActionTypeEnum is not NULL
}

func (*NullActionTypeEnum) Scan

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

Scan implements the Scanner interface.

func (NullActionTypeEnum) Value

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

Value implements the driver Valuer interface.

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateAction

func (q *Queries) CreateAction(ctx context.Context, arg CreateActionParams) (WorkloadAction, error)

func (*Queries) CreateActionStartTime

func (q *Queries) CreateActionStartTime(ctx context.Context, arg CreateActionStartTimeParams) (WorkloadAction, error)

func (*Queries) DeleteAction

func (q *Queries) DeleteAction(ctx context.Context, id uuid.UUID) error

func (*Queries) GetAction

func (q *Queries) GetAction(ctx context.Context, id uuid.UUID) (WorkloadAction, error)

func (*Queries) ListActions

func (q *Queries) ListActions(ctx context.Context) ([]WorkloadAction, error)

func (*Queries) ListActionsByTypeAndStatus

func (q *Queries) ListActionsByTypeAndStatus(ctx context.Context, arg ListActionsByTypeAndStatusParams) ([]WorkloadAction, error)

func (*Queries) UpdateAction

func (q *Queries) UpdateAction(ctx context.Context, arg UpdateActionParams) (WorkloadAction, error)

func (*Queries) WithTx

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

type UpdateActionParams

type UpdateActionParams struct {
	ID                  uuid.UUID
	ActionType          ActionTypeEnum
	ActionStatus        ActionStatusEnum
	ActionEndTime       *time.Time
	ActionReason        pgtype.Text
	PodParentName       pgtype.Text
	PodParentType       pgtype.Text
	PodParentUid        *uuid.UUID
	CreatedPodName      pgtype.Text
	CreatedPodNamespace pgtype.Text
	CreatedNodeName     pgtype.Text
	DeletedPodName      pgtype.Text
	DeletedPodNamespace pgtype.Text
	DeletedNodeName     pgtype.Text
	BoundPodName        pgtype.Text
	BoundPodNamespace   pgtype.Text
	BoundNodeName       pgtype.Text
}

type WorkloadAction

type WorkloadAction struct {
	ID                  uuid.UUID
	ActionType          ActionTypeEnum
	ActionStatus        ActionStatusEnum
	ActionStartTime     *time.Time
	ActionEndTime       *time.Time
	ActionReason        pgtype.Text
	PodParentName       pgtype.Text
	PodParentType       pgtype.Text
	PodParentUid        *uuid.UUID
	CreatedPodName      pgtype.Text
	CreatedPodNamespace pgtype.Text
	CreatedNodeName     pgtype.Text
	DeletedPodName      pgtype.Text
	DeletedPodNamespace pgtype.Text
	DeletedNodeName     pgtype.Text
	BoundPodName        pgtype.Text
	BoundPodNamespace   pgtype.Text
	BoundNodeName       pgtype.Text
	CreatedAt           pgtype.Timestamp
	UpdatedAt           pgtype.Timestamp
}

Jump to

Keyboard shortcuts

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