config

package
v0.2.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseConfluentCloudConfig

func ParseConfluentCloudConfig(path string) (username, password, broker string, err error)

TODO return []string for brokers

func TryFindCcloudConfigFile

func TryFindCcloudConfigFile() (string, error)

Types

type Cluster

type Cluster struct {
	Name                      string
	Version                   string                     `yaml:"version"`
	Brokers                   []string                   `yaml:"brokers"`
	SASL                      *SASL                      `yaml:"SASL"`
	TLS                       *TLS                       `yaml:"TLS"`
	SecurityProtocol          string                     `yaml:"security-protocol"`
	SchemaRegistryURL         string                     `yaml:"schema-registry-url"`
	SchemaRegistryCredentials *SchemaRegistryCredentials `yaml:"schema-registry-credentials"`
}

type Config

type Config struct {
	CurrentCluster  string `yaml:"current-cluster"`
	ClusterOverride string
	Clusters        []*Cluster `yaml:"clusters"`
}

func ReadConfig

func ReadConfig(cfgPath string) (c Config, err error)

func (*Config) ActiveCluster

func (c *Config) ActiveCluster() *Cluster

func (*Config) SetCurrentCluster

func (c *Config) SetCurrentCluster(name string) error

func (*Config) Write

func (c *Config) Write() error

type SASL

type SASL struct {
	Mechanism    string   `yaml:"mechanism"`
	Username     string   `yaml:"username"`
	Password     string   `yaml:"password"`
	ClientID     string   `yaml:"clientID"`
	ClientSecret string   `yaml:"clientSecret"`
	TokenURL     string   `yaml:"tokenURL"`
	Scopes       []string `yaml:"scopes"`
	Token        string   `yaml:"token"`
	Version      int16    `yaml:"version"`
}

type SchemaRegistryCredentials added in v0.2.4

type SchemaRegistryCredentials struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

type TLS

type TLS struct {
	Cafile        string
	Clientfile    string
	Clientkeyfile string
	Insecure      bool
}

Jump to

Keyboard shortcuts

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