global

package
v0.0.0-...-e7c744b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ManagedByPipelineTag     = "banzaicloud-pipeline-managed"
	ManagedByPipelineValue   = "true"
	ManagedByPipelineUUIDTag = "banzaicloud-pipeline-uuid"
)

Variables

View Source
var Config struct {
	Auth struct {
		Cookie struct {
			Secure    bool
			SetDomain bool
		}
		OIDC struct {
			Issuer string
		}
		Token struct {
			Audience string
			Issuer   string
		}
	}
	Cloud struct {
		Amazon struct {
			DefaultRegion string
		}
	}
	Cluster struct {
		Namespace string
		Autoscale struct {
			Namespace string
			Charts    struct {
				ClusterAutoscaler struct {
					Chart                   string
					Version                 string
					ImageVersionConstraints []struct {
						K8sVersion string
						Repository string
						Tag        string
					}
				}
			}
		}
		DisasterRecovery struct {
			Enabled   bool
			Namespace string
			Ark       struct {
				RestoreWaitTimeout time.Duration
			}
			Charts struct {
				Ark struct {
					Chart        string
					Version      string
					Values       map[string]interface{}
					PluginImages struct {
						Aws struct {
							Repository string `chartConfig:"repository"`
							Tag        string `chartConfig:"tag"`
							PullPolicy string `chartConfig:"pullPolicy"`
						} `chartConfig:"aws"`
						Azure struct {
							Repository string `chartConfig:"repository"`
							Tag        string `chartConfig:"tag"`
							PullPolicy string `chartConfig:"pullPolicy"`
						} `chartConfig:"azure"`
						Gcp struct {
							Repository string `chartConfig:"repository"`
							Tag        string `chartConfig:"tag"`
							PullPolicy string `chartConfig:"pullPolicy"`
						} `chartConfig:"gcp"`
					}
				}
			}
		}
		DNS struct {
			Enabled        bool
			BaseDomain     string
			ProviderSecret string
		}
		Labels struct {
			Namespace string
		}
		PostHook struct {
			Autoscaler struct {
				Enabled bool
			}
			Dashboard struct {
				Enabled bool
				Chart   string
				Version string
			}
			Ingress struct {
				Enabled bool
				Chart   string
				Version string
				Values  map[string]interface{}
			}
			ITH struct {
				Enabled bool
				Chart   string
				Version string
			}
			Spotconfig struct {
				Enabled bool
				Charts  struct {
					Scheduler struct {
						Chart   string
						Version string
					}
					Webhook struct {
						Chart   string
						Version string
					}
				}
			}
		}
	}
	Dex struct {
		APIAddr string
		APICa   string
	}
	Distribution struct {
		EKS struct {
			ExposeAdminKubeconfig bool
			TemplateLocation      string
			SSH                   struct {
				Generate bool
			}
		}
		PKE struct {
			Amazon struct {
				DefaultNetworkProvider string
			}
		}
	}
	Kubernetes struct {
		Client struct {
			ForceGlobal bool
		}
	}
	Pipeline struct {
		External struct {
			URL string
		}
		UUID       string
		Enterprise bool
	}
	Telemetry struct {
		Debug bool
	}
}

Config is a global config instance. Deprecated: Use only if you must! Try not to extend with new values! nolint: gochecknoglobals

Functions

func DB

func DB() *gorm.DB

DB returns an initialized DB instance.

func ErrorHandler

func ErrorHandler() emperror.Handler

ErrorHandler returns an error handler.

func Logger

func Logger() common.Logger

Logger returns an logrus logger.

func LogrusLogger

func LogrusLogger() *logrus.Logger

LogrusLogger returns an logrus logger.

func SetDB

func SetDB(d *gorm.DB)

SetDB configures a DB instance.

func SetErrorHandler

func SetErrorHandler(h emperror.Handler)

SetErrorHandler sets a global error handler.

Note: setting an error handler after the application bootstrap is not safe.

func SetLogger

func SetLogger(l common.Logger)

SetLogger sets a global error handler.

Note: setting an error handler after the application bootstrap is not safe.

func SetLogrusLogger

func SetLogrusLogger(l *logrus.Logger)

SetLogrusLogger sets a global error handler.

Note: setting an error handler after the application bootstrap is not safe.

func SetVault

func SetVault(v *vault.Client)

SetVault configures a Vault client instance.

func SubscribeErrorHandler

func SubscribeErrorHandler(s func(h emperror.Handler))

SubscribeErrorHandler subscribes a handler for global error handler changes.

func SubscribeLogger

func SubscribeLogger(s func(l common.Logger))

SubscribeLogger subscribes a handler for global error handler changes.

func SubscribeLogrusLogger

func SubscribeLogrusLogger(s func(l *logrus.Logger))

SubscribeLogrusLogger subscribes a handler for global error handler changes.

func Vault

func Vault() *vault.Client

Vault returns an initialized Vault client instance.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL