dao

package
v0.3.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: Apache-2.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 AdapterStatusDao

type AdapterStatusDao interface {
	Get(ctx context.Context, id string) (*api.AdapterStatus, error)
	Create(ctx context.Context, adapterStatus *api.AdapterStatus) (*api.AdapterStatus, error)
	Upsert(ctx context.Context, adapterStatus *api.AdapterStatus, existing *api.AdapterStatus) (*api.AdapterStatus, error)
	Delete(ctx context.Context, id string) error
	DeleteByResource(ctx context.Context, resourceType, resourceID string) error
	FindByResource(ctx context.Context, resourceType, resourceID string) (api.AdapterStatusList, error)
	FindByResourceIDs(ctx context.Context, resourceType string, resourceIDs []string) (api.AdapterStatusList, error)
	FindByResourcePaginated(
		ctx context.Context, resourceType, resourceID string, offset, limit int,
	) (api.AdapterStatusList, int64, error)
	FindByResourceAndAdapter(
		ctx context.Context, resourceType, resourceID, adapter string,
	) (*api.AdapterStatus, error)
	All(ctx context.Context) (api.AdapterStatusList, error)
}

func NewAdapterStatusDao

func NewAdapterStatusDao(sessionFactory db.SessionFactory) AdapterStatusDao

type ClusterDao

type ClusterDao interface {
	Get(ctx context.Context, id string) (*api.Cluster, error)
	GetForUpdate(ctx context.Context, id string) (*api.Cluster, error)
	Create(ctx context.Context, cluster *api.Cluster) (*api.Cluster, error)
	Save(ctx context.Context, cluster *api.Cluster) error
	SaveStatusConditions(ctx context.Context, id string, statusConditions []byte) error
	Delete(ctx context.Context, id string) error
	FindByIDs(ctx context.Context, ids []string) (api.ClusterList, error)
	All(ctx context.Context) (api.ClusterList, error)
}

func NewClusterDao

func NewClusterDao(sessionFactory db.SessionFactory) ClusterDao

type GenericDao

type GenericDao interface {
	Fetch(offset int, limit int, resourceList interface{}) error

	GetInstanceDao(ctx context.Context, model interface{}) GenericDao
	Preload(preload string)
	OrderBy(orderBy string)
	Joins(sql string)
	Group(sql string)
	Where(where Where)
	Count(model interface{}, total *int64)
	Validate(resourceList interface{}) error

	GetTableName() string
	GetTableRelation(fieldName string) (TableRelation, bool)
}

func NewGenericDao

func NewGenericDao(sessionFactory db.SessionFactory) GenericDao

type NodePoolDao

type NodePoolDao interface {
	Get(ctx context.Context, id string) (*api.NodePool, error)
	GetByIDAndOwner(ctx context.Context, id string, ownerID string) (*api.NodePool, error)
	GetForUpdate(ctx context.Context, id string) (*api.NodePool, error)
	Create(ctx context.Context, nodePool *api.NodePool) (*api.NodePool, error)
	Save(ctx context.Context, nodePool *api.NodePool) error
	SaveStatusConditions(ctx context.Context, id string, statusConditions []byte) error
	Delete(ctx context.Context, id string) error
	FindByIDs(ctx context.Context, ids []string) (api.NodePoolList, error)
	FindByOwner(ctx context.Context, ownerID string) (api.NodePoolList, error)
	SaveAll(ctx context.Context, nodePools api.NodePoolList) error
	ExistsByOwner(ctx context.Context, ownerID string) (bool, error)
	All(ctx context.Context) (api.NodePoolList, error)
}

func NewNodePoolDao

func NewNodePoolDao(sessionFactory db.SessionFactory) NodePoolDao

type ResourceDao added in v0.3.0

type ResourceDao interface {
	Get(ctx context.Context, kind, id string) (*api.Resource, error)
	GetForUpdate(ctx context.Context, kind, id string) (*api.Resource, error)
	GetByOwner(ctx context.Context, kind, id, ownerID string) (*api.Resource, error)
	Create(ctx context.Context, resource *api.Resource) (*api.Resource, error)
	Save(ctx context.Context, resource *api.Resource) error
	Delete(ctx context.Context, kind, id string) error
	ExistsByOwner(ctx context.Context, kind, ownerID string) (bool, error)
	FindByKind(ctx context.Context, kind string) (api.ResourceList, error)
	FindByKindAndOwner(ctx context.Context, kind, ownerID string) (api.ResourceList, error)
	FindByIDs(ctx context.Context, kind string, ids []string) (api.ResourceList, error)
}

func NewResourceDao added in v0.3.0

func NewResourceDao(sessionFactory db.SessionFactory) ResourceDao

type TableRelation

type TableRelation struct {
	TableName         string
	ColumnName        string
	ForeignTableName  string
	ForeignColumnName string
}

TableRelation represents a relationship between two tables. They can be joined, ON TableName.ColumnName = ForeignTableName.ForeignColumnName

type Where

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

func NewWhere

func NewWhere(sql string, values []any) Where

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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