Documentation ¶
Index ¶
- func CheckAllowlist(r *library.Repo, allowlist []string) bool
- func EscapeValue(value string) string
- func FormParameter(c *gin.Context, parameter string) string
- func HandleError(c *gin.Context, status int, err error)
- func MaxInt(a, b int) int
- func MinInt(a, b int) int
- func PathParameter(c *gin.Context, parameter string) string
- func QueryParameter(c *gin.Context, parameter, value string) string
- func SplitFullName(value string) (string, string)
- func Unique(stringSlice []string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAllowlist ¶ added in v0.20.0
CheckAllowlist is a helper function to ensure only repos in the allowlist are specified.
a single entry of '*' allows any repo to be enabled.
func EscapeValue ¶ added in v0.14.0
EscapeValue safely escapes any string by removing any new lines and HTML escaping it.
func FormParameter ¶ added in v0.14.0
FormParameter safely captures a form parameter from the context by removing any new lines and HTML escaping the value.
func HandleError ¶
HandleError appends the error to the handler chain for logging and outputs it.
func MaxInt ¶
MaxInt is a helper function to clamp the integer which prevents it from being higher then the provided value.
Currently, Go only supports float64 via math. ( max | min ).
func MinInt ¶
MinInt is a helper function to clamp the integer which prevents it from being lower then the provided value.
Currently, Go only supports float64 via math. ( max | min ).
func PathParameter ¶ added in v0.14.0
PathParameter safely captures a path parameter from the context by removing any new lines and HTML escaping the value.
func QueryParameter ¶ added in v0.14.0
QueryParameter safely captures a query parameter from the context by removing any new lines and HTML escaping the value.
func SplitFullName ¶ added in v0.20.0
SplitFullName safely splits the repo.FullName field into an org and name.
Types ¶
This section is empty.