utils

package
Version: v0.0.0-...-667e438 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrRegistrationRequired Registration to the Membership Service required.
	ErrRegistrationRequired = errors.New("Registration to the Membership Service required.")

	// ErrNotInitialized Initialization required
	ErrNotInitialized = errors.New("Initialization required.")

	// ErrAlreadyInitialized Already initialized
	ErrAlreadyInitialized = errors.New("Already initialized.")

	// ErrAlreadyRegistered Already registered
	ErrAlreadyRegistered = errors.New("Already registered.")

	// ErrTransactionMissingCert Transaction missing certificate or signature
	ErrTransactionMissingCert = errors.New("Transaction missing certificate or signature.")

	// ErrInvalidTransactionSignature Invalid Transaction Signature
	ErrInvalidTransactionSignature = errors.New("Invalid Transaction Signature.")

	// ErrTransactionCertificate Missing Transaction Certificate
	ErrTransactionCertificate = errors.New("Missing Transaction Certificate.")

	// ErrTransactionSignature Missing Transaction Signature
	ErrTransactionSignature = errors.New("Missing Transaction Signature.")

	// ErrInvalidSignature Invalid Signature
	ErrInvalidSignature = errors.New("Invalid Signature.")

	// ErrInvalidKey Invalid key
	ErrInvalidKey = errors.New("Invalid key.")

	// ErrInvalidReference Invalid reference
	ErrInvalidReference = errors.New("Invalid reference.")

	// ErrNilArgument Invalid reference
	ErrNilArgument = errors.New("Nil argument.")

	// ErrNotImplemented Not implemented
	ErrNotImplemented = errors.New("Not implemented.")

	// ErrKeyStoreAlreadyInitialized Keystore already Initilized
	ErrKeyStoreAlreadyInitialized = errors.New("Keystore already Initilized.")

	// ErrEncrypt Encryption failed
	ErrEncrypt = errors.New("Encryption failed.")

	// ErrDecrypt Decryption failed
	ErrDecrypt = errors.New("Decryption failed.")

	// ErrDifferentChaincodeID ChaincodeIDs are different
	ErrDifferentChaincodeID = errors.New("ChaincodeIDs are different.")

	// ErrDifferrentConfidentialityProtocolVersion different confidentiality protocol versions
	ErrDifferrentConfidentialityProtocolVersion = errors.New("Confidentiality protocol versions are different.")

	// ErrInvalidConfidentialityLevel Invalid confidentiality level
	ErrInvalidConfidentialityLevel = errors.New("Invalid confidentiality level")

	// ErrInvalidConfidentialityProtocol Invalid confidentiality level
	ErrInvalidConfidentialityProtocol = errors.New("Invalid confidentiality protocol")

	// ErrInvalidTransactionType Invalid transaction type
	ErrInvalidTransactionType = errors.New("Invalid transaction type")

	// ErrInvalidProtocolVersion Invalid protocol version
	ErrInvalidProtocolVersion = errors.New("Invalid protocol version")
)

Functions

func Clone

func Clone(src []byte) []byte

Clone clones the passed slice

func DecodeBase64

func DecodeBase64(in string) ([]byte, error)

DecodeBase64 decodes from Base64

func DirEmpty

func DirEmpty(path string) (bool, error)

DirEmpty checks if a directory is empty

func DirExists

func DirExists(path string) (bool, error)

DirExists checks if a directory exists

func DirMissingOrEmpty

func DirMissingOrEmpty(path string) (bool, error)

DirMissingOrEmpty checks is a directory is missin or empty

func EncodeBase64

func EncodeBase64(in []byte) string

EncodeBase64 encodes to Base64

func ErrToString

func ErrToString(err error) string

ErrToString converts and error to a string. If the error is nil, it returns the string "<clean>"

func FileMissing

func FileMissing(path string, name string) (bool, error)

FileMissing checks if a file is missing

func FilePathMissing

func FilePathMissing(path string) (bool, error)

FilePathMissing returns true if the path is missing, false otherwise.

func IntArrayEquals

func IntArrayEquals(a []int, b []int) bool

IntArrayEquals checks if the arrays of ints are the same

Types

type NodeConfiguration

type NodeConfiguration struct {
	Type string
	Name string
}

NodeConfiguration used for testing

func (*NodeConfiguration) GetEnrollmentID

func (conf *NodeConfiguration) GetEnrollmentID() string

GetEnrollmentID returns the enrollment ID

func (*NodeConfiguration) GetEnrollmentPWD

func (conf *NodeConfiguration) GetEnrollmentPWD() string

GetEnrollmentPWD returns the enrollment PWD

type ObjIdIndex

type ObjIdIndex struct {
	// contains filtered or unexported fields
}

func (*ObjIdIndex) AddItem

func (i *ObjIdIndex) AddItem(v interface{}, objid asn1.ObjectIdentifier)

func (*ObjIdIndex) GetItem

func (i *ObjIdIndex) GetItem(objid asn1.ObjectIdentifier) (interface{}, bool, asn1.ObjectIdentifier)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL