config

package
v0.0.0-...-95272ce Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Prefix string = "ORDERER"

Prefix is the default config prefix for the orderer

Variables

This section is empty.

Functions

func ExactWithDateUnmarshal

func ExactWithDateUnmarshal(v *viper.Viper, output interface{}) error

ExactWithDateUnmarshal is intended to unmarshal a config file into a structure producing error when extraneous variables are introduced and supporting the time.Duration type

Types

type FileLedger

type FileLedger struct {
	Location string
	Prefix   string
}

FileLedger contains config for the File ledger

type General

type General struct {
	OrdererType   string
	LedgerType    string
	BatchTimeout  time.Duration
	BatchSize     uint
	QueueSize     uint
	MaxWindowSize uint
	ListenAddress string
	ListenPort    uint16
	GenesisMethod string
	Profile       Profile
}

General contains config which should be common among all orderer types

type Kafka

type Kafka struct {
	Brokers     []string
	Topic       string
	PartitionID int32
	Retry       Retry
	Version     sarama.KafkaVersion // TODO For now set this in code
}

Kafka contains config for the Kafka orderer

type Profile

type Profile struct {
	Enabled bool
	Address string
}

Profile contains configuration for Go pprof profiling

type RAMLedger

type RAMLedger struct {
	HistorySize uint
}

RAMLedger contains config for the RAM ledger

type Retry

type Retry struct {
	Period time.Duration
	Stop   time.Duration
}

Retry contains config for the reconnection attempts to the Kafka brokers

type TopLevel

type TopLevel struct {
	General    General
	RAMLedger  RAMLedger
	FileLedger FileLedger
	Kafka      Kafka
}

TopLevel directly corresponds to the orderer config yaml Note, for non 1-1 mappings, you may append something like `mapstructure:"weirdFoRMat"` to modify the default mapping, see the "Unmarshal" section of https://github.com/spf13/viper for more info

func Load

func Load() *TopLevel

Load parses the orderer.yaml file and environment, producing a struct suitable for config use

Jump to

Keyboard shortcuts

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