rest

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: Apache-2.0 Imports: 76 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OPERATION_CREATE = iota
	OPERATION_UPDATE
	OPERATION_DELETE
)
View Source
const (
	K8sKindReplicationController = "ReplicationController"

	K8sKindStatefulSet = "StatefulSet"
)
View Source
const (
	FedRoleAny         = "*"
	FedRoleMasterJoint = "~"
)
View Source
const DefaultLDAPServerPort uint16 = 389
View Source
const MaxFilelds int = 8
View Source
const MaxPerDomainLoginUsers int = 32

Variables

This section is empty.

Functions

func AdmissionRestServer

func AdmissionRestServer(port uint, clientAuth, debug bool)

func CleanupSessCfgCache

func CleanupSessCfgCache()

func CrdDelAll

func CrdDelAll(k8sKind, kvCrdKind, lockKey string, recordList map[string]*share.CLUSCrdSecurityRule) []string

func CrdQueueProc

func CrdQueueProc()

The process thread do it periodically every 10s First it will dequeue first crd event name. Second it will use the name to find the crd content Third it will call process. if failed a crd delete will issued to remove from k8s

func CrdValidateRestServer

func CrdValidateRestServer(port uint, clientAuth, debug bool)

func CreatePredefaultSensor

func CreatePredefaultSensor()

lock is alreay hold when call this function clusHelper.AcquireLock(share.CLUSLockPolicyKey, clusterLockWait)

func CrossCheckCrd

func CrossCheckCrd(kind, rscType, kvCrdKind, lockKey string, kvOnly bool) error

kvOnly: true means the checking is triggered by kv change(ex: import). false means the check is triggered by k8s(ex: startup)

func FedPollingClient

func FedPollingClient(leader, purgeFedRulesOnJoint bool)

func HandleAdminUserUpdate

func HandleAdminUserUpdate()

func InitContext

func InitContext(ctx *Context)

InitContext() must be called before StartRESTServer(), StartFedRestServer or AdmissionRestServer()

func KickLoginSessions

func KickLoginSessions(kickInfo *share.CLUSKickLoginSessionsRequest)

for one controller to call other controllers' grpc service, which calls this function, to kick login sessions

func KickLoginSessionsForRoleChange

func KickLoginSessionsForRoleChange(name, domain string)

func LeadChangeNotify

func LeadChangeNotify(leader bool)

func LoadInitCfg

func LoadInitCfg(load bool)

func NewLongPollManyMgr

func NewLongPollManyMgr(timeout, linger time.Duration, max int) *longpollManyMgr

func NewLongPollOnceMgr

func NewLongPollOnceMgr(timeout, linger time.Duration, max int) *longpollOnceMgr

func ResetLoginTokenTimer

func ResetLoginTokenTimer(tokenInfo *share.CLUSLoginTokenInfo)

for one controller to call other controllers' grpc service, which calls this function, to reset a login session

func StartFedRestServer

func StartFedRestServer(fedPingInterval uint32)

func StartRESTServer

func StartRESTServer()

func StartStopFedPingPoll

func StartStopFedPingPoll(cmd, interval uint32, param1 interface{}) error

func StopFedRestServer

func StopFedRestServer()

func ValidProcessProfilePath

func ValidProcessProfilePath(path string) (string, bool)

Types

type ContainerImage

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

type Context

type Context struct {
	LocalDev     *common.LocalDevice
	EvQueue      cluster.ObjectQueueInterface
	AuditQueue   cluster.ObjectQueueInterface
	Messenger    cluster.MessengerInterface
	Cacher       cache.CacheInterface
	Scanner      scan.ScanInterface
	FedPort      uint
	RESTPort     uint
	PwdValidUnit uint
}

type RoleRquired

type RoleRquired int

type SignalFunc

type SignalFunc func()

type WebhookServer

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

Jump to

Keyboard shortcuts

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