configs

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAlias

func AddAlias(service, key, value string) error

func FetchEndpointsMap

func FetchEndpointsMap(endpoint string) (map[string]string, error)

func GetAPIEndpoint

func GetAPIEndpoint(endpoint string) (string, error)

GetAPIEndpoint fetches the actual API endpoint from the config endpoint

func GetIdentityEndpoint

func GetIdentityEndpoint(apiEndpoint string) (string, bool, error)

GetIdentityEndpoint fetches the identity service endpoint from the API endpoint

func GetServiceEndpoint

func GetServiceEndpoint(config *Environments, serviceName string) (string, error)

func GetSettingFilePath

func GetSettingFilePath() (string, error)

GetSettingFilePath returns the path to the setting file in the .cfctl directory

func ListAliases

func ListAliases() (map[string]interface{}, error)

func LoadAliases

func LoadAliases() (map[string]interface{}, error)

func RemoveAlias

func RemoveAlias(service, key string) error

Types

type Environment

type Environment struct {
	Endpoint string `yaml:"endpoint"` // gRPC or HTTP endpoint URL
	Proxy    string `yaml:"proxy"`    // Proxy server address if required
	Token    string `yaml:"token"`    // Authentication token
}

Environment represents a single environment configuration

type Environments

type Environments struct {
	Environment  string                 `yaml:"environment"`  // Current active environment
	Environments map[string]Environment `yaml:"environments"` // Map of available environments
}

Environments represents the complete configuration structure

func SetSettingFile

func SetSettingFile() (*Environments, error)

SetSettingFile loads the setting from the default location (~/.cfctl/setting.yaml)

Jump to

Keyboard shortcuts

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