config

package
v0.0.0-...-53e3d08 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Listen      []string          `yaml:"listen" json:"listen"`
	Certificate utils.Certificate `yaml:"certificate" json:"certificate"`

	Principals    []Principal    `yaml:"principals" json:"principals" validate:"principals"`
	Subscriptions []Subscription `yaml:"subscriptions" json:"subscriptions" validate:"subscriptions"`

	Message Message `yaml:"message" json:"message"`
	Storage struct {
		Dir string `yaml:"dir" json:"dir" default:"var/db/openedge/data"`
	} `yaml:"storage" json:"storage"`
	Shutdown struct {
		Timeout time.Duration `yaml:"timeout" json:"timeout" default:"10m"`
	} `yaml:"shutdown" json:"shutdown"`
	Metrics struct {
		Report struct {
			Interval time.Duration `yaml:"interval" json:"interval" default:"1m"`
		} `yaml:"report" json:"report"`
	} `yaml:"metrics" json:"metrics"`
}

Config all config of edge

func New

func New(in []byte) (*Config, error)

New config

type Message

type Message struct {
	Length  utils.Length `yaml:"length" json:"length" default:"{\"max\":32768}"`
	Ingress struct {
		Qos0 struct {
			Buffer struct {
				Size int `yaml:"size" json:"size" default:"10000" validate:"min=1"`
			} `yaml:"buffer" json:"buffer"`
		} `yaml:"qos0" json:"qos0"`
		Qos1 struct {
			Buffer struct {
				Size int `yaml:"size" json:"size" default:"100" validate:"min=1"`
			} `yaml:"buffer" json:"buffer"`
			Batch struct {
				Max int `yaml:"max" json:"max" default:"50" validate:"min=1"`
			} `yaml:"batch" json:"batch"`
			Cleanup struct {
				Retention time.Duration `yaml:"retention" json:"retention" default:"48h"`
				Interval  time.Duration `yaml:"interval" json:"interval" default:"1m"`
			} `yaml:"cleanup" json:"cleanup"`
		} `yaml:"qos1" json:"qos1"`
	} `yaml:"ingress" json:"ingress"`
	Egress struct {
		Qos0 struct {
			Buffer struct {
				Size int `yaml:"size" json:"size" default:"10000" validate:"min=1"`
			} `yaml:"buffer" json:"buffer"`
		} `yaml:"qos0" json:"qos0"`
		Qos1 struct {
			Buffer struct {
				Size int `yaml:"size" json:"size" default:"100" validate:"min=1,max=65535"`
			} `yaml:"buffer" json:"buffer"`
			Batch struct {
				Max int `yaml:"max" json:"max" default:"50" validate:"min=1,max=10000"`
			} `yaml:"batch" json:"batch"`
			Retry struct {
				Interval time.Duration `yaml:"interval" json:"interval" default:"20s"`
			} `yaml:"retry" json:"retry"`
		} `yaml:"qos1" json:"qos1"`
	} `yaml:"egress" json:"egress"`
	Offset struct {
		Buffer struct {
			Size int `yaml:"size" json:"size" default:"10000" validate:"min=1"`
		} `yaml:"buffer" json:"buffer"`
		Batch struct {
			Max int `yaml:"max" json:"max" default:"100" validate:"min=1"`
		} `yaml:"batch" json:"batch"`
	} `yaml:"offset" json:"offset"`
}

Message message config

type Permission

type Permission struct {
	Action  string   `yaml:"action" json:"action" validate:"regexp=^(p|s)ub$"`
	Permits []string `yaml:"permit,flow" json:"permit,flow"`
}

Permission Permission

type Principal

type Principal struct {
	Username    string       `yaml:"username" json:"username"`
	Password    string       `yaml:"password" json:"password"`
	Permissions []Permission `yaml:"permissions" json:"permissions"`
}

Principal Principal

type Subscription

type Subscription struct {
	Source struct {
		Topic string `yaml:"topic" json:"topic" validate:"nonzero"`
		QOS   byte   `yaml:"qos" json:"qos" validate:"min=0, max=1"`
	} `yaml:"source" json:"source"`
	Target struct {
		Topic string `yaml:"topic" json:"topic" validate:"nonzero"`
		QOS   byte   `yaml:"qos" json:"qos" validate:"min=0, max=1"`
	} `yaml:"target" json:"target"`
}

Subscription subscription

Jump to

Keyboard shortcuts

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