Documentation ¶
Index ¶
- Variables
- func AccountIsAdmin(emails []types.GitHubEmail) bool
- func AddRepoGitHubPrefix(repos []string) (reposModified []string)
- func EncodeObject(obj interface{}) (data []byte, err error)
- func GetAdminEmailDomain() string
- func GetAppEnvFile() (output string)
- func GetAppPort() (output string)
- func GetBaseHost() (host string)
- func GetEmailDomainFromEmail(email string) string
- func GetEnvOrDefault(envName string, defaultValue string) (output string)
- func GetGitHubAdminOrgs() []string
- func GetInstanceContainerRegistryMirrors() []string
- func GetNonAdminInstanceMaxAmount() int
- func GetPacketProjectID() (id string)
- func GetTargetNamespace() (namespace string)
- func JSONResponse(r *http.Request, w http.ResponseWriter, code int, ...)
- func Logging(next http.Handler) http.Handler
- func ObjectToUnstructured(obj interface{}) (unstr *unstructured.Unstructured, err error)
- func RandomSequence(n int) string
- func ReturnValueOrDefault(first string, second string) string
- func ReverseStringArray(input []string) []string
- func ValidateName(input string) bool
Constants ¶
This section is empty.
Variables ¶
var ( AppBuildVersion = "0.0.0" AppBuildHash = "???" AppBuildDate = "???" AppBuildMode = "development" )
misc vars
Functions ¶
func AccountIsAdmin ¶
func AccountIsAdmin(emails []types.GitHubEmail) bool
AccountIsAdmin ... determine if account is an admin
func AddRepoGitHubPrefix ¶
AddRepoGitHubPrefix ... add a HTTPS GitHub prefix to a repo link if it's not a valid URL
func EncodeObject ¶
EncodeObject ... encode any object as JSON, returning as bytes
func GetAdminEmailDomain ¶
func GetAdminEmailDomain() string
GetAdminEmailDomain ... returns the admin email domain of accounts
func GetAppEnvFile ¶
func GetAppEnvFile() (output string)
GetAppEnvFile ... returns the location of an env file to load
func GetBaseHost ¶
func GetBaseHost() (host string)
GetBaseHost ... returns the host where the frontend will be served
func GetEmailDomainFromEmail ¶
GetEmailDomainFromEmail ... extract the domain from an email address
func GetEnvOrDefault ¶
GetEnvOrDefault ... returns env value or default to value
func GetGitHubAdminOrgs ¶
func GetGitHubAdminOrgs() []string
GetGitHubAdminOrgs ... returns the GitHub admin orgs
func GetInstanceContainerRegistryMirrors ¶
func GetInstanceContainerRegistryMirrors() []string
GetInstanceContainerRegistryMirrors ... returns the url to a mirror container registry
func GetNonAdminInstanceMaxAmount ¶
func GetNonAdminInstanceMaxAmount() int
GetNonAdminInstanceMaxAmount ... returns the max number of instances for non-admins
func GetPacketProjectID ¶
func GetPacketProjectID() (id string)
GetPacketProjectID ... returns the project ID to create instances in
func GetTargetNamespace ¶
func GetTargetNamespace() (namespace string)
GetTargetNamespace ... returns the namespace to write Kubernetes objects to
func JSONResponse ¶
func JSONResponse(r *http.Request, w http.ResponseWriter, code int, output types.JSONMessageResponse)
JSONResponse .... generic JSON response handler
func ObjectToUnstructured ¶
func ObjectToUnstructured(obj interface{}) (unstr *unstructured.Unstructured, err error)
ObjectToUnstructured ... convert an object into an unstructured Kubernetes resource
func RandomSequence ¶
RandomSequence ... generate random string from a set of characters
func ReturnValueOrDefault ¶
ReturnValueOrDefault ... returns first string is not empty, otherwise returns second
func ReverseStringArray ¶
ReverseStringArray ... reverse the array order
Types ¶
This section is empty.