database

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 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 ListOption

type ListOption func(*ListOptions)

func ExcludeRuntimes

func ExcludeRuntimes(runtimes []v1alpha1.Runtime) ListOption

func InCluster

func InCluster(cluster string) ListOption

func WithOutDeletedRuntimes

func WithOutDeletedRuntimes() ListOption

func WithOutProductInfo

func WithOutProductInfo() ListOption

type ListOptions

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

func (*ListOptions) IsExcludeRuntime

func (o *ListOptions) IsExcludeRuntime(runtime v1alpha1.Runtime) bool

func (*ListOptions) IsRequestCluster

func (o *ListOptions) IsRequestCluster(clusterName string) bool

func (*ListOptions) MatchRequest

func (o *ListOptions) MatchRequest(runtime v1alpha1.Runtime, clusterName string) bool

type NamespaceUsage

type NamespaceUsage map[string][]string

NamespaceUsage store namespaces in each cluster. Format: map[cluster]namespaces

func (NamespaceUsage) GetNamespacesInCluster

func (nu NamespaceUsage) GetNamespacesInCluster(name string) []string

type NewDatabase added in v0.4.1

type NewDatabase func(ctx context.Context, k8sClient client.Client, productName string, nautesNamespace string) (Snapshot, error)

type RuntimeDataBase

type RuntimeDataBase struct {
	Clusters           map[string]v1alpha1.Cluster
	CodeRepoProviders  map[string]v1alpha1.CodeRepoProvider
	CodeRepos          map[string]v1alpha1.CodeRepo
	DeploymentRuntimes map[string]v1alpha1.DeploymentRuntime
	Environments       map[string]v1alpha1.Environment
	PipelineRuntimes   map[string]v1alpha1.ProjectPipelineRuntime
	Product            *v1alpha1.Product
	ProductCodeRepo    *v1alpha1.CodeRepo
	PermissionMatrix   permissionMatrix
	Projects           map[string]v1alpha1.Project
	// contains filtered or unexported fields
}

func (*RuntimeDataBase) GetCluster

func (db *RuntimeDataBase) GetCluster(name string) (*v1alpha1.Cluster, error)

func (*RuntimeDataBase) GetClusterByRuntime

func (db *RuntimeDataBase) GetClusterByRuntime(runtime v1alpha1.Runtime) (*v1alpha1.Cluster, error)

func (*RuntimeDataBase) GetCodeRepo

func (db *RuntimeDataBase) GetCodeRepo(name string) (*v1alpha1.CodeRepo, error)

func (*RuntimeDataBase) GetCodeRepoByURL

func (db *RuntimeDataBase) GetCodeRepoByURL(codeRepoURL string) (*v1alpha1.CodeRepo, error)

func (*RuntimeDataBase) GetCodeRepoProvider

func (db *RuntimeDataBase) GetCodeRepoProvider(name string) (*v1alpha1.CodeRepoProvider, error)

func (*RuntimeDataBase) GetCodeRepoURL

func (db *RuntimeDataBase) GetCodeRepoURL(name string) (string, error)

func (*RuntimeDataBase) GetProduct

func (db *RuntimeDataBase) GetProduct(name string) (*v1alpha1.Product, error)

func (*RuntimeDataBase) GetProductCodeRepo

func (db *RuntimeDataBase) GetProductCodeRepo(name string) (*v1alpha1.CodeRepo, error)

func (*RuntimeDataBase) GetRuntime

func (db *RuntimeDataBase) GetRuntime(name string, runtimeType v1alpha1.RuntimeType) (v1alpha1.Runtime, error)

func (*RuntimeDataBase) ListPipelineRuntimes

func (db *RuntimeDataBase) ListPipelineRuntimes() ([]v1alpha1.ProjectPipelineRuntime, error)

func (*RuntimeDataBase) ListRuntimes

func (db *RuntimeDataBase) ListRuntimes() []v1alpha1.Runtime

func (*RuntimeDataBase) ListUsedCodeRepos

func (db *RuntimeDataBase) ListUsedCodeRepos(opts ...ListOption) ([]v1alpha1.CodeRepo, error)

func (*RuntimeDataBase) ListUsedNamespaces

func (db *RuntimeDataBase) ListUsedNamespaces(opts ...ListOption) (NamespaceUsage, error)

type Snapshot added in v0.4.2

type Snapshot interface {
	GetProduct(name string) (*v1alpha1.Product, error)
	GetProductCodeRepo(name string) (*v1alpha1.CodeRepo, error)
	GetCodeRepoProvider(name string) (*v1alpha1.CodeRepoProvider, error)
	GetCodeRepo(name string) (*v1alpha1.CodeRepo, error)
	GetCodeRepoByURL(url string) (*v1alpha1.CodeRepo, error)
	GetCluster(name string) (*v1alpha1.Cluster, error)
	GetClusterByRuntime(runtime v1alpha1.Runtime) (*v1alpha1.Cluster, error)
	ListPipelineRuntimes() ([]v1alpha1.ProjectPipelineRuntime, error)
	GetRuntime(name string, runtimeType v1alpha1.RuntimeType) (v1alpha1.Runtime, error)
	// ListUsedNamespces should return all namespaces used by product
	ListUsedNamespaces(opts ...ListOption) (NamespaceUsage, error)
	ListUsedCodeRepos(opts ...ListOption) ([]v1alpha1.CodeRepo, error)
}

Snapshot store all product resouces in kubernetes.

func NewRuntimeSnapshot added in v0.4.2

func NewRuntimeSnapshot(ctx context.Context, k8sClient client.Client, productName string, nautesNamespace string) (Snapshot, error)

Jump to

Keyboard shortcuts

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