config

package
v0.0.0-...-fdd9b93 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: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDeploymentTimeout   = 90 * 1000
	DefaultAPIServerTimeout    = 120 * 1000
	DefaultOrdererFailureCount = 10
)
View Source
const (
	NamespaceEnvVar = "DEPLOY_NAMESPACE"
)

Variables

This section is empty.

Functions

func GetNamespace

func GetNamespace() (string, error)

func VerifyDefaultStorageAndResource

func VerifyDefaultStorageAndResource(defaults *DeployerDefaults) error

func VerifyDefaultVersions

func VerifyDefaultVersions(versions *Versions) error

Types

type BasicAuth

type BasicAuth struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

BasicAuth provides implementation to store basic auth info

type CAImages

type CAImages struct {
	// CAImage is the name of the CA image
	CAImage string `json:"caImage,omitempty"`

	// CATag is the tag of the CA image
	CATag string `json:"caTag,omitempty"`

	// CADigest is the digest tag of the CA image
	CADigest string `json:"caDigest,omitempty"`

	// CAInitImage is the name of the Init image
	CAInitImage string `json:"caInitImage,omitempty"`

	// CAInitTag is the tag of the Init image
	CAInitTag string `json:"caInitTag,omitempty"`

	// CAInitDigest is the digest tag of the Init image
	CAInitDigest string `json:"caInitDigest,omitempty"`

	// HSMImage is the name of the HSM image
	HSMImage string `json:"hsmImage,omitempty"`

	// HSMTag is the tag of the HSM image
	HSMTag string `json:"hsmTag,omitempty"`

	// HSMDigest is the tag of the HSM image
	HSMDigest string `json:"hsmDigest,omitempty"`

	// EnrollerImage is the name of the init image for crypto generation
	EnrollerImage string `json:"enrollerImage,omitempty"`

	// EnrollerTag is the tag of the init image for crypto generation
	EnrollerTag string `json:"enrollerTag,omitempty"`

	// EnrollerDigest is the digest tag of the init image for crypto generation
	EnrollerDigest string `json:"enrollerDigest,omitempty"`
}

CAImages is the list of images to be used in CA deployment

type CRN

type CRN struct {
	Version      string `json:"version"`
	CName        string `json:"c_name"`
	CType        string `json:"c_type"`
	Servicename  string `json:"service_name"`
	Location     string `json:"location"`
	AccountID    string `json:"account_id"`
	InstanceID   string `json:"instance_id"`
	ResourceType string `json:"resource_type"`
	ResourceID   string `json:"resource_id"`
}

CRN provides crn info

func (*CRN) String

func (crn *CRN) String() string

type Config

type Config struct {
	Options     *Options
	Deployer    *DeployerSettingsConfig
	LocalConfig *LocalConfig
}

func New

func New(options *Options) *Config

func (*Config) Init

func (c *Config) Init(deployerConfig *DeployerSettingsConfig) (*DeployerSettingsConfig, *LocalConfig, error)

Init initializes the configuration of the deployer

func (*Config) ReadConfigFile

func (c *Config) ReadConfigFile() (*DeployerSettingsConfig, error)

type Database

type Database struct {
	ConnectionURL string             `json:"connectionurl"`
	Components    IndividualDatabase `json:"components"`
	CreateDB      bool               `json:"createdb"`
}

Database is connection details to connect to couchdb database

type DeployerDefaults

type DeployerDefaults struct {
	Storage   *Storage   `json:"storage"`
	Resources *Resources `json:"resources"`
}

type DeployerSettingsConfig

type DeployerSettingsConfig struct {
	ClusterType      offering.Type     `json:"clusterType"`
	Domain           string            `json:"domain"`
	DashboardURL     string            `json:"dashboardurl"`
	Database         Database          `json:"db"`
	Loglevel         string            `json:"loglevel"`
	Port             int               `json:"port"`
	TLS              TLSConfig         `json:"tls"`
	Auth             BasicAuth         `json:"auth"`
	Namespace        string            `json:"namespace"`
	Defaults         *DeployerDefaults `json:"defaults"`
	Versions         *Versions         `json:"versions"`
	ImagePullSecrets []string          `json:"imagePullSecrets"`
	ServiceConfig    ServiceConfig     `json:"serviceConfig"`
	CRN              *CRN              `json:"crn"`
	Timeouts         *Timeouts         `json:"timeouts"`
	OtherImages      *OtherImages      `json:"otherImages"`
	ServiceAccount   string            `json:"serviceAccount"`
	UseTags          *bool             `json:"usetags"`
}

type IndividualDatabase

type IndividualDatabase struct {
	Name       string   `json:"name"`
	DesignDocs []string `json:"designdocs"`
}

IndividualDatabase describes the initialization of databases

type LocalConfig

type LocalConfig struct {
	Logger     *zap.Logger `json:"-"`
	KubeConfig *rest.Config
}

type Logger

type Logger interface {
	Errorw(msg string, keysAndValues ...interface{})
	Debugw(msg string, keysAndValues ...interface{})
}

type Options

type Options struct {
	ConfigPath      string
	DBConnectionURL string
	Username        string
	Password        string
	KubeConfig      string
}

Options holds the options specified by the broker's code on the command line.

type OrdererImages

type OrdererImages struct {
	// OrdererInitImage is the name of the orderer init image
	OrdererInitImage string `json:"ordererInitImage,omitempty"`

	// OrdererInitTag is the tag of the orderer init image
	OrdererInitTag string `json:"ordererInitTag,omitempty"`

	// OrdererInitDigest is the digest tag of the orderer init image
	OrdererInitDigest string `json:"ordererInitDigest,omitempty"`

	// OrdererImage is the name of the orderer image
	OrdererImage string `json:"ordererImage,omitempty"`

	// OrdererTag is the tag of the orderer image
	OrdererTag string `json:"ordererTag,omitempty"`

	// OrdererDigest is the digest tag of the orderer image
	OrdererDigest string `json:"ordererDigest,omitempty"`

	// GRPCWebImage is the name of the grpc web proxy image
	GRPCWebImage string `json:"grpcwebImage,omitempty"`

	// GRPCWebTag is the tag of the grpc web proxy image
	GRPCWebTag string `json:"grpcwebTag,omitempty"`

	// GRPCWebDigest is the digest tag of the grpc web proxy image
	GRPCWebDigest string `json:"grpcwebDigest,omitempty"`

	// HSMImage is the name of the hsm image
	HSMImage string `json:"hsmImage,omitempty"`

	// HSMTag is the tag of the hsm image
	HSMTag string `json:"hsmTag,omitempty"`

	// HSMDigest is the digest tag of the hsm image
	HSMDigest string `json:"hsmDigest,omitempty"`

	// EnrollerImage is the name of the init image for crypto generation
	EnrollerImage string `json:"enrollerImage,omitempty"`

	// EnrollerTag is the tag of the init image for crypto generation
	EnrollerTag string `json:"enrollerTag,omitempty"`

	// EnrollerDigest is the digest tag of the init image for crypto generation
	EnrollerDigest string `json:"enrollerDigest,omitempty"`
}

OrdererImages is the list of images to be used in orderer deployment

type OtherImages

type OtherImages struct {
}

type PeerImages

type PeerImages struct {
	// PeerInitImage is the name of the peer init image
	PeerInitImage string `json:"peerInitImage,omitempty"`

	// PeerInitTag is the tag of the peer init image
	PeerInitTag string `json:"peerInitTag,omitempty"`

	// PeerInitDigest is the digest tag of the peer init image
	PeerInitDigest string `json:"peerInitDigest,omitempty"`

	// PeerImage is the name of the peer image
	PeerImage string `json:"peerImage,omitempty"`

	// PeerTag is the tag of the peer image
	PeerTag string `json:"peerTag,omitempty"`

	// PeerDigest is the digest tag of the peer image
	PeerDigest string `json:"peerDigest,omitempty"`

	// DindImage is the name of the dind image
	DindImage string `json:"dindImage,omitempty"`

	// DindTag is the tag of the dind image
	DindTag string `json:"dindTag,omitempty"`

	// DindDigest is the digest tag of the dind image
	DindDigest string `json:"dindDigest,omitempty"`

	// GRPCWebImage is the name of the grpc web proxy image
	GRPCWebImage string `json:"grpcwebImage,omitempty"`

	// GRPCWebTag is the tag of the grpc web proxy image
	GRPCWebTag string `json:"grpcwebTag,omitempty"`

	// GRPCWebDigest is the digest tag of the grpc web proxy image
	GRPCWebDigest string `json:"grpcwebDigest,omitempty"`

	// FluentdImage is the name of the fluentd logger image
	FluentdImage string `json:"fluentdImage,omitempty"`

	// FluentdTag is the tag of the fluentd logger image
	FluentdTag string `json:"fluentdTag,omitempty"`

	// FluentdDigest is the digest tag of the fluentd logger image
	FluentdDigest string `json:"fluentdDigest,omitempty"`

	// CouchDBImage is the name of the couchdb image
	CouchDBImage string `json:"couchdbImage,omitempty"`

	// CouchDBTag is the tag of the couchdb image
	CouchDBTag string `json:"couchdbTag,omitempty"`

	// CouchDBDigest is the digest tag of the couchdb image
	CouchDBDigest string `json:"couchdbDigest,omitempty"`

	// CCLauncherImage is the name of the chaincode launcher image
	CCLauncherImage string `json:"chaincodeLauncherImage,omitempty"`

	// CCLauncherTag is the tag of the chaincode launcher image
	CCLauncherTag string `json:"chaincodeLauncherTag,omitempty"`

	// CCLauncherDigest is the digest tag of the chaincode launcher image
	CCLauncherDigest string `json:"chaincodeLauncherDigest,omitempty"`

	// FileTransferImage is the name of the file transfer image
	FileTransferImage string `json:"fileTransferImage,omitempty"`

	// FileTransferTag is the tag of the file transfer image
	FileTransferTag string `json:"fileTransferTag,omitempty"`

	// FileTransferDigest is the digest tag of the file transfer image
	FileTransferDigest string `json:"fileTransferDigest,omitempty"`

	// BuilderImage is the name of the builder image
	BuilderImage string `json:"builderImage,omitempty"`

	// BuilderTag is the tag of the builder image
	BuilderTag string `json:"builderTag,omitempty"`

	// BuilderDigest is the digest tag of the builder image
	BuilderDigest string `json:"builderDigest,omitempty"`

	// GoEnvImage is the name of the goenv image
	GoEnvImage string `json:"goEnvImage,omitempty"`

	// GoEnvTag is the tag of the goenv image
	GoEnvTag string `json:"goEnvTag,omitempty"`

	// GoEnvDigest is the digest tag of the goenv image
	GoEnvDigest string `json:"goEnvDigest,omitempty"`

	// JavaEnvImage is the name of the javaenv image
	JavaEnvImage string `json:"javaEnvImage,omitempty"`

	// JavaEnvTag is the tag of the javaenv image
	JavaEnvTag string `json:"javaEnvTag,omitempty"`

	// JavaEnvDigest is the digest tag of the javaenv image
	JavaEnvDigest string `json:"javaEnvDigest,omitempty"`

	// NodeEnvImage is the name of the nodeenv image
	NodeEnvImage string `json:"nodeEnvImage,omitempty"`

	// NodeEnvTag is the tag of the nodeenv image
	NodeEnvTag string `json:"nodeEnvTag,omitempty"`

	// NodeEnvDigest is the digest tag of the nodeenv image
	NodeEnvDigest string `json:"nodeEnvDigest,omitempty"`

	// HSMImage is the name of the hsm image
	HSMImage string `json:"hsmImage,omitempty"`

	// HSMTag is the tag of the hsm image
	HSMTag string `json:"hsmTag,omitempty"`

	// HSMDigest is the digest tag of the hsm image
	HSMDigest string `json:"hsmDigest,omitempty"`

	// EnrollerImage is the name of the init image for crypto generation
	EnrollerImage string `json:"enrollerImage,omitempty"`

	// EnrollerTag is the tag of the init image for crypto generation
	EnrollerTag string `json:"enrollerTag,omitempty"`

	// EnrollerDigest is the digest tag of the init image for crypto generation
	EnrollerDigest string `json:"enrollerDigest,omitempty"`
}

PeerImages is the list of images to be used in peer deployment

type Resources

type Resources struct {
	Peer    *current.PeerResources    `json:"peer"`
	CA      *current.CAResources      `json:"ca"`
	Orderer *current.OrdererResources `json:"orderer"`
}

type ServiceConfig

type ServiceConfig struct {
	Type corev1.ServiceType `json:"type"`
}

type Storage

type Storage struct {
	Peer    *current.PeerStorages    `json:"peer"`
	CA      *current.CAStorages      `json:"ca"`
	Orderer *current.OrdererStorages `json:"orderer"`
}

type TLSConfig

type TLSConfig struct {
	Enabled       bool   `json:"enabled"`
	ListenAddress string `json:"listenaddress"`
	CertPath      string `json:"certpath"`
	KeyPath       string `json:"keypath"`
}

TLSConfig is to configure the tls server

type Timeouts

type Timeouts struct {
	Deployment          int `json:"componentDeploy"`
	APIServer           int `json:"apiServer"`
	OrdererFailureCount int `json:"ordererFailureCount"`
}

type VersionCA

type VersionCA struct {
	Default bool     `json:"default"`
	Version string   `json:"version"`
	Image   CAImages `json:"image,omitempty"`
}

type VersionOrderer

type VersionOrderer struct {
	Default bool          `json:"default"`
	Version string        `json:"version"`
	Image   OrdererImages `json:"image,omitempty"`
}

type VersionPeer

type VersionPeer struct {
	Default bool       `json:"default"`
	Version string     `json:"version"`
	Image   PeerImages `json:"image,omitempty"`
}

type Versions

type Versions struct {
	CA      map[string]VersionCA      `json:"ca"`
	Peer    map[string]VersionPeer    `json:"peer"`
	Orderer map[string]VersionOrderer `json:"orderer"`
}

Jump to

Keyboard shortcuts

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