config

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Overview

Package config provides configurations for cascading zippers.

Index

Constants

This section is empty.

Variables

View Source
var ErrConfigExt = errors.New(`yomo: the extension of config is incorrect, it should be ".yaml|.yml"`)

ErrConfigExt represents the extension of config file is incorrect.

Functions

This section is empty.

Types

type Config added in v1.12.2

type Config struct {
	// Name represents the name of the zipper.
	Name string `yaml:"name"`
	// Host represents the listening host of the zipper.
	Host string `yaml:"host"`
	// Port represents the listening port of the zipper.
	Port int `yaml:"port"`
	// Auth is the way for the source or SFN to be authenticated by the zipper.
	// The token typed auth has two key-value pairs associated with it:
	// a `type:token` key-value pair and a `token:<CREDENTIAL>` key-value pair.
	Auth map[string]string `yaml:"auth"`
	// Functions represents the stream functions that zipper allowed to connect.
	Functions []Function `yaml:"functions"`
	// Downstreams holds cascading zippers config. the map-key is downstream name.
	Downstreams map[string]Downstream `yaml:"downstreams"`
}

Config represents a yomo config.

func ParseConfigFile added in v1.12.2

func ParseConfigFile(configPath string) (Config, error)

ParseConfigFile parses the config from configPath. The zipper will bootstrap from this config.

type Downstream added in v1.12.2

type Downstream struct {
	// Host is the host of downstream zipper.
	Host string `yaml:"host"`
	// Port is the port of downstream zipper.
	Port int `yaml:"port"`
	// Credential is the credential when connect to downstream zipper.
	// It is in the format of 'authType:authPayload', separated by a colon.
	// If Credential is empty, it represents that downstream will not authenticate the current Zipper.
	Credential string `yaml:"credential"`
}

Downstream describes a cascading zipper config.

type Function added in v1.12.2

type Function struct {
	// Name is the name of StreamFunction.
	Name string `yaml:"name"`
}

Function represents a yomo stream function.

Jump to

Keyboard shortcuts

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