database

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessListElement added in v1.0.2

type AccessListElement struct {
	AccessLevel kubeClientModel.AccessLevel
	ToUserID    string
	GroupID     *string
}

type AccessWithLabel

type AccessWithLabel struct {
	model.Permission `pg:",override"`

	Label string `sql:"label"`
}

type DB

type DB interface {
	UserAccesses(ctx context.Context, userID string) ([]AccessWithLabel, error)
	SetUserAccesses(ctx context.Context, userID string, level kubeClientModel.AccessLevel) error
	SetNamespaceAccess(ctx context.Context, ns model.Namespace, accessLevel kubeClientModel.AccessLevel, toUserID string) error
	SetNamespaceAccesses(ctx context.Context, ns model.Namespace, accessList []AccessListElement) error
	SetNamespacesAccesses(ctx context.Context, namespaces []model.Namespace, accessList []AccessListElement) error
	DeleteNamespaceAccess(ctx context.Context, ns model.Namespace, userID string) error

	NamespaceByName(ctx context.Context, userID, name string, isAdmin bool) (ret model.NamespaceWithPermissions, err error)
	NamespacePermissions(ctx context.Context, ns *model.NamespaceWithPermissions) error
	UserNamespaces(ctx context.Context, userID string, filter NamespaceFilter) (ret []model.NamespaceWithPermissions, err error)
	AllNamespaces(ctx context.Context, filter NamespaceFilter) (ret []model.Namespace, err error)
	CreateNamespace(ctx context.Context, namespace *model.Namespace) error
	RenameNamespace(ctx context.Context, namespace *model.Namespace, newLabel string) error
	ResizeNamespace(ctx context.Context, namespace model.Namespace) error
	DeleteNamespace(ctx context.Context, namespace *model.Namespace) error
	DeleteAllUserNamespaces(ctx context.Context, userID string) (deleted []model.Namespace, err error)
	DeleteGroupFromNamespace(ctx context.Context, namespace, groupID string) (deletedPerms []model.Permission, err error)
	GroupNamespaces(ctx context.Context, groupID string) (ret []model.NamespaceWithPermissions, err error)

	CreateProject(ctx context.Context, project *model.Project) error
	ProjectByID(ctx context.Context, project string) (model.Project, error)
	DeleteGroupFromProject(ctx context.Context, projectID, groupID string) (deletedPerms []model.Permission, err error)

	Transactional(fn func(tx DB) error) error

	io.Closer
}

type NamespaceFilter

type NamespaceFilter struct {
	orm.Pager
	NotDeleted bool `filter:"not_deleted"`
	Deleted    bool `filter:"deleted"`
	NotLimited bool `filter:"not_limited"`
	Limited    bool `filter:"limited"`
	Owned      bool `filter:"owner"`
	NotOwned   bool `filter:"not_owner"`
}

func ParseNamespaceFilter

func ParseNamespaceFilter(filters ...string) NamespaceFilter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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