test

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterRow

type ClusterRow struct {
	ID            string `db:"id" orm:"op=get key=primary filter=In"`
	Version       uint64 `db:"version" orm:"op_lock=true filter=Gte,Lte,Eq"`
	CreatedAt     int64  `db:"created_at"`
	LastUpdatedAt int64  `db:"last_updated_at" orm:"op=update"`
	DeletedAt     int64  `db:"deleted_at" orm:"soft_delete=true"`

	Name             string `db:"name" orm:"op=get filter=In"`
	ClusterManagerID string `db:"cluster_manager_id" orm:"key=primary filter=In"`
	State            string `db:"state" orm:"op=update filter=In,NotIn"`
	Message          string `db:"message" orm:"op=update"`
}

type ClusterTable

type ClusterTable struct {
	simplesql.Database
	// contains filtered or unexported fields
}

func NewClusterTable

func NewClusterTable(db simplesql.Database) *ClusterTable

func (*ClusterTable) Delete

func (s *ClusterTable) Delete(ctx context.Context, execer sqlx.ExecerContext, updateKey ClusterTableUpdateKey) error

func (*ClusterTable) Get

func (*ClusterTable) Insert

func (s *ClusterTable) Insert(ctx context.Context, execer sqlx.ExecerContext, row ClusterRow) error

func (*ClusterTable) List

func (*ClusterTable) Update

func (s *ClusterTable) Update(
	ctx context.Context, execer sqlx.ExecerContext, updateKey ClusterTableUpdateKey, updateFields ClusterTableUpdateFields,
) error

type ClusterTableGetKeys

type ClusterTableGetKeys struct {
	ID        *string `db:"id"`
	DeletedAt int64   `db:"deleted_at"`
	Name      *string `db:"name"`
}

type ClusterTableSelectFilters

type ClusterTableSelectFilters struct {
	IDIn               []string `db:"id:in"`
	VersionGte         *uint64  `db:"version:gte"`
	VersionLte         *uint64  `db:"version:lte"`
	VersionEq          *uint64  `db:"version:eq"`
	DeletedAtEq        *int64   `db:"deleted_at:eq"`
	DeletedAtGte       *int64   `db:"deleted_at:gte"`
	NameIn             []string `db:"name:in"`
	ClusterManagerIDIn []string `db:"cluster_manager_id:in"`
	StateIn            []string `db:"state:in"`
	StateNotIn         []string `db:"state:not_in"`
	Limit              uint32   `db:"limit"`
}

type ClusterTableUpdateFields

type ClusterTableUpdateFields struct {
	LastUpdatedAt *int64  `db:"last_updated_at"`
	DeletedAt     *int64  `db:"deleted_at"`
	State         *string `db:"state"`
	Message       *string `db:"message"`
}

type ClusterTableUpdateKey

type ClusterTableUpdateKey struct {
	ID               string `db:"id"`
	Version          uint64 `db:"version"`
	DeletedAt        int64  `db:"deleted_at"`
	ClusterManagerID string `db:"cluster_manager_id"`
}

type NodeRow added in v0.0.4

type NodeRow struct {
	ID   string `db:"id" orm:"op=get key=primary filter=In"`
	Name string `db:"name" orm:"op=update filter=In"`
}

type NodeTable added in v0.0.4

type NodeTable struct {
	simplesql.Database
	// contains filtered or unexported fields
}

func NewNodeTable added in v0.0.4

func NewNodeTable(db simplesql.Database) *NodeTable

func (*NodeTable) Delete added in v0.0.4

func (s *NodeTable) Delete(ctx context.Context, execer sqlx.ExecerContext, updateKey NodeTableUpdateKey) error

func (*NodeTable) Get added in v0.0.4

func (s *NodeTable) Get(ctx context.Context, keys NodeTableGetKeys) (NodeRow, error)

func (*NodeTable) Insert added in v0.0.4

func (s *NodeTable) Insert(ctx context.Context, execer sqlx.ExecerContext, row NodeRow) error

func (*NodeTable) List added in v0.0.4

func (s *NodeTable) List(ctx context.Context, filters NodeTableSelectFilters) ([]NodeRow, error)

func (*NodeTable) Update added in v0.0.4

func (s *NodeTable) Update(
	ctx context.Context, execer sqlx.ExecerContext, updateKey NodeTableUpdateKey, updateFields NodeTableUpdateFields,
) error

type NodeTableGetKeys added in v0.0.4

type NodeTableGetKeys struct {
	ID *string `db:"id"`
}

type NodeTableSelectFilters added in v0.0.4

type NodeTableSelectFilters struct {
	IDIn   []string `db:"id:in"`
	NameIn []string `db:"name:in"`
	Limit  uint32   `db:"limit"`
}

type NodeTableUpdateFields added in v0.0.4

type NodeTableUpdateFields struct {
	Name *string `db:"name"`
}

type NodeTableUpdateKey added in v0.0.4

type NodeTableUpdateKey struct {
	ID string `db:"id"`
}

Jump to

Keyboard shortcuts

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