types

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Broadcast support by endpoint.
	Broadcast = "broadcast"
	// Deliver support by endpoint.
	Deliver = "deliver"
	// NoID indicates that a party ID is not specified (default).
	// This allows backward compatibility with orderers that doesn't support this syntax.
	NoID = uint32(0x100000)
)

Variables

View Source
var ErrInvalidEndpoint = errors.New("invalid endpoint")

ErrInvalidEndpoint orderer endpoints error.

Functions

This section is empty.

Types

type OrdererEndpoint

type OrdererEndpoint struct {
	Host string `mapstructure:"host" json:"host,omitempty" yaml:"host,omitempty"`
	Port int    `mapstructure:"port" json:"port,omitempty" yaml:"port,omitempty"`
	// ID is the party ID.
	ID    uint32 `mapstructure:"id" json:"id,omitempty" yaml:"id,omitempty"`
	MspID string `mapstructure:"msp-id" json:"msp-id,omitempty" yaml:"msp-id,omitempty"`
	// API should be broadcast and/or deliver. Empty value means all API is supported.
	API []string `mapstructure:"api" json:"api,omitempty" yaml:"api,omitempty"`
}

OrdererEndpoint defines an orderer party's endpoint.

func ParseOrdererEndpoint

func ParseOrdererEndpoint(valueRaw string) (*OrdererEndpoint, error)

ParseOrdererEndpoint parses a string according to the following schema order (the first that succeeds). Schema 1: YAML. Schema 2: JSON. Schema 3: [id=ID,][msp-id=MspID,][broadcast,][deliver,][host=Host,][port=Port,][Host:Port].

func (*OrdererEndpoint) Address

func (e *OrdererEndpoint) Address() string

Address returns a string representation of the endpoint's address.

func (*OrdererEndpoint) String

func (e *OrdererEndpoint) String() string

String returns a deterministic representation of the endpoint.

func (*OrdererEndpoint) SupportsAPI

func (e *OrdererEndpoint) SupportsAPI(api string) bool

SupportsAPI returns true if this endpoint supports API. It also returns true if no APIs are specified, as we cannot know.

Jump to

Keyboard shortcuts

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