Documentation ¶
Index ¶
- Variables
- func AddOwnerLogin(ctx context.Context, r *model.Resource, client clients.UserManagerClient) error
- func AddUserLogins(ctx context.Context, permissions []model.Permission, ...) error
- func CheckTariff(tariff billing.Tariff, isAdmin bool) error
- func IsAdminRole(ctx context.Context) bool
- func NamespaceAddUsage(ctx context.Context, ns *kubeAPIModel.Namespace, client clients.KubeAPIClient) error
- func OwnerCheck(ctx context.Context, resource model.Resource) error
- type AccessActions
- type Clients
- type NamespaceActions
- type Server
- func (s *Server) AdminCreateNamespace(ctx context.Context, req model.NamespaceAdminCreateRequest) error
- func (s *Server) AdminResizeNamespace(ctx context.Context, id string, req model.NamespaceAdminResizeRequest) error
- func (s *Server) Close() error
- func (s *Server) CreateNamespace(ctx context.Context, req model.NamespaceCreateRequest) error
- func (s *Server) DeleteAllUserNamespaces(ctx context.Context) error
- func (s *Server) DeleteNamespace(ctx context.Context, id string) error
- func (s *Server) DeleteNamespaceAccess(ctx context.Context, id string, targetUser string) error
- func (s *Server) GetAllNamespaces(ctx context.Context, page, perPage int, filters ...string) ([]kubeClientModel.Namespace, error)
- func (s *Server) GetNamespace(ctx context.Context, id string) (kubeClientModel.Namespace, error)
- func (s *Server) GetNamespaceAccess(ctx context.Context, id string) (kubeClientModel.Namespace, error)
- func (s *Server) GetUserAccesses(ctx context.Context) (*authProto.ResourcesAccess, error)
- func (s *Server) GetUserNamespaces(ctx context.Context, filters ...string) ([]kubeClientModel.Namespace, error)
- func (s *Server) RenameNamespace(ctx context.Context, id, newLabel string) error
- func (s *Server) ResizeNamespace(ctx context.Context, id, newTariffID string) error
- func (s *Server) SetNamespaceAccess(ctx context.Context, id, targetUser string, ...) error
- func (s *Server) SetUserAccesses(ctx context.Context, access kubeClientModel.AccessLevel) error
Constants ¶
This section is empty.
Variables ¶
View Source
var StandardNamespaceFilter = database.NamespaceFilter{ NotDeleted: true, }
Functions ¶
func AddOwnerLogin ¶
func AddUserLogins ¶
func AddUserLogins(ctx context.Context, permissions []model.Permission, client clients.UserManagerClient) error
func CheckTariff ¶
CheckTariff checks if user has permissions to use tariff
func IsAdminRole ¶
IsAdminRole checks that request came from user with admin permissions.
func NamespaceAddUsage ¶
func NamespaceAddUsage(ctx context.Context, ns *kubeAPIModel.Namespace, client clients.KubeAPIClient) error
Types ¶
type AccessActions ¶
type AccessActions interface { GetUserAccesses(ctx context.Context) (*authProto.ResourcesAccess, error) SetUserAccesses(ctx context.Context, accessLevel kubeClientModel.AccessLevel) error GetNamespaceAccess(ctx context.Context, id string) (kubeClientModel.Namespace, error) SetNamespaceAccess(ctx context.Context, id, targetUser string, accessLevel kubeClientModel.AccessLevel) error DeleteNamespaceAccess(ctx context.Context, id string, targetUser string) error }
type Clients ¶
type Clients struct { Auth clients.AuthClient User clients.UserManagerClient Kube clients.KubeAPIClient Resource clients.ResourceServiceClient Billing clients.BillingClient }
type NamespaceActions ¶
type NamespaceActions interface { CreateNamespace(ctx context.Context, req model.NamespaceCreateRequest) error GetNamespace(ctx context.Context, id string) (kubeClientModel.Namespace, error) GetUserNamespaces(ctx context.Context, filters ...string) ([]kubeClientModel.Namespace, error) GetAllNamespaces(ctx context.Context, page, perPage int, filters ...string) ([]kubeClientModel.Namespace, error) AdminCreateNamespace(ctx context.Context, req model.NamespaceAdminCreateRequest) error AdminResizeNamespace(ctx context.Context, id string, req model.NamespaceAdminResizeRequest) error RenameNamespace(ctx context.Context, id, newLabel string) error ResizeNamespace(ctx context.Context, id, newTariffID string) error DeleteNamespace(ctx context.Context, id string) error DeleteAllUserNamespaces(ctx context.Context) error }
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) AdminCreateNamespace ¶
func (*Server) AdminResizeNamespace ¶
func (*Server) CreateNamespace ¶
func (*Server) DeleteAllUserNamespaces ¶
func (*Server) DeleteNamespace ¶
func (*Server) DeleteNamespaceAccess ¶
func (*Server) GetAllNamespaces ¶
func (*Server) GetNamespace ¶
func (*Server) GetNamespaceAccess ¶
func (*Server) GetUserAccesses ¶
func (*Server) GetUserNamespaces ¶
func (*Server) RenameNamespace ¶
func (*Server) ResizeNamespace ¶
func (*Server) SetNamespaceAccess ¶
func (s *Server) SetNamespaceAccess(ctx context.Context, id, targetUser string, accessLevel kubeClientModel.AccessLevel) error
func (*Server) SetUserAccesses ¶
func (s *Server) SetUserAccesses(ctx context.Context, access kubeClientModel.AccessLevel) error
Click to show internal directories.
Click to hide internal directories.