Documentation ¶
Index ¶
- func ArrayStringContains(s []string, e string) bool
- func EncodeVars(vars map[string]string) map[string]string
- func GenerateToken() (string, error)
- func GetImageAndTag(image string) (string, string)
- func GetLocalLLMUrl() (*url.URL, error)
- func MergeMapString(current, overwrite map[string]string) map[string]string
- func MergeYAML(originYaml, overwriteYaml string) (string, error)
- func ReplaceAndLower(s string) string
- func ResponseAPIError(rw http.ResponseWriter, statusCode int, err *apierror.APIError)
- func ResponseBody(obj interface{}) []byte
- func ResponseError(rw http.ResponseWriter, statusCode int, err error)
- func ResponseErrorMsg(rw http.ResponseWriter, statusCode int, errMsg string)
- func ResponseOKWithBody(rw http.ResponseWriter, obj interface{})
- func ResponseOKWithNoContent(rw http.ResponseWriter)
- func ValidateVolumeClaimTemplatesAnnotation(pvcAnno string) error
- type ErrorResponse
- type PVCHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrayStringContains ¶
func GenerateToken ¶
func GetImageAndTag ¶
func GetLocalLLMUrl ¶
func MergeYAML ¶
MergeYAML takes two YAML strings, merges them, and returns the resulting YAML string.
func ReplaceAndLower ¶
ReplaceAndLower replaces underscores and colons with hyphens and converts the string to lowercase.
func ResponseAPIError ¶
func ResponseAPIError(rw http.ResponseWriter, statusCode int, err *apierror.APIError)
func ResponseBody ¶
func ResponseBody(obj interface{}) []byte
func ResponseError ¶
func ResponseError(rw http.ResponseWriter, statusCode int, err error)
func ResponseErrorMsg ¶
func ResponseErrorMsg(rw http.ResponseWriter, statusCode int, errMsg string)
func ResponseOKWithBody ¶
func ResponseOKWithBody(rw http.ResponseWriter, obj interface{})
func ResponseOKWithNoContent ¶
func ResponseOKWithNoContent(rw http.ResponseWriter)
Types ¶
type ErrorResponse ¶
type ErrorResponse struct { Code string `json:"code,omitempty"` Status int `json:"status,omitempty"` Message string `json:"message,omitempty"` Type string `json:"type,omitempty"` FieldName string `json:"fieldName,omitempty"` Error string `json:"error,omitempty"` }
ErrorResponse describe the error response happened during request.
type PVCHandler ¶
type PVCHandler struct {
// contains filtered or unexported fields
}
func NewPVCHandler ¶
func NewPVCHandler(pvcs ctlcorev1.PersistentVolumeClaimClient, pvcCache ctlcorev1.PersistentVolumeClaimCache) *PVCHandler
func (*PVCHandler) CreatePVCByVolume ¶
func (h *PVCHandler) CreatePVCByVolume(pvcs []mlv1.Volume, namespace string, ownerRefs []metav1.OwnerReference) error
func (*PVCHandler) CreatePVCFromAnnotation ¶
func (h *PVCHandler) CreatePVCFromAnnotation(pvcTemplates, namespace string, ownerRefs []metav1.OwnerReference) error
CreatePVCFromAnnotation helps to create PVCs from the annotation
Click to show internal directories.
Click to hide internal directories.