config

package
v0.0.0-...-599ae38 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

* Copyright FMR LLC <opensource@fidelity.com> * * SPDX-License-Identifier: Apache

* Copyright FMR LLC <opensource@fidelity.com> * * SPDX-License-Identifier: Apache

* Copyright FMR LLC <opensource@fidelity.com> * * SPDX-License-Identifier: Apache

* Copyright FMR LLC <opensource@fidelity.com> * * SPDX-License-Identifier: Apache

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	CertPath        string   `json:"certPath"`
	Cert            []byte   `json:"cert"`
	KeyPath         string   `json:"keyPath"`
	Key             []byte   `json:"key"`
	IDPMetadataPath string   `json:"idpmetadataPath"`
	IDPMetadata     []byte   `json:"idpmetadata"`
	IDPMetadataURL  string   `json:"idpmetadataURL"`
	RootURL         string   `json:"rootURL"`
	MetadataURL     string   `json:"metadataURL"`
	AcrURL          string   `json:"acrURL"`
	SloURL          string   `json:"sloURL"`
	EntityID        string   `json:"entityID"`
	WhitelistPath   []string `json:"whitelistpath"`
	ClientID        string   `json:"clientID"`
	ClientSecret    string   `json:"clientSecret"`
}

func (*AuthConfig) ToMaskString

func (c *AuthConfig) ToMaskString() string

type AwsConfig

type AwsConfig struct {
	Credentials aws.Credentials
}

type ClusterBasicInfo

type ClusterBasicInfo struct {
	Name     string `json:"name"`
	Provider string `json:"provider"` // EKS, AKS, RKS ...
	Account  string `json:"account"`  //AWS account, Azure Subscription/resource group/,
	Role     string `json:"role"`     // AWS role arn, Azure AD Group
	Region   string `json:"region"`
}

Kubernetes cluster basic information

type ConfigLoader

type ConfigLoader interface {
	// ThelivConfig returns ThelivConfig
	LoadConfigs()
	GetKubernetesConfig(ctx context.Context, name string) (*KubernetesCluster, error)
	GetK8SClusterNames(ctx context.Context) ([]string, error)
}

ConfigLoader loads configurations for Theliv system, And Kubernetes cluster based on K8S cluster ID.

func GetConfigLoader

func GetConfigLoader() ConfigLoader

type DatadogConfig

type DatadogConfig struct {
	ApiKey      string `json:"apiKey"`
	AppKey      string `json:"appKey"`
	Index       string `json:"index"`
	MaxRecords  int    `json:"maxRecords"`
	Debug       bool   `json:"debug"`
	DatadogHost string `json:"host"`
}

func (*DatadogConfig) ToMaskString

func (c *DatadogConfig) ToMaskString() string

type EtcdConfigLoader

type EtcdConfigLoader struct {
	CAFile    string
	CertFile  string
	KeyFile   string
	Endpoints []string
}

func NewEtcdConfigLoader

func NewEtcdConfigLoader(ca, cert, key string, endpoints ...string) *EtcdConfigLoader

func (*EtcdConfigLoader) GetK8SClusterNames

func (ecl *EtcdConfigLoader) GetK8SClusterNames(ctx context.Context) ([]string, error)

func (*EtcdConfigLoader) GetKubernetesConfig

func (ecl *EtcdConfigLoader) GetKubernetesConfig(ctx context.Context, name string) (*KubernetesCluster, error)

func (*EtcdConfigLoader) LoadConfigs

func (ecl *EtcdConfigLoader) LoadConfigs()

type FileConfigLoader

type FileConfigLoader struct {
	ThelivConfigFile string
}

FileConfigLoader loads all the configuration from files

func NewFileConfigLoader

func NewFileConfigLoader(configfile string) *FileConfigLoader

NewFileConfigLoader creates new FileConfigLoader from configfile

func (*FileConfigLoader) GetK8SClusterNames

func (l *FileConfigLoader) GetK8SClusterNames(ctx context.Context) ([]string, error)

func (*FileConfigLoader) GetKubernetesConfig

func (l *FileConfigLoader) GetKubernetesConfig(ctx context.Context, name string) (*KubernetesCluster, error)

func (*FileConfigLoader) LoadConfigs

func (l *FileConfigLoader) LoadConfigs()

type KubernetesCluster

type KubernetesCluster struct {
	Basic    ClusterBasicInfo `json:"basic"`
	KubeConf []byte           `json:"kubeconf"`
	AwsConf  []byte           `json:"awsconf"`
}

func (*KubernetesCluster) GetAwsConfig

func (conf *KubernetesCluster) GetAwsConfig(ctx context.Context) *aws.Config

func (*KubernetesCluster) GetKubeConfig

func (conf *KubernetesCluster) GetKubeConfig(ctx context.Context) (*restclient.Config, error)

GetClusterConfig returns Kubernetes config based on cluster name

type LdapConfig

type LdapConfig struct {
	Address string `json:"address"`
	Query   string `json:"query"`
}

type LogDriverType

type LogDriverType string
const (
	DriverDatadog       LogDriverType = "datadog"
	DriverDefaultDriver LogDriverType = "k8s"
)

type ProblemLevelConfig

type ProblemLevelConfig struct {
	ManagedNamespaces []string `json:"managednamespaces"`
}

type PrometheusConfig

type PrometheusConfig struct {
	Address   string `json:"address"`
	Namespace string `json:"namespace"`
	Name      string `json:"name"`
	Port      string `json:"port"`
}

type ThelivConfig

type ThelivConfig struct {
	Port     int     `json:"port"`
	LogLevel int     `json:"loglevel"`
	QPS      float32 `json:"qps,omitempty"`
	Burst    int     `json:"burst,omitempty"`
	// Only for file configs
	ClusterDir          string              `json:"clusterDir,omitempty"`
	Datadog             *DatadogConfig      `json:"datadog,omitempty"`
	Auth                *AuthConfig         `json:"auth,omitempty"`
	Prometheus          *PrometheusConfig   `json:"prometheus,omitempty"`
	ProblemLevel        *ProblemLevelConfig `json:"problemlevel,omitempty"`
	Ldap                *LdapConfig
	LogDriver           LogDriverType `json:"logDriver,omitempty"`
	EventDriver         LogDriverType `json:"eventDriver,omitempty"`
	LogDeeplinkDriver   LogDriverType `json:"logDeeplinkDriver,omitempty"`
	EventDeeplinkDriver LogDriverType `json:"eventDeeplinkDriver,omitempty"`
	// Only for UI usage
	EmailAddr       string `json:"emailAddr,omitempty"`
	DevelopedByTeam string `json:"developedByTeam,omitempty"`
	VideoLink       string `json:"videoLink,omitempty"`
	TeamName        string `json:"teamName,omitempty"`
}

ThelivConfig is the configuration for Theliv system, Such as port for web service

func GetThelivConfig

func GetThelivConfig() *ThelivConfig

GetThelivConfig returns theliv config

func (*ThelivConfig) ToMaskString

func (c *ThelivConfig) ToMaskString() string

Jump to

Keyboard shortcuts

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