inproc

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigID = ControllerID

ConfigID is the string used to identify this config object.

View Source
const ControllerID = "bifrost/inproc/1"

ControllerID is the controller identifier.

View Source
const TransportID = "inproc"

TransportID is the transport identifier

Variables

View Source
var Version = semver.MustParse("0.0.1")

Version is the version of the inproc implementation.

Functions

func BuildInprocController

func BuildInprocController(
	le *logrus.Entry,
	b bus.Bus,
	peerIDConstraint peer.ID,
	conf *Config,
) *transport_controller.Controller

BuildInprocController constructs the in-proc transport controller.

func NewInproc

NewInproc builds a new Inproc transport. Yields Links to other Inproc transports.

func ParseAddr

func ParseAddr(addr string) (net.Addr, error)

ParseAddr parses an address.

Types

type Addr

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

func NewAddr

func NewAddr(peerID peer.ID) *Addr

NewAddr builds a new Addr

func (*Addr) Network

func (a *Addr) Network() string

func (*Addr) String

func (a *Addr) String() string

type Config

type Config struct {
	// TransportPeerID sets the peer ID to attach the transport to.
	// If unset, attaches to any running peer with a private key.
	TransportPeerId string `protobuf:"bytes,1,opt,name=transport_peer_id,json=transportPeerId,proto3" json:"transport_peer_id,omitempty"`
	// PacketOpts are options to set on the packet connection.
	PacketOpts *pconn.Opts `protobuf:"bytes,2,opt,name=packet_opts,json=packetOpts,proto3" json:"packet_opts,omitempty"`
	// Dialers maps peer IDs to dialers.
	Dialers              map[string]*dialer.DialerOpts `` /* 155-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}                      `json:"-"`
	XXX_unrecognized     []byte                        `json:"-"`
	XXX_sizecache        int32                         `json:"-"`
}

Config is the configuration for the inproc testing transport.

func (*Config) Descriptor

func (*Config) Descriptor() ([]byte, []int)

func (*Config) EqualsConfig

func (c *Config) EqualsConfig(other config.Config) bool

EqualsConfig checks if the other config is equal.

func (*Config) GetConfigID

func (c *Config) GetConfigID() string

GetConfigID returns the unique string for this configuration type. This string is stored with the encoded config. Example: bifrost/transport/xbee/1

func (*Config) GetDebugVals

func (c *Config) GetDebugVals() config.DebugValues

GetDebugVals returns the directive arguments as key/value pairs. This should be something like param1="test", param2="test". This is not necessarily unique, and is primarily intended for display.

func (*Config) GetDialers

func (m *Config) GetDialers() map[string]*dialer.DialerOpts

func (*Config) GetPacketOpts

func (m *Config) GetPacketOpts() *pconn.Opts

func (*Config) GetTransportPeerId

func (m *Config) GetTransportPeerId() string

func (*Config) ParseTransportPeerID

func (c *Config) ParseTransportPeerID() (peer.ID, error)

ParseTransportPeerID parses the node peer ID if it is not empty.

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) Reset

func (m *Config) Reset()

func (*Config) SetTransportPeerId

func (c *Config) SetTransportPeerId(peerID string)

SetTransportPeerId sets the node peer ID field.

func (*Config) String

func (m *Config) String() string

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration. This is a cursory validation to see if the values "look correct."

func (*Config) XXX_DiscardUnknown

func (m *Config) XXX_DiscardUnknown()

func (*Config) XXX_Marshal

func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Config) XXX_Merge

func (m *Config) XXX_Merge(src proto.Message)

func (*Config) XXX_Size

func (m *Config) XXX_Size() int

func (*Config) XXX_Unmarshal

func (m *Config) XXX_Unmarshal(b []byte) error

type Factory

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

Factory constructs a Inproc transport.

func NewFactory

func NewFactory(bus bus.Bus) *Factory

NewFactory builds a Inproc transport factory.

func (*Factory) Construct

func (t *Factory) Construct(
	conf config.Config,
	opts controller.ConstructOpts,
) (controller.Controller, error)

Construct constructs the associated controller given configuration. The transport's identity (private key) comes from a GetNode lookup.

func (*Factory) ConstructConfig

func (t *Factory) ConstructConfig() config.Config

ConstructConfig constructs an instance of the controller configuration.

func (*Factory) GetConfigID

func (t *Factory) GetConfigID() string

GetConfigID returns the configuration ID for the controller.

func (*Factory) GetControllerID

func (t *Factory) GetControllerID() string

GetControllerID returns the unique ID for the controller.

func (*Factory) GetVersion

func (t *Factory) GetVersion() semver.Version

GetVersion returns the version of this controller.

type Inproc

type Inproc struct {
	// Transport is the packet transport
	*pconn.Transport
	// contains filtered or unexported fields
}

Inproc implements a Inproc transport.

func (*Inproc) ConnectToInproc

func (t *Inproc) ConnectToInproc(ctx context.Context, other *Inproc)

ConnectToInproc connects the inproc to a remote inproc. Will overwrite any existing connection

func (*Inproc) DisconnectInproc

func (t *Inproc) DisconnectInproc(ctx context.Context, other *Inproc)

DisconnectInproc disconnects a previously connected inproc.

Jump to

Keyboard shortcuts

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