Documentation ¶
Index ¶
- Constants
- func AsyncCloudTask(wg *sync.WaitGroup, errChannel chan error, tk Task)
- func Convert(body []byte, content interface{}) error
- func IsConfigMapChanged(expect Config, cm *corev1.ConfigMap) bool
- func IsSuccessfulStatusCode(statusCode int) bool
- func LicenseCheckOnExternalNetwork(license cloudv1.License, secret corev1.Secret, url string, logger logr.Logger) (map[string]interface{}, bool)
- func LicenseCheckOnInternalNetwork(license cloudv1.License) (map[string]interface{}, bool)
- func NotificationPackageToNotification(pack NotificationPackage) ntf.Notification
- func NotificationResponseToNotification(resp NotificationResponse) ntf.Notification
- type ClusterInfo
- type ClusterResource
- type CollectorInfo
- type Config
- type ConvertOptions
- type DailyClusterUsage
- type Date
- type HTTPBody
- type HTTPResponse
- type Label
- type License
- type LicenseMonitorRequest
- type LicenseMonitorResponse
- type Message
- type NotificationManager
- type NotificationPackage
- type NotificationRequest
- type NotificationResponse
- type NotificationTask
- type PolicyAction
- type Resource
- type Set
- type Source
- type StringSet
- type SyncRequest
- type SyncResponse
- type Target
- type Task
- type Title
- type TotalNodesResource
- type TypeInfo
- type UserCategory
- type Users
Constants ¶
View Source
const ( ContentType = "Content-Type" ContentTypePlain = "text/plain" ContentTypeHTML = "text/html" ContentTypeJSON = "application/json" )
View Source
const ( SEALOS Source = "Sealos Cloud" ErrorLicenseTitle Title = "License Activation Failed" InvalidLicenseTitle Title = "Invalid License" UnKnownErrorOfLicense Title = "UnKnown error about license" ValidLicenseTitle Title = "License Activated" RechargeFailedTitle Title = "Recharge failed" DuplicateLicenseTitle Title = "Duplicate License" RegistrationSuccessTitle Title = "Registration Success" InvalidLicenseContent Message = "The provided license is invalid. Please check and try." ErrorLicenseTitleContent Message = "License delivery encountered an unexpected error. Please ensure your cluster is operating normally..." UnKnownErrorOfLicenseCotentent Message = "" /* 144-byte string literal not displayed */ LicenseTimeOutContent Message = "The provided license has expired. Please check and try." ValidLicenseContent Message = "Your license has been successfully activated and is ready to use. Enjoy your experience!" DuplicateLicenseContent Message = "The provided license has already been used. Please use a different license." RegistrationSuccessContent Message = "Congratulations! You have successfully registered. Welcome aboard!" RechargeFailedContent Message = "Your license failed to recharge." )
View Source
const ( TRUE = "true" FALSE = "false" )
View Source
const ( UserPrefix string = "ns-" AdmPrefix string = "adm-" )
View Source
const BaseCount = 1000000
View Source
const MaxSizeThresholdStr = "800Ki"
View Source
const Memory = "memory"
View Source
const (
NetWorkEnv string = "CAN_CONNECT_TO_EXTERNAL_NETWORK"
)
Variables ¶
This section is empty.
Functions ¶
func IsSuccessfulStatusCode ¶
func NotificationPackageToNotification ¶
func NotificationPackageToNotification(pack NotificationPackage) ntf.Notification
func NotificationResponseToNotification ¶
func NotificationResponseToNotification(resp NotificationResponse) ntf.Notification
Types ¶
type ClusterInfo ¶
type ClusterResource ¶
type ClusterResource struct { Nodes string `json:"nodes"` CPU string `json:"cpu"` GPU string `json:"gpu"` Memory string `json:"memery"` Disk string `json:"disk"` }
func NewClusterResource ¶
func NewClusterResource() ClusterResource
type CollectorInfo ¶
type CollectorInfo struct { UID string `json:"uid"` InfoType TypeInfo `json:"infoType"` DailyUsage DailyClusterUsage `json:"dailyUsage,omitempty"` ClusterResource ClusterResource `json:"clusterResource,omitempty"` }
type ConvertOptions ¶
type ConvertOptions interface {
// contains filtered or unexported methods
}
type DailyClusterUsage ¶
type HTTPResponse ¶
func CommunicateWithCloud ¶
func CommunicateWithCloud(method string, url string, content interface{}) (HTTPResponse, error)
type LicenseMonitorRequest ¶
func NewLicenseMonitorRequest ¶
func NewLicenseMonitorRequest(secret corev1.Secret, license cloudv1.License) LicenseMonitorRequest
type LicenseMonitorResponse ¶
type LicenseMonitorResponse struct {
Key string `json:"key"`
}
type NotificationManager ¶
type NotificationManager struct {
TimeLastPull int64
}
func NewNotificationManager ¶
func NewNotificationManager() *NotificationManager
func (*NotificationManager) InitTime ¶
func (nm *NotificationManager) InitTime()
type NotificationPackage ¶
func NewNotificationPackage ¶
func NewNotificationPackage(title Title, from Source, message Message) NotificationPackage
type NotificationRequest ¶
type NotificationResponse ¶
type NotificationTask ¶
type NotificationTask struct { Target string NotificationCache []ntf.Notification // contains filtered or unexported fields }
func NewNotificationTask ¶
func NewNotificationTask(ctx context.Context, client cl.Client, target string, cache []ntf.Notification) NotificationTask
func (*NotificationTask) Run ¶
func (nt *NotificationTask) Run() error
type PolicyAction ¶
type PolicyAction string
type StringSet ¶
type StringSet struct {
// contains filtered or unexported fields
}
func NewStringSet ¶
func NewStringSet() *StringSet
type SyncRequest ¶
type SyncRequest struct {
UID string `json:"uid"`
}
type SyncResponse ¶
type TotalNodesResource ¶
type TotalNodesResource struct { TotalPVCapacity resource.Quantity TotalMemory resource.Quantity TotalCPU resource.Quantity TotalGPU resource.Quantity // contains filtered or unexported fields }
func NewTotalNodesResource ¶
func NewTotalNodesResource(regexpStr string) TotalNodesResource
func (*TotalNodesResource) GetGPUCPUMemoryResource ¶
func (tnr *TotalNodesResource) GetGPUCPUMemoryResource(node *corev1.Node, wg *sync.WaitGroup)
type UserCategory ¶
func (UserCategory) Add ¶
func (uc UserCategory) Add(prefix string, nsName string)
func (*UserCategory) GetNameSpace ¶
Click to show internal directories.
Click to hide internal directories.