Documentation ¶
Index ¶
- Constants
- Variables
- func CookieRead(req *restful.Request, name string) string
- func CookieRemoveValue(resp *restful.Response, name string)
- func CookieWriteValue(resp *restful.Response, name, value string)
- func Cors(wsContainer *restful.Container)
- func CreateNamespace(namespace string) error
- func DESDecrypt(data string, key []byte) string
- func DESEncrypt(origData, key []byte) string
- func GetK8sClient() *kubernetes.Clientset
- func MD5(data string) string
- func MapToString(labels map[string]string) string
- func NewUUID() string
- func NotEmptyAll(str ...string) bool
- func ResponseAuthError(response *restful.Response)
- func ResponseError(response *restful.Response, err error)
- func ResponseErrorAndCodeMessage(response *restful.Response, code int32, err error, message string)
- func ResponseErrorAndMessage(response *restful.Response, err error, message string)
- func ResponseSuccess(response *restful.Response, data interface{})
- func ResponseSystemError(response *restful.Response, err error)
- func SealyunCreateSecretsForMap(operatorType OperatorType, name string, data, labels map[string]string) error
- func SealyunDeleteSecrets(operatorType OperatorType, name string) error
- func SealyunGetAdminSecretString(key string) string
- func SealyunGetSecretMap(operatorType OperatorType, name string) map[string]string
- func SealyunGetSecretString(operatorType OperatorType, name, key string) string
- func SealyunListSecrets(operatorType OperatorType, labels map[string]string) []map[string]string
- func SealyunUpdateSecretsForMap(operatorType OperatorType, name string, data, labels map[string]string) error
- func SealyunUpdateSecretsForString(operatorType OperatorType, name, key, value string, labels map[string]string) error
- type OperatorType
Constants ¶
const ( DefaultNamespace = "sealyun" DefaultAdminSecretName = "fist-admin" UserOperator OperatorType = 1 + iota UserSecretPrefix = "fist-users-" )
consts
const (
ErrMessageSystem = "system error"
)
const is global const
Variables ¶
var ( ErrUserNameEmpty = errors.New("the username is empty") ErrPasswordEmpty = errors.New("the password is empty") ErrValidateUserPassword = errors.New("the username and password is mismatching") ErrServiceAccountEmpty = errors.New("the serviceAccount token is empty") ErrServiceAccountNotExists = errors.New("the serviceAccount token is not exists") ErrParamTidEmpty = errors.New("the param tid is empty") ErrUserAuth = errors.New("user auth failed ") ErrUserAdd = errors.New("user add failed ") ErrUserUpdate = errors.New("user update failed ") ErrUserDel = errors.New("user del failed ") ErrUserGet = errors.New("user get failed ") ErrK8sClientInitFailed = errors.New("kubernetes client init failed") //validate ErrUserName = errors.New("user name is error ") ErrUserNotExists = errors.New("user not exists ") ErrUserExists = errors.New("user is exists ") // ErrUserNotLogin = errors.New("user not login ") //ldap ErrLdapUserNotExists = errors.New("ldap user not exists ") )
vars is global var
Functions ¶
func CookieRead ¶ added in v0.0.1
CookieRead is read value from cookie
func CookieRemoveValue ¶ added in v0.0.1
func CookieRemoveValue(resp *restful.Response, name string)
CookieRemoveValue is remove cookies of name value
func CookieWriteValue ¶ added in v0.0.1
func CookieWriteValue(resp *restful.Response, name, value string)
CookieWriteValue is write cookies of name value
func CreateNamespace ¶
CreateNamespace create namespace
func DESDecrypt ¶ added in v0.0.1
DESDecrypt is des decrypt
func DESEncrypt ¶ added in v0.0.1
DESEncrypt is des encrypt
func GetK8sClient ¶
func GetK8sClient() *kubernetes.Clientset
GetK8sClient get a kubernetes in cluster clientset
func MapToString ¶
MapToString is used for k8s select string from map convert
func ResponseAuthError ¶ added in v0.0.1
func ResponseAuthError(response *restful.Response)
ResponseAuthError is web response for error of cookie not login
func ResponseError ¶
func ResponseError(response *restful.Response, err error)
ResponseError is web response for error
func ResponseErrorAndCodeMessage ¶
ResponseErrorAndCodeMessage is web response for error
func ResponseErrorAndMessage ¶
ResponseErrorAndMessage is web response for error
func ResponseSuccess ¶
func ResponseSuccess(response *restful.Response, data interface{})
ResponseSuccess is web response for success
func ResponseSystemError ¶
func ResponseSystemError(response *restful.Response, err error)
ResponseSystemError is web response for error
func SealyunCreateSecretsForMap ¶
func SealyunCreateSecretsForMap(operatorType OperatorType, name string, data, labels map[string]string) error
SealyunCreateSecretsForMap is create function for map
func SealyunDeleteSecrets ¶
func SealyunDeleteSecrets(operatorType OperatorType, name string) error
SealyunDeleteSecrets is delete function
func SealyunGetAdminSecretString ¶
SealyunGetAdminSecretString is Sealyun admin module function
func SealyunGetSecretMap ¶
func SealyunGetSecretMap(operatorType OperatorType, name string) map[string]string
SealyunGetSecretMap is Sealyun function get map
func SealyunGetSecretString ¶
func SealyunGetSecretString(operatorType OperatorType, name, key string) string
SealyunGetSecretString is Sealyun function get str
func SealyunListSecrets ¶
func SealyunListSecrets(operatorType OperatorType, labels map[string]string) []map[string]string
SealyunListSecrets is list function
func SealyunUpdateSecretsForMap ¶
func SealyunUpdateSecretsForMap(operatorType OperatorType, name string, data, labels map[string]string) error
SealyunUpdateSecretsForMap is update function for map
func SealyunUpdateSecretsForString ¶
func SealyunUpdateSecretsForString(operatorType OperatorType, name, key, value string, labels map[string]string) error
SealyunUpdateSecretsForString is update function for map