Documentation ¶
Index ¶
- func AuthClient() (*authorization.AuthorizationV1Client, error)
- func Client(scheme *runtime.Scheme) (client.Client, error)
- func CreateOrPatchObject(obj, original, parent runtime.Object, cli client.Client, ...) error
- func FileExists(path string) bool
- func GetGitCli(cfg *cicdv1.IntegrationConfig, cli client.Client) (git.Client, error)
- func Namespace() (string, error)
- func ParseApproversList(str string) ([]string, error)
- func ParseEmailFromUsers(users []string) []string
- func RandomString(length int) string
- func RespondError(w http.ResponseWriter, code int, msg string) error
- func RespondJSON(w http.ResponseWriter, data interface{}) error
- type ErrorResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthClient ¶
func AuthClient() (*authorization.AuthorizationV1Client, error)
AuthClient is a K8s client for Authorization
func CreateOrPatchObject ¶ added in v0.1.4
func CreateOrPatchObject(obj, original, parent runtime.Object, cli client.Client, scheme *runtime.Scheme) error
CreateOrPatchObject patches the object if it exists, and creates one if not
func ParseApproversList ¶
ParseApproversList parses user/email from line-separated and comma-separated approvers list
func ParseEmailFromUsers ¶
ParseEmailFromUsers parses email from approvers list
func RandomString ¶
RandomString generate random string with lower case alphabets and digits
func RespondError ¶
func RespondError(w http.ResponseWriter, code int, msg string) error
RespondError responds to a HTTP request with body of ErrorResponse
func RespondJSON ¶
func RespondJSON(w http.ResponseWriter, data interface{}) error
RespondJSON responds with arbitrary data objects
Types ¶
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message"`
}
ErrorResponse is a common struct for responding error for HTTP requests
Click to show internal directories.
Click to hide internal directories.