peer

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: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PortNameOperations      = "operations"
	PortNamePeerGrpc        = "peer-api"
	PortNameGrpcWeb         = "grpcweb"
	EndpointHttpURLTemplate = "https://%s:%s"
	EndpointGrpcURLTemplate = "grpcs://%s:%s"
)
View Source
const (
	ACTIONS    = "actions"
	RESOURCES  = "resources"
	CONFIG     = "config"
	CRYPTO     = "crypto"
	ADMINCERTS = "admincerts"
	NODEOU     = "nodeou"
	VERSION    = "version"
	STORAGE    = "storage"
	STATUS     = "status"
	ENDPOINTS  = "endpoints"
	REPLICAS   = "replicas"
	HSM        = "hsm"
	ALL        = "all"
)

Supported actions for Peer

Variables

This section is empty.

Functions

This section is empty.

Types

type IBPOperatorClient

type IBPOperatorClient interface {
	GetCR(namespace string, kind string, name string, cr runtime.Object) error
	GetAllCR(namespace string, kind string, cr runtime.Object) error
	CreateCR(namespace string, kind string, cr interface{}) error
	DeleteCR(namespace string, kind string, name string) error
	UpdateCR(namespace string, kind string, name string, bytes []byte) error
	PatchCR(namespace string, kind string, name string, bytes []byte) error
}

type Kube

type Kube interface {
	GetService(namespace, name string) (*corev1.Service, error)
	GetConfigMap(namespace, name string) (*corev1.ConfigMap, error)
	DeleteAndCreateSecret(namespace string, secret *corev1.Secret) (*corev1.Secret, error)
	DeleteSecret(namespace string, name string) error
	GetPort(namespace, name string) (int32, error)
	GetPorts(namespace, name string) ([]corev1.ServicePort, error)
	CreateSecret(namespace string, secret *corev1.Secret) (*corev1.Secret, error)
}

type Peer

type Peer struct {
	Kube              Kube
	Logger            *zap.SugaredLogger
	IBPOperatorClient IBPOperatorClient
	Config            *dconfig.DeployerSettingsConfig
}

func New

func New(logger *zap.Logger, k8sClient Kube, ibpClient IBPOperatorClient, config *dconfig.DeployerSettingsConfig) *Peer

func (*Peer) CreateCR

func (peer *Peer) CreateCR(domain, sID, compName, namespace string, body []byte) (*api.Response, int, error)

func (*Peer) DeleteCR

func (peer *Peer) DeleteCR(sID, compName, namespace string, body []byte) (*api.DeleteResponse, int, error)

func (*Peer) GetAllCR

func (peer *Peer) GetAllCR(sID, namespace string) ([]api.Response, int, error)

func (*Peer) GetCR

func (peer *Peer) GetCR(section, compName, namespace, sID string) (*api.Response, int, error)

func (*Peer) GetCRResponse

func (peer *Peer) GetCRResponse(section, compName, namespace, sID string) (*api.Response, int, error)

func (*Peer) GetConfig

func (peer *Peer) GetConfig(compName, namespace string, fabricVersion string) (interface{}, error)

func (*Peer) GetConnectionProfile

func (peer *Peer) GetConnectionProfile(compName, namespace string) (*common.ConnectionProfile, error)

func (*Peer) GetIndividualResources

func (peer *Peer) GetIndividualResources(individualResources string, allResources *current.PeerResources, fabricVersion, statedb string) *current.PeerResources

func (*Peer) GetResources

func (peer *Peer) GetResources(defaults current.PeerResources, override *current.PeerResources, statedb, fabricVersion string) *current.PeerResources

func (*Peer) GetStorage

func (peer *Peer) GetStorage(defaults *dconfig.DeployerDefaults, override *current.PeerStorages) *current.PeerStorages

func (*Peer) GetUpdateResources

func (peer *Peer) GetUpdateResources(current, override *current.PeerResources) (*current.PeerResources, error)

func (*Peer) Images

func (peer *Peer) Images(version string) *current.PeerImages

func (*Peer) PatchCR

func (p *Peer) PatchCR(section, compName, namespace, sID string, body []byte) (*api.Response, int, error)

func (*Peer) UpdateCR

func (p *Peer) UpdateCR(section, compName, namespace, sID string, body []byte) (*api.Response, int, error)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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