Documentation ¶
Index ¶
- Constants
- Variables
- func All(vs []string, f func(string) bool) bool
- func Any(vs []string, f func(string) bool) bool
- func AppendIfMissing(slice []string, i string) []string
- func Check(e error)
- func Checkf(e error, msg string)
- func Filter(vs []string, f func(string) bool) []string
- func Include(vs []string, t string) bool
- func Index(vs []string, t string) int
- func IsEmpty(value string) bool
- func MakeConfig() (*types.Config, error)
- func Map(vs []string, f func(string) string) []string
- func Middleware(next http.HandlerFunc) http.HandlerFunc
Constants ¶
View Source
const ( TlsCertPath = "/var/run/secrets/certs/tls.crt" TlsKeyPath = "/var/run/secrets/certs/tls.key" TlsCaFile = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" TokenFile = "/var/run/secrets/kubernetes.io/serviceaccount/token" Dns1123LabelFmt string = "^[a-z0-9][-a-z0-9]*$" DNS1123LabelMaxLength int = 63 )
View Source
const ( KubiResourcePrefix = "kubi" KubiClusterRoleBindingReaderName = "kubi-reader" KubiDefaultNetworkPolicyName = "kubi-default" UnauthenticatedGroup = "system:unauthenticated" AdminGroup = "system:masters" KubiStageScratch = "scratch" KubiStageStaging = "staging" KubiStageStable = "stable" KubiEnvironmentProduction = "production" KubiEnvironmentIntegration = "integration" KubiEnvironmentDevelopment = "development" KubiTenantUndeterminable = "undeterminable" )
Variables ¶
View Source
var BlacklistedNamespaces = []string{ "kube-system", "kube-public", "ingress-nginx", "default", KubiResourcePrefix, }
View Source
var Config *types.Config
View Source
var Histogram = promauto.NewHistogramVec(prometheus.HistogramOpts{ Name: "kubi_http_requests", Help: "Time per requests", Buckets: []float64{1, 2, 5, 6, 10}, }, []string{"path"}) // this will be partitioned by the HTTP code.
View Source
var Log = zerolog.New(output).With().Timestamp().Logger()
View Source
var TokenCounter = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "kubi_valid_token_total", Help: "Total number of tokens issued", }, []string{"status"})
Functions ¶
func AppendIfMissing ¶
func Filter ¶
Filter returns a new slice containing all strings in the slice that satisfy the predicate `f`.
func MakeConfig ¶
Build the configuration from environment variable and validate that is consistent. If false, the program exit with validation message. The validation is not error safe but it limit misconfiguration ( lack of parameter ).
func Map ¶
Map returns a new slice containing the results of applying the function `f` to each string in the original slice.
func Middleware ¶
func Middleware(next http.HandlerFunc) http.HandlerFunc
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.