config

package
v0.0.0-...-434faa1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultNumPartitions      = 10
	DefaultReplicationFactor  = 3
	DefaultSegmentBytes       = 50 * 1024 * 1024 // 50MB (min allowed by Confluent Cloud)
	DefaultMaxCompactionLagMs = 7 * 24 * time.Hour / time.Millisecond
	DefaultDeleteRetentionMs  = 24 * time.Hour / time.Millisecond

	DefaultTopicPrefix  = "tables."
	DefaultSchemasTopic = DefaultTopicPrefix + "schemas"
)
View Source
const (
	KeyFileEnvName = "KAFKA_SASL_CREDENTIALS"
	KeyFileName    = "kafka_sasl_credentials.json"
	SecretsDir     = ".secrets"
	ConfigDir      = ".config"
	ConfigSubDir   = "kafka"
	ExampleConfig  = `{
	"key":    "my-api-user",
	"secret": "my-api-secret",
	"server": "my-cluster.europe-west3.gcp.confluent.cloud:9092"
}`
)

Variables

View Source
var (
	ErrorParseKeyFile = errors.New("Failed to load or parse keyfile")
	ErrorFindKeyFile  = errors.New("Failed to find keyfile")
)

Functions

func DefaultProperties

func DefaultProperties() map[string]string

func FindKeyFile

func FindKeyFile() (string, error)

Types

type Group

type Group struct {
	ID     string
	Topics []string
}

type KafkaProperties

type KafkaProperties map[string]string

type KeyFile

type KeyFile struct {
	Key    string `json:"key,omitempty"`
	Secret string `json:"secret,omitempty"`
	Server string `json:"server,omitempty"`
}

func LoadKeyFile

func LoadKeyFile() (*KeyFile, error)

func (*KeyFile) Load

func (kf *KeyFile) Load() error

func (*KeyFile) Validate

func (kf *KeyFile) Validate() error

Jump to

Keyboard shortcuts

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