helpers

package
v0.0.0-...-b6514ef Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddData

func AddData(filename string, connProfilePath string, networkName string, query QueryType, mspId string) error

func CheckIfFileOrDirectoryExists

func CheckIfFileOrDirectoryExists(path string) (bool, error)

func FabricHelper

func FabricHelper(gni GatewayNetworkInterface, channel string, contractName string, connProfilePath string, networkName string, mspId string, userString string) (*gateway.Gateway, *gateway.Contract, *gateway.Wallet, error)

func GenerateAccessControl

func GenerateAccessControl(channel, contractName, connProfilePath, networkName, templatePath, mspId, userString string) error

func GenerateMembership

func GenerateMembership(channel, contractName, connProfilePath, networkName, mspId, userString string) error

func GenerateVerificationPolicy

func GenerateVerificationPolicy(channel, contractName, connProfilePath, networkName, templatePath, mspId, userString string) error

func GetCredentialPath

func GetCredentialPath() string

func GetCurrentNetworkCredentialPath

func GetCurrentNetworkCredentialPath(networkId string) string

func GetIdentityFromWallet

func GetIdentityFromWallet(wallet *gateway.Wallet, userString string) (*gateway.X509Identity, error)

func GetKeyAndCertForRemoteRequestbyUserName

func GetKeyAndCertForRemoteRequestbyUserName(wallet *gateway.Wallet, username string) (string, string, error)

func Invoke

func Invoke(query QueryType, connProfilePath string, networkName string, mspId string, userString string) ([]byte, error)

func Query

func Query(query QueryType, connProfilePath string, networkName string, mspId string, userString string) ([]byte, error)

Types

type AccessControlPolicy

type AccessControlPolicy struct {
	SecurityDomain string `json:"securityDomain"`
	Rules          []Rule `json:"rules"`
}

type GatewayNetworkInterface

type GatewayNetworkInterface interface {
	GetNetwork(*gateway.Gateway, string) (*gateway.Network, error)
}

func NewGatewayNetworkInterface

func NewGatewayNetworkInterface() GatewayNetworkInterface

type Identifier

type Identifier struct {
	Pattern string                 `json:"pattern"`
	Policy  IdentifierAccessPolicy `json:"policy"`
}

type IdentifierAccessPolicy

type IdentifierAccessPolicy struct {
	Type     string   `json:"type"`
	Criteria []string `json:"criteria"`
}

type Member

type Member struct {
	Value string   `json:"value"`
	Type  string   `json:"type"`
	Chain []string `json:"chain"`
}

type Membership

type Membership struct {
	SecurityDomain string            `json:"securityDomain"`
	Members        map[string]Member `json:"members"`
}

type NetworkConfig

type NetworkConfig struct {
	RelayEndPoint   string `json:"relayEndPoint"`
	ConnProfilePath string `json:"connProfilePath"`
	MspId           string `json:"mspId"`
	ChannelName     string `json:"channelName"`
	Chaincode       string `json:"chaincode"`
}

func GetNetworkConfig

func GetNetworkConfig(networkId string) (NetworkConfig, error)

type QueryType

type QueryType struct {
	ContractName string   `json:"contractName"`
	Channel      string   `json:"channel"`
	CcFunc       string   `json:"ccFunc"`
	Args         []string `json:"args"`
}

type Rule

type Rule struct {
	Principal     string `json:"principal"`
	PrincipalType string `json:"principalType"`
	Resource      string `json:"resource"`
	Read          bool   `json:"read"`
}

type VerificationPolicy

type VerificationPolicy struct {
	SecurityDomain string       `json:"securityDomain"`
	Identifiers    []Identifier `json:"identifiers"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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