k8s

package
v0.0.0-...-4a9ec43 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCannotParseMap        = errors.New("can not parse map to struct")
	ErrUserNotAllowed        = errors.New("user is not allowed")
	ErrCannotFindUser        = errors.New("can not find user")
	ErrInvalidResourceFormat = errors.New("invalid resource format, should be started with one of svc/,deployment/,pod/ ")
)

Functions

This section is empty.

Types

type Repo

type Repo interface {
	UpdateUser(ctx context.Context, u *models.User) (*models.User, error)
	GetUserByEmail(ctx context.Context, email string) (*models.User, error)
	UserIsAllowed(ctx context.Context, email string) (bool, error)
}

type Usecase

type Usecase interface {
	// K8s ralated methods
	CreateNamespace(name string) (*corev1.Namespace, error)
	GetNamepace(name string) (*corev1.Namespace, error)
	CreateServiceAccount(namespace, name string) (*corev1.ServiceAccount, error)
	CreateNamespaceAdminRole(namespace string) (*rbacv1.Role, error)
	CreateRoleBinding(sa *corev1.ServiceAccount, role *rbacv1.Role) (*rbacv1.RoleBinding, error)
	GetServiceAccount(namespace, name string) (*corev1.ServiceAccount, error)
	GetSecret(namespace, name string) (*corev1.Secret, error)

	// Mjolnir related methods
	BuildKubeConfig(u *models.User) *models.KubeConfig
	GeneratePortForward(pfc *models.PortForwardRequest) (*models.PortForward, error)
}

Directories

Path Synopsis
delivery
* This file is currently archirved and not able to run, will be back in development for etcd integration in the future
* This file is currently archirved and not able to run, will be back in development for etcd integration in the future

Jump to

Keyboard shortcuts

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