dao

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidToken is returned when token is invalid
	ErrInvalidToken = errors.New("invalid token")
	// ErrUsedToken is returned when token has been registered
	ErrUsedToken = errors.New("used token")
)

Functions

func CreateCluster

func CreateCluster(ctx context.Context, tx bun.IDB, cluster *models.Cluster) error

func CreateOperatorBootstrap

func CreateOperatorBootstrap(ctx context.Context, db bun.Tx, bootstrap *models.ClusterOperatorBootstrap) error

func CreateProjectCluster

func CreateProjectCluster(ctx context.Context, db bun.IDB, pc *models.ProjectCluster) error

func CreateToken

func CreateToken(ctx context.Context, db bun.IDB, token *models.ClusterToken) error

CreateToken creates a token for given cluster name

func DeleteCluster

func DeleteCluster(ctx context.Context, db bun.IDB, c *models.Cluster) error

func DeleteProjectsForCluster

func DeleteProjectsForCluster(ctx context.Context, db bun.IDB, clusterID uuid.UUID) error

func GetCluster

func GetCluster(ctx context.Context, db bun.IDB, cluster *models.Cluster) (*models.Cluster, error)

func GetClusterForToken

func GetClusterForToken(ctx context.Context, db bun.IDB, token string) (cluster *models.Cluster, err error)

func GetOperatorBootstrap

func GetOperatorBootstrap(ctx context.Context, db bun.IDB, clusterid string) (*models.ClusterOperatorBootstrap, error)

func GetProjectsForCluster

func GetProjectsForCluster(ctx context.Context, db bun.IDB, clusterID uuid.UUID) ([]models.ProjectCluster, error)

func ListClusters

func ListClusters(ctx context.Context, db bun.IDB, qo commonv3.QueryOptions) (clusters []models.Cluster, err error)

func Notify

func Notify(db *bun.DB, chanName string, value string) error

func RegisterToken

func RegisterToken(ctx context.Context, db bun.IDB, token string) (*models.ClusterToken, error)

registerToken registers the cluster token

func UpdateCluster

func UpdateCluster(ctx context.Context, db bun.IDB, c *models.Cluster) error

func UpdateClusterAnnotations

func UpdateClusterAnnotations(ctx context.Context, db bun.IDB, c *models.Cluster) error

func ValidateClusterAccess

func ValidateClusterAccess(ctx context.Context, db bun.IDB, opts commonv3.QueryOptions) (bool, error)

Check if the project in scope is owner of the cluster

Types

This section is empty.

Jump to

Keyboard shortcuts

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