config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigPath

func GetConfigPath(userConfigDir string) string

func GetDefaultConfigPath

func GetDefaultConfigPath() (string, error)

Types

type ClusterConfig

type ClusterConfig struct {
	// host:port for Temporal frontend service
	Address string `json:"address"`
	// Web UI Link
	WebAddress string `json:"webAddress"`
	// Temporal workflow namespace (default: "default")
	Namespace string `json:"namespace"`
	// Headers provider plugin executable name
	HeadersProvider string `json:"headersProvider"`
	// Data converter plugin executable name
	DataConverter string     `json:"dataConverter"`
	TLS           *TLSConfig `json:"tls,omitempty"`
	// Any additional environment variables that are needed
	Environment map[string]string `json:"additional,omitempty"`
}

func (ClusterConfig) GetTLS

func (c ClusterConfig) GetTLS() TLSConfig

type Config

type Config struct {
	ActiveContext string `json:"active"`
	// Map of context names to cluster configuration
	Contexts map[string]*ClusterConfig `json:"contexts"`
}

type Option

type Option func(t *Tctx)

func WithConfigFile

func WithConfigFile(configFilePath string) Option

type TLSConfig

type TLSConfig struct {
	// Path to x509 certificate
	CertPath string `json:"certPath"`
	// Path to private key
	KeyPath string `json:"keyPath"`
	// Path to server CA certificate
	CACertPath string `json:"caPath"`
	// Disable tls host name verification (tls must be enabled)
	DisableHostVerification bool `json:"disableHostVerification"`
	// Override for target server name
	ServerName string `json:"serverName"`
}

type Tctx

type Tctx struct {
	// contains filtered or unexported fields
}

func NewTctx

func NewTctx(opts ...Option) (*Tctx, error)

func (*Tctx) DeleteContext

func (t *Tctx) DeleteContext(name string) error

func (*Tctx) GetActiveContext

func (t *Tctx) GetActiveContext() (*ClusterConfig, error)

func (*Tctx) GetActiveContextName

func (t *Tctx) GetActiveContextName() (string, error)

func (*Tctx) GetAllContexts

func (t *Tctx) GetAllContexts() (*Config, error)

func (*Tctx) GetContext

func (t *Tctx) GetContext(name string) (*ClusterConfig, error)

func (*Tctx) GetContextNames

func (t *Tctx) GetContextNames() ([]string, error)

func (*Tctx) SetActiveContext

func (t *Tctx) SetActiveContext(name, namespace string) error

func (*Tctx) UpsertContext

func (t *Tctx) UpsertContext(name string, new *ClusterConfig) error

Jump to

Keyboard shortcuts

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