config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContractCtxKey = &contextKey{"contract"}
View Source
var GatewayCtxKey = &contextKey{"gateway"}

Functions

This section is empty.

Types

type AdminOrg

type AdminOrg struct {
	MSPID string `yaml:"mspid"`
	CA    string `yaml:"ca"`
	TLSCA string `yaml:"tlsCA"`
}

type AnchorPeer added in v0.0.3

type AnchorPeer struct {
	Name      string `yaml:"name"`
	Namespace string `yaml:"namespace"`
	DC        string `yaml:"dc"`
}

type ApplicationParams

type ApplicationParams struct {
	Capabilities []string        `yaml:"capabilities"`
	Policies     *PoliciesParams `yaml:"policies"`
}

type CA

type CA struct {
	Name      string `yaml:"name"`
	Namespace string `yaml:"namespace"`
	DC        string `yaml:"dc"`
}

type ChannelConfig

type ChannelConfig struct {
	Name             string         `yaml:"name"`
	Consenters       []Consenter    `yaml:"consenters"`
	PeerOrgs         []PeerOrg      `yaml:"peerOrgs"`
	OrdererOrgs      []OrdererOrg   `yaml:"ordererOrgs"`
	PeerAdminOrgs    []AdminOrg     `yaml:"peerAdminOrgs"`
	OrdererAdminOrgs []AdminOrg     `yaml:"ordererAdminOrgs"`
	Params           *ChannelParams `yaml:"params"`
}

type ChannelParams

type ChannelParams struct {
	Orderer     *OrdererParams     `yaml:"orderer"`
	Application *ApplicationParams `yaml:"application"`
}

type Consenter

type Consenter struct {
	Name      string `yaml:"name"`
	DC        string `yaml:"dc"`
	Namespace string `yaml:"namespace"`
}

type DC

type DC struct {
	Name       string `yaml:"name"`
	KubeConfig string `yaml:"kubeconfig"`
}

type DCClient added in v0.0.3

type DCClient struct {
	HLFClient  *operatorv1.Clientset
	KubeClient *kubernetes.Clientset
	KubeConfig *rest.Config
}

type ETCDRaft

type ETCDRaft struct {
	Options *ETCDRaftOptions `yaml:"options"`
}

type ETCDRaftOptions

type ETCDRaftOptions struct {
	TickInterval         *string `yaml:"TickInterval"`
	ElectionTick         *uint32 `yaml:"ElectionTick"`
	HeartbeatTick        *uint32 `yaml:"HeartbeatTick"`
	MaxInflightBlocks    *uint32 `yaml:"MaxInflightBlocks"`
	SnapshotIntervalSize *uint32 `yaml:"SnapshotIntervalSize"`
}

type GatewayParams

type GatewayParams struct {
	PeerUrl       string
	PeerTLSCACert []byte
	MSPID         string
}

type HLFChannelManagerConfig

type HLFChannelManagerConfig struct {
	DCs []DC `yaml:"dcs"`
}

type Orderer

type Orderer struct {
	Name      string `yaml:"name"`
	Namespace string `yaml:"namespace"`
	DC        string `yaml:"dc"`
}

type OrdererOrg

type OrdererOrg struct {
	MSPID    string    `yaml:"mspid"`
	CA       CA        `yaml:"ca"`
	Orderers []Orderer `yaml:"orderers"`
}

type OrdererParams

type OrdererParams struct {
	Capabilities []string `yaml:"capabilities"`
	// 		BatchSize: orderer.BatchSize{
	//			MaxMessageCount:   100,
	//			AbsoluteMaxBytes:  1024 * 1024,
	//			PreferredMaxBytes: 512 * 1024,
	//		},
	//		BatchTimeout: 2 * time.Second,
	//		State:        "STATE_NORMAL",
	BatchTimeout *time.Duration `yaml:"batchTimeout"`
	//BatchSize time.Duration `yaml:"batchTimeout"`
	ETCDRaft *ETCDRaft `yaml:"etcdRaft"`
}

type Peer added in v0.0.3

type Peer struct {
	Name string `yaml:"name"`
}

type PeerOrg

type PeerOrg struct {
	MSPID       string       `yaml:"mspid"`
	CA          CA           `yaml:"ca"`
	SignCA      string       `yaml:"signCA"`
	Peers       []Peer       `yaml:"peers"`
	AnchorPeers []AnchorPeer `yaml:"anchorPeers"`
}

type PoliciesParams

type PoliciesParams struct {
	Readers              *Policy `yaml:"Readers"`
	Writers              *Policy `yaml:"Writers"`
	Admins               *Policy `yaml:"Admins"`
	Endorsement          *Policy `yaml:"Endorsement"`
	LifecycleEndorsement *Policy `yaml:"LifecycleEndorsement"`
}

type Policy

type Policy struct {
	Type      string `yaml:"Type"`
	Rule      string `yaml:"Rule"`
	ModPolicy string `yaml:"ModPolicy"`
}

Policy is an expression used to define rules for access to channels, chaincodes, etc.

type Provider

type Provider interface {
	ConfigFileUsed() string
	Get(key string) interface{}
	GetBool(key string) bool
	GetDuration(key string) time.Duration
	GetFloat64(key string) float64
	GetInt(key string) int
	GetInt64(key string) int64
	GetSizeInBytes(key string) uint
	GetString(key string) string
	GetStringMap(key string) map[string]interface{}
	GetStringMapString(key string) map[string]string
	GetStringMapStringSlice(key string) map[string][]string
	GetStringSlice(key string) []string
	GetTime(key string) time.Time
	InConfig(key string) bool
	IsSet(key string) bool
}

Provider defines a set of read-only methods for accessing the application configuration params as defined in one of the config files.

func Config

func Config() Provider

Config returns a default config providers

func LoadConfigProvider

func LoadConfigProvider(appName string, configFile string) Provider

LoadConfigProvider returns a configured viper instance

Jump to

Keyboard shortcuts

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