service

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IDLE = "IDLE"
View Source
var RUNNING = "RUNNING"

Functions

func CreateNamespaceINE

func CreateNamespaceINE(client *clientgo.GoClient, ns string) error

func CreateOrUpdateClusterRoleBindingINE

func CreateOrUpdateClusterRoleBindingINE(client *clientgo.GoClient, saName, saNs, crb, role string) error

func CreateOrUpdateRoleBindingINE

func CreateOrUpdateRoleBindingINE(client *clientgo.GoClient, ns, saName, saNs, rb, role string) error

nocalhost use nocalhost-saName for role binding storage container and nocalhost create a role binding for each dev space

func CreateUsers

func CreateUsers(ctx context.Context, list []*model.UserBaseModel) int

func CronJobTrigger

func CronJobTrigger()

func Init

func Init()

func RemoveClusterRoleBindingIfPresent

func RemoveClusterRoleBindingIfPresent(client *clientgo.GoClient, saName, saNs, crb string) error

func RemoveRoleBindingIfPresent

func RemoveRoleBindingIfPresent(client *clientgo.GoClient, ns, saName, saNs, rb string) error

func StartJob

func StartJob()

func ToMailMapping

func ToMailMapping(es []*ldap.Entry, emailAttr string) map[string]*ldap.Entry

Types

type Report

type Report struct {
	Entries int
	Inserts int
	Updates int
	Deletes int
	Fails   int
	Costs   int64
}

func DoSyncFromLDAP

func DoSyncFromLDAP(ctx context.Context, ldapServer string, tls, md5 bool, ldapGen uint64, username, password string,
	baseDN, filter,
	adminBaseDn, adminFilter,
	emailAttr, userNameAttr string) (*Report, error)

func (*Report) ActivateSync

func (r *Report) ActivateSync(deletes, inserts, updates int)

We generally only care about valid updates, so if these three are 0, then the last valid update data is taken

func (*Report) Sum

func (r *Report) Sum(r1 *Report)

type Service

type Service struct {
	UserSvc               *user.User
	ClusterSvc            *cluster.Cluster
	ApplicationSvc        *application.Application
	ApplicationClusterSvc *application_cluster.ApplicationCluster
	ClusterUserSvc        *cluster_user.ClusterUser
	PrePullSvc            *pre_pull.PrePull
	ApplicationUserSvc    *application_user.ApplicationUser
	LdapSvc               *ldap.Ldap
}

Service struct

var (
	// Svc global service var
	Svc *Service
)

func New

func New() (s *Service)

New init service

func (*Service) AuthorizeClusterToUser

func (s *Service) AuthorizeClusterToUser(clusterId, userId uint64) error

func (*Service) AuthorizeNsToDefaultSa

func (s *Service) AuthorizeNsToDefaultSa(clusterId, userId uint64, ns string) error

func (*Service) AuthorizeNsToUser

func (s *Service) AuthorizeNsToUser(clusterId, userId uint64, ns string) error

func (*Service) Close

func (s *Service) Close()

Close service

func (*Service) Ping

func (s *Service) Ping() error

Ping service

func (*Service) PrepareServiceAccountAndClientGo

func (s *Service) PrepareServiceAccountAndClientGo(clusterId, userId uint64) (
	clientGo *clientgo.GoClient, saName string, err error,
)

func (*Service) UnAuthorizeClusterToUser

func (s *Service) UnAuthorizeClusterToUser(clusterId, userId uint64) error

func (*Service) UnAuthorizeNsToUser

func (s *Service) UnAuthorizeNsToUser(clusterId, userId uint64, ns string) error

Directories

Path Synopsis
cooperator

Jump to

Keyboard shortcuts

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