client

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents a Microfab client.

func New

func New(url *url.URL, tlsEnabled bool) (*Client, error)

New creates a new Microfab client.

func (*Client) GetIdentity

func (c *Client) GetIdentity(organization string) (*Identity, error)

GetIdentity gets the identity for the specified organization.

func (*Client) GetOrderingService

func (c *Client) GetOrderingService() (*OrderingService, error)

GetOrderingService gets the ordering service.

func (*Client) GetOrganizations

func (c *Client) GetOrganizations() ([]string, error)

GetOrganizations gets the names of all of the organizations.

func (*Client) GetPeer

func (c *Client) GetPeer(organization string) (*Peer, error)

GetPeer gets the peer for the specified organization.

func (*Client) Ping

func (c *Client) Ping() error

Ping tests the connection to Microfab.

type Identity

type Identity struct {
	ID          string `json:"id"`
	DisplayName string `json:"display_name"`
	Type        string `json:"type"`
	Certificate []byte `json:"cert"`
	PrivateKey  []byte `json:"private_key"`
	CA          []byte `json:"ca"`
	MSPID       string `json:"msp_id"`
	Wallet      string `json:"wallet"`
}

Identity represents an identity used for managing components inside Microfab.

type Options

type Options struct {
	DefaultAuthority      string `json:"grpc.default_authority"`
	SSLTargetNameOverride string `json:"grpc.ssl_target_name_override"`
	RequestTimeout        int    `json:"request-timeout"`
}

Options represents connection options for a peer or ordering service.

type OrderingService

type OrderingService struct {
	ID                string   `json:"id"`
	DisplayName       string   `json:"display_name"`
	Type              string   `json:"type"`
	APIURL            string   `json:"api_url"`
	APIOptions        *Options `json:"api_options"`
	OperationsURL     string   `json:"operations_url"`
	OperationsOptions *Options `json:"operations_options"`
	MSPID             string   `json:"msp_id"`
	Wallet            string   `json:"wallet"`
	Identity          string   `json:"identity"`
}

OrderingService represents an ordering service running inside Microfab.

type Peer

type Peer struct {
	ID                string   `json:"id"`
	DisplayName       string   `json:"display_name"`
	Type              string   `json:"type"`
	APIURL            string   `json:"api_url"`
	APIOptions        *Options `json:"api_options"`
	ChaincodeURL      string   `json:"chaincode_url"`
	ChaincodeOptions  *Options `json:"chaincode_options"`
	OperationsURL     string   `json:"operations_url"`
	OperationsOptions *Options `json:"operations_options"`
	MSPID             string   `json:"msp_id"`
	Wallet            string   `json:"wallet"`
	Identity          string   `json:"identity"`
}

Peer represents a peer running inside Microfab.

Jump to

Keyboard shortcuts

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