Documentation ¶
Index ¶
- Constants
- Variables
- func GetTranslator() *ut.Translator
- func LoadKubeConfig()
- func RegisterDNSRegexRFC1123Validator(v *validator.Validate, trans *ut.Translator)
- func RegisterIsDefaultIfNotPrivateValidator(v *validator.Validate, trans *ut.Translator)
- func RegisterRequiredWithTranslator(v *validator.Validate, trans *ut.Translator)
- type CommonError
- type ExtendedClientset
Constants ¶
View Source
const ( SwarmPoolBadRequestErrorCode = "400001" IdentityBadRequestErrorCode = "400002" SwarmPoolNotFoundErrorCode = "404001" IdentityNotFoundErrorCode = "404002" PeerNotFoundErrorCode = "404003" SwarmPoolBadBodyErrorCode = "422001" SwarmPoolAlreadyExistErrorCode = "422002" IdentityBadBodyErrorCode = "422003" IdentityAlreadyExistErrorCode = "422004" )
View Source
const DNSRegexStringRFC1123 = "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
Variables ¶
View Source
var DNSRegexRFC1123 = regexp.MustCompile(DNSRegexStringRFC1123)
Functions ¶
func GetTranslator ¶
func GetTranslator() *ut.Translator
func LoadKubeConfig ¶
func LoadKubeConfig()
func RegisterDNSRegexRFC1123Validator ¶
func RegisterDNSRegexRFC1123Validator(v *validator.Validate, trans *ut.Translator)
func RegisterIsDefaultIfNotPrivateValidator ¶
func RegisterIsDefaultIfNotPrivateValidator(v *validator.Validate, trans *ut.Translator)
func RegisterRequiredWithTranslator ¶
func RegisterRequiredWithTranslator(v *validator.Validate, trans *ut.Translator)
Types ¶
type CommonError ¶
type CommonError struct {
Errors map[string]interface{} `json:"errors"`
}
func NewError ¶
func NewError(key string, err error) CommonError
func NewValidatorError ¶
func NewValidatorError(key string, errs validator.ValidationErrors) CommonError
To handle the error returned by c.Bind in gin framework https://github.com/go-playground/validator/blob/v9/_examples/translations/main.go
type ExtendedClientset ¶
type ExtendedClientset struct { kubernetes.Clientset PeerdiscoveryV1alpha1 *rest.RESTClient }
var KubeClient *ExtendedClientset
func GetKubeClient ¶
func GetKubeClient() *ExtendedClientset
Using this function to get a connection, you can create your connection pool here.
Click to show internal directories.
Click to hide internal directories.