Documentation ¶
Index ¶
Constants ¶
View Source
const ( // KeyNamespace is the same that you would use with kubectl --namespace // just define it in your namespace specific helm chart KeyNamespace = "KUBE_NAMESPACE" DefNamespace = "default" // KeyLeaseScope is used as a prefix for leases. // leases are scoped by default only to namespace, so this scopes them // to your service to ensure leases from multiple services do not collide // for that reason, just use your service name such as tm-sync KeyLeaseScope = "KUBE_LEASE_SCOPE" DefLeaseScope = "unscoped" // KeyConfigPath is only needed by tests ran on your local machine // which must talk to the real external k8s system using your own account // 99.9% of your tests should use the mock client rather than do this. // if you do decide to use it your own local config file is used // which is likely /home/YOUR_USER_NAME/.kube/config KeyConfigPath = "KUBE_CONFIG_PATH" // KeyPodName is only needed to allow tests to simulate different pod's // each running instance of the application will generate its own // global unique ID, this will not match what you see KeyPodName = "KUBE_POD_NAME" )
Variables ¶
View Source
var Defaults = map[string]string{ KeyNamespace: DefNamespace, KeyLeaseScope: DefLeaseScope, KeyPodName: uuid.NewString()[24:], }
View Source
var FromEnv = os.Getenv
Functions ¶
This section is empty.
Types ¶
type ConfBuilder ¶
type ConfBuilder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder(def func(string) string, m map[string]string) ConfBuilder
func (ConfBuilder) Build ¶
func (b ConfBuilder) Build() Config
func (ConfBuilder) With ¶
func (b ConfBuilder) With(k, v string) ConfBuilder
func (ConfBuilder) WithDefaultFN ¶
func (b ConfBuilder) WithDefaultFN(fn func(string) string) ConfBuilder
func (ConfBuilder) WithMap ¶
func (b ConfBuilder) WithMap(m map[string]string) ConfBuilder
Click to show internal directories.
Click to hide internal directories.