Documentation ¶
Index ¶
- Constants
- Variables
- func BytesToHumanReadable(b int64) string
- func CheckInternetAccess() (bool, error)
- func ConfirmTask(s string) bool
- func Contains(s []string, str string) bool
- func ContainsEqual(s []string, str string) bool
- func ContainsInt(v int, a []int) bool
- func ContainsToLowercase(s []string, str string) bool
- func CreateDirIfNotExist(dir string)
- func CurrentPreReleaseVersion() (string, error)
- func CurrentReleaseVersion() (string, error)
- func DeleteCurrentConfig()
- func DeleteDirIfExist(dir string)
- func Diff(a []string, b []string) []string
- func Equals(s []string, str string) bool
- func FatalError(message string)
- func FillWith(s string, targetLength int, chars string) string
- func FunctionName() string
- func GetDefaultKubeConfig() string
- func GetDirectories(customConfigPath string) (configDir string, configPath string)
- func GetRequiredHeader(c *gin.Context, headerField string) string
- func HashString(data string) string
- func HttpHeader(additionalName string) http.Header
- func HttpRespondForWorkloadResult(c *gin.Context, workloadResult K8sWorkloadResult)
- func HumanDuration(d time.Duration) string
- func InitCertificate() cmapi.Certificate
- func InitCertificateSigningRequestYaml() string
- func InitCertificateYaml() string
- func InitClusterIssuerYaml() string
- func InitClusterRoleBindingYaml() string
- func InitClusterRoleYaml() string
- func InitConfigMap() core.ConfigMap
- func InitConfigMapYaml() string
- func InitConfigYaml(showDebug bool, customConfigName string, stage string)
- func InitContainerSecret() core.Secret
- func InitContainerSecretYaml() string
- func InitCronJob() v1job.CronJob
- func InitCronJobYaml() string
- func InitCustomResourceDefinitionYaml() string
- func InitDaemonsetYaml() string
- func InitDeployment() v1.Deployment
- func InitDeploymentYaml() string
- func InitEndPointYaml() string
- func InitHpaYaml() string
- func InitIngresClassYaml() string
- func InitIngresYaml() string
- func InitIngress() netv1.Ingress
- func InitIngressYaml() string
- func InitIssuerYaml() string
- func InitJobYaml() string
- func InitLeaseYaml() string
- func InitNamespaceYaml() string
- func InitNetPolNamespace() netv1.NetworkPolicy
- func InitNetPolNamespaceYaml() string
- func InitNetPolService() netv1.NetworkPolicy
- func InitNetPolServiceYaml() string
- func InitNetPolYaml() string
- func InitOrderYaml() string
- func InitPersistentVolume() core.PersistentVolume
- func InitPersistentVolumeClaim() core.PersistentVolumeClaim
- func InitPersistentVolumeClaimYaml() string
- func InitPersistentVolumeYaml() string
- func InitPodYaml() string
- func InitPriorityClassYaml() string
- func InitPunqIngress() netv1.Ingress
- func InitPunqIngressTraefik() netv1.Ingress
- func InitPunqIngressTraefikMiddlewareYaml() string
- func InitPunqService() core.Service
- func InitReplicaSetYaml() string
- func InitResourceQuotaYaml() string
- func InitRoleBindingYaml() string
- func InitRoleYaml() string
- func InitSecret() core.Secret
- func InitSecretYaml() string
- func InitService() core.Service
- func InitServiceAccountExampleYaml() string
- func InitServiceExampleYaml() string
- func InitServiceYaml() string
- func InitStatefulsetYaml() string
- func InitStorageClassYaml() string
- func InitVolumeAttachmentYaml() string
- func InitVolumeSnapshotYaml() string
- func IsHelmInstalled() (bool, string, error)
- func IsKubectlInstalled() (bool, string, error)
- func IsNewReleaseAvailable() bool
- func IsProduction() bool
- func JsonStringToHumanDuration(jsonTime string) string
- func MalformedMessage(c *gin.Context, msg string)
- func MergeMaps(maps ...map[string]string) map[string]string
- func MissingHeader(c *gin.Context, header string)
- func MissingQueryParameter(c *gin.Context, query string)
- func NanoId() string
- func NanoIdExtraLong() string
- func NanoIdSmallLowerCase() string
- func NotFound(c *gin.Context, msg string)
- func NumberToHumanReadable(b uint64) string
- func OpenBrowser(url string)
- func ParseJsonStringArray(input string) []string
- func Pointer[K any](val K) *K
- func PrintChangeLog()
- func PrintError(message string)
- func PrintInfo(message string)
- func PrintLogo()
- func PrintPrettyPost(c *gin.Context)
- func PrintSettings()
- func PrintVersionInfo()
- func PrintWelcomeMessage()
- func QuickHash(s string) string
- func RandomFirstName() string
- func RandomInt(min int, max int) int
- func RandomLastName() string
- func RandomMiddleName() string
- func Remove[T any](slice []T, s int) []T
- func Round(num float64) int
- func RunOnLocalShell(cmd string) *exec.Cmd
- func SelectIndexInteractive(question string, noOfElements int) int
- func StatusEmoji(works bool) string
- func ToFixed(num float64, precision int) float64
- func TruncateText(s string, max int) string
- func Unauthorized(c *gin.Context, msg string)
- func WriteDefaultConfig(stage string)
- func WriteToTempFile(filename string, data []byte) (string, error)
- type ClusterSecret
- type Config
- type CountryDetails
- type K8sWorkloadResult
- type Release
- type ResponseError
Constants ¶
View Source
const APP_NAME = "k8s"
View Source
const CONFIGVERSION = 2
View Source
const CONTEXTOWN = "own-context"
View Source
const CONTEXTSSECRET = "punq-contexts"
View Source
const JWTSECRET = "punq-jwt"
View Source
const USERADMIN = "admin"
View Source
const USERSSECRET = "punq-users"
Variables ¶
View Source
var ChangeLog string
View Source
var ConfigPath string
View Source
var DefaultConfigFileOperator string
View Source
var DefaultConfigFileProd string
View Source
var DefaultConfigLocalFile string
View Source
var FirstNameList = []string{
"Liam", "Emma", "Noah", "Olivia", "Ava",
"Sophia", "Jackson", "Aiden", "Lucas", "Muhammad",
"Amelia", "Mateo", "Ethan", "Harper", "Evelyn",
"Mia", "Ella", "Riley", "Aria", "Logan",
"Zoe", "Benjamin", "Oliver", "Lily", "Leo",
"Charlotte", "Mason", "Isabella", "Layla", "Isaac",
"Mila", "Sophie", "Elijah", "Emily", "Daniel",
"James", "Aiden", "Abigail", "Levi", "Chloe",
"Henry", "Alexander", "Sebastian", "Jack", "Hannah",
"Jayden", "Gabriel", "Matthew", "Alice", "Oscar",
"Josiah", "Evie", "Theo", "Isla", "Jaxon",
"Grace", "Eva", "Samuel", "Owen", "Victoria",
"Joseph", "Zachary", "Violet", "John", "William",
"Ezra", "Ellie", "Freya", "Dylan", "Penelope",
"Michael", "Scarlett", "Luna", "Max", "Alyssa",
"Isabelle", "Eliza", "Luca", "Thomas", "Poppy",
"David", "Ruby", "Christopher", "Jade", "Rose",
"Sienna", "George", "Harvey", "Kaylee", "Annie",
"Nathan", "Madison", "Jacob", "Noelle", "Parker",
"Sarah", "Evelina", "Leo", "Ruby", "Abigail",
}
View Source
var LastNamesList = []string{
"Smith", "Kim", "Johnson", "Lee", "Brown",
"Patel", "Garcia", "Rodriguez", "Martinez", "Chen",
"Jones", "Nguyen", "Williams", "Lopez", "Gonzalez",
"Perez", "Hernandez", "Tanaka", "Silva", "Santos",
"Cohen", "Kumar", "Wang", "Meyer", "Schneider",
"Taylor", "Anderson", "White", "Young", "Harris",
"Clark", "Lewis", "Turner", "Walker", "Hall",
"Allen", "Roberts", "Wright", "King", "Hill",
"Scott", "Green", "Baker", "Adams", "Nelson",
"Campbell", "Mitchell", "Robinson", "Carter", "Thomas",
"Mueller", "Fernandez", "Oliveira", "Sharma", "Singh",
"Liu", "Lin", "Ali", "Khan", "Jackson",
"Parker", "Phillips", "Davis", "Murphy", "Price",
"Suzuki", "Ross", "Reyes", "Jenkins", "Morris",
"Sanchez", "Perry", "Powell", "Russell", "Moore",
"Ramirez", "Gray", "James", "Watson", "Brooks",
"Kelly", "Sanders", "Foster", "Evans", "Barnes",
}
View Source
var MiddleNamesList = []string{
"Bumblebee", "Rainbow", "Whiz", "Jolly", "Bubbles",
"Sparkle", "Noodle", "Waffle", "Pickle", "Jiggle",
"Twinkle", "Giggle", "Fizzle", "Muffin", "Pumpkin",
"Squiggle", "Tofu", "Jazz", "Fizz", "Sunny",
"Fluffy", "Peanut", "Jellybean", "Snicker", "Ripple",
"Glimmer", "Cupcake", "Pudding", "Tinker", "Pebble",
"Cuddle", "Bumpkin", "Dizzy", "Lolly", "Nugget",
"Twirl", "Fizzypop", "Wiggles", "Snuggles", "Squishy",
"Blinky", "Bubblegum", "Frodo", "Sizzle", "Taco",
"Smiley", "Snickerdoodle", "Wobble", "Popsicle", "Zigzag",
"Sprinkles", "Doodle", "Pizzazz", "Quicksilver", "Razzmatazz",
"Duckling", "Hiccup", "Pumpernickel", "Zoodle", "Quizzical",
"Flitter", "Whisper", "Mustard", "Wacky", "Scooter",
"Moose", "Tizzy", "Bamboo", "Zephyr", "Rolo",
"Sniffle", "Gobble", "Beep", "Cobweb", "Twizzle",
"Bizz", "Fuddle", "Puzzle", "Rumble", "Rover",
"Squabble", "Tumbleweed", "Vroom", "Whizzle", "YoYo",
}
View Source
var WelcomeMessage string
View Source
var YamlTemplatesFolder embed.FS
Functions ¶
func BytesToHumanReadable ¶
func CheckInternetAccess ¶ added in v1.4.4
func ConfirmTask ¶
func ContainsEqual ¶ added in v1.3.2
func ContainsInt ¶
func ContainsToLowercase ¶ added in v1.4.7
func CreateDirIfNotExist ¶
func CreateDirIfNotExist(dir string)
func CurrentPreReleaseVersion ¶ added in v1.4.6
func CurrentReleaseVersion ¶ added in v1.3.3
func DeleteCurrentConfig ¶ added in v1.1.41
func DeleteCurrentConfig()
func DeleteDirIfExist ¶
func DeleteDirIfExist(dir string)
func FatalError ¶ added in v1.3.0
func FatalError(message string)
func FunctionName ¶
func FunctionName() string
func GetDefaultKubeConfig ¶ added in v1.2.40
func GetDefaultKubeConfig() string
func GetDirectories ¶
func GetRequiredHeader ¶ added in v1.2.0
func HashString ¶ added in v1.2.38
func HttpHeader ¶
func HttpRespondForWorkloadResult ¶ added in v1.2.0
func HttpRespondForWorkloadResult(c *gin.Context, workloadResult K8sWorkloadResult)
func HumanDuration ¶
TAKEN FROM Kubernetes apimachineryv0.25.1
func InitCertificate ¶
func InitCertificate() cmapi.Certificate
func InitCertificateSigningRequestYaml ¶
func InitCertificateSigningRequestYaml() string
func InitCertificateYaml ¶
func InitCertificateYaml() string
func InitClusterIssuerYaml ¶
func InitClusterIssuerYaml() string
func InitClusterRoleBindingYaml ¶
func InitClusterRoleBindingYaml() string
func InitClusterRoleYaml ¶
func InitClusterRoleYaml() string
func InitConfigMap ¶
func InitConfigMapYaml ¶
func InitConfigMapYaml() string
func InitConfigYaml ¶
func InitContainerSecret ¶
func InitContainerSecretYaml ¶
func InitContainerSecretYaml() string
func InitCronJob ¶
func InitCronJobYaml ¶
func InitCronJobYaml() string
func InitCustomResourceDefinitionYaml ¶
func InitCustomResourceDefinitionYaml() string
func InitDaemonsetYaml ¶
func InitDaemonsetYaml() string
func InitDeployment ¶
func InitDeployment() v1.Deployment
func InitDeploymentYaml ¶
func InitDeploymentYaml() string
func InitEndPointYaml ¶
func InitEndPointYaml() string
func InitHpaYaml ¶
func InitHpaYaml() string
func InitIngresClassYaml ¶ added in v1.3.2
func InitIngresClassYaml() string
func InitIngresYaml ¶
func InitIngresYaml() string
func InitIngress ¶
func InitIngressYaml ¶
func InitIngressYaml() string
func InitIssuerYaml ¶
func InitIssuerYaml() string
func InitJobYaml ¶
func InitJobYaml() string
func InitLeaseYaml ¶
func InitLeaseYaml() string
func InitNamespaceYaml ¶
func InitNamespaceYaml() string
func InitNetPolNamespace ¶
func InitNetPolNamespace() netv1.NetworkPolicy
func InitNetPolNamespaceYaml ¶
func InitNetPolNamespaceYaml() string
func InitNetPolService ¶
func InitNetPolService() netv1.NetworkPolicy
func InitNetPolServiceYaml ¶
func InitNetPolServiceYaml() string
func InitNetPolYaml ¶
func InitNetPolYaml() string
func InitOrderYaml ¶
func InitOrderYaml() string
func InitPersistentVolume ¶
func InitPersistentVolume() core.PersistentVolume
func InitPersistentVolumeClaim ¶
func InitPersistentVolumeClaim() core.PersistentVolumeClaim
func InitPersistentVolumeClaimYaml ¶
func InitPersistentVolumeClaimYaml() string
func InitPersistentVolumeYaml ¶
func InitPersistentVolumeYaml() string
func InitPodYaml ¶
func InitPodYaml() string
func InitPriorityClassYaml ¶
func InitPriorityClassYaml() string
func InitPunqIngress ¶
func InitPunqIngressTraefik ¶ added in v1.3.2
func InitPunqIngressTraefikMiddlewareYaml ¶ added in v1.3.2
func InitPunqIngressTraefikMiddlewareYaml() string
func InitPunqService ¶
func InitReplicaSetYaml ¶
func InitReplicaSetYaml() string
func InitResourceQuotaYaml ¶
func InitResourceQuotaYaml() string
func InitRoleBindingYaml ¶
func InitRoleBindingYaml() string
func InitRoleYaml ¶
func InitRoleYaml() string
func InitSecret ¶
func InitSecretYaml ¶
func InitSecretYaml() string
func InitService ¶
func InitServiceAccountExampleYaml ¶
func InitServiceAccountExampleYaml() string
func InitServiceExampleYaml ¶
func InitServiceExampleYaml() string
func InitServiceYaml ¶
func InitServiceYaml() string
func InitStatefulsetYaml ¶
func InitStatefulsetYaml() string
func InitStorageClassYaml ¶
func InitStorageClassYaml() string
func InitVolumeAttachmentYaml ¶
func InitVolumeAttachmentYaml() string
func InitVolumeSnapshotYaml ¶
func InitVolumeSnapshotYaml() string
func IsHelmInstalled ¶ added in v1.4.4
func IsKubectlInstalled ¶ added in v1.4.4
func IsNewReleaseAvailable ¶ added in v1.1.42
func IsNewReleaseAvailable() bool
func IsProduction ¶ added in v1.2.22
func IsProduction() bool
func MalformedMessage ¶ added in v1.2.0
func MissingHeader ¶ added in v1.2.1
func MissingQueryParameter ¶ added in v1.4.0
func NanoIdExtraLong ¶
func NanoIdExtraLong() string
func NanoIdSmallLowerCase ¶ added in v1.5.7
func NanoIdSmallLowerCase() string
func NumberToHumanReadable ¶
func OpenBrowser ¶
func OpenBrowser(url string)
func ParseJsonStringArray ¶
func PrintChangeLog ¶ added in v1.1.27
func PrintChangeLog()
func PrintError ¶ added in v1.3.0
func PrintError(message string)
func PrintPrettyPost ¶ added in v1.2.0
func PrintSettings ¶
func PrintSettings()
func PrintVersionInfo ¶
func PrintVersionInfo()
func PrintWelcomeMessage ¶ added in v1.3.2
func PrintWelcomeMessage()
func RandomFirstName ¶ added in v1.4.0
func RandomFirstName() string
func RandomLastName ¶ added in v1.4.0
func RandomLastName() string
func RandomMiddleName ¶ added in v1.4.0
func RandomMiddleName() string
func RunOnLocalShell ¶ added in v1.5.6
func SelectIndexInteractive ¶ added in v1.2.38
func StatusEmoji ¶ added in v1.4.5
func TruncateText ¶
func Unauthorized ¶ added in v1.2.0
func WriteDefaultConfig ¶
func WriteDefaultConfig(stage string)
Types ¶
type ClusterSecret ¶
This object will initially created in secrets when the software is installed into the cluster for the first time (resource: secret -> mogenius/mogenius)
type Config ¶
type Config struct { Config struct { Version int `yaml:"version" env-description:"Version of the configuration yaml."` } `yaml:"config"` Frontend struct { Host string `yaml:"host" env:"frontend_host" env-description:"Host of the frontend server."` Port int `yaml:"port" env:"frontend_port" env-description:"Port of the frontend server."` } `yaml:"frontend"` Backend struct { Host string `yaml:"host" env:"backend_host" env-description:"Host of the backend server."` Port int `yaml:"port" env:"backend_port" env-description:"Port of the backend server."` } `yaml:"backend"` Websocket struct { Host string `yaml:"host" env:"websocket_host" env-description:"Host of the websocket server."` Port int `yaml:"port" env:"websocket_port" env-description:"Port of the websocket server."` } `yaml:"websocket"` Kubernetes struct { ClusterName string `yaml:"cluster_name" env:"cluster_name" env-description:"The Name of the Kubernetes Cluster"` OwnNamespace string `yaml:"own_namespace" env:"OWN_NAMESPACE" env-description:"The Namespace of mogenius platform"` RunInCluster bool `` /* 229-byte string literal not displayed */ } `yaml:"kubernetes"` Misc struct { Stage string `yaml:"stage" env:"stage" env-description:"Stage to run in" env-default:"prod"` Debug bool `yaml:"debug" env:"debug" env-description:"If set to true, debug features will be enabled." env-default:"false"` CheckForUpdates int `yaml:"check_for_updates" env:"check_for_updates" env-description:"Time interval between update checks." env-default:"86400"` ProxyPort int `yaml:"proxy_port" env:"proxy_port" env-description:"Default port for proxy releated stuff." env-default:"8888"` IgnoreNamespaces []string `yaml:"ignore_namespaces" env:"ignore_namespaces" env-description:"List of all ignored namespaces." env-default:""` ForbidCountryCheck bool `yaml:"forbid_country_check" env:"forbid_country_check" env-description:"Check clusters location" env-default:"false"` } `yaml:"misc"` }
var CONFIG Config
type CountryDetails ¶ added in v1.5.4
type CountryDetails struct { Code string `json:"code"` Code3 string `json:"code3"` IsoID int `json:"isoId"` Name string `json:"name"` Currency string `json:"currency"` CurrencyName string `json:"currencyName"` TaxPercent float64 `json:"taxPercent"` Continent string `json:"continent"` CapitalCity string `json:"capitalCity"` CapitalCityLat float64 `json:"capitalCityLat"` CapitalCityLng float64 `json:"capitalCityLng"` IsEuMember bool `json:"isEuMember"` PhoneNumberPrefix string `json:"phoneNumberPrefix"` DomainTld string `json:"domainTld"` Languages []string `json:"languages"` IsActive bool `json:"isActive"` }
var CURRENT_COUNTRY *CountryDetails
func GuessClusterCountry ¶ added in v1.5.4
func GuessClusterCountry() (*CountryDetails, error)
type K8sWorkloadResult ¶ added in v1.2.0
type K8sWorkloadResult struct { Result interface{} `json:"result,omitempty"` Error interface{} `json:"error,omitempty"` }
type ResponseError ¶
type ResponseError struct {
Error string `json:"error,omitempty"`
}
func CreateError ¶
func CreateError(err error) ResponseError
Click to show internal directories.
Click to hide internal directories.