Help us shape the future of Go! Take the 2026 Go Developer Survey

cli

package
v0.57.24 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DefaultPipeProtocolID = "/pipe/stream"

DefaultPipeProtocolID is the default protocol ID for pipe streams.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientArgs

type ClientArgs struct {
	// DialConf is the dialing configuration.
	DialConf stream_api_dial.Config
	// ForwardingConf is the forwarding configuration.
	ForwardingConf stream_forwarding.Config
	// IdentifyConf is the identify configuration
	IdentifyConf peer_controller.Config
	// SubscribeConf is the configuration for the publish or subscribe call.
	SubscribeConf pubsub_api.SubscribeRequest
	// AcceptConf is the accept configuration.
	AcceptConf stream_api_accept.Config
	// ListeningConf is the listening configuration.
	ListeningConf stream_listening.Config
	// CbusConf is the controller-bus configuration.
	CbusConf cbus_cli.ClientArgs

	// DialAddr is the address to dial.
	DialAddr string

	// IdentifyKeyPath is the path to the key to read.
	IdentifyKeyPath string
	// IdentifyGenKey indicates we should generate the key if it doesn't exist.
	IdentifyGenKey bool

	// RemotePeerIdsCsv are the set of remote peer IDs to connect to.
	RemotePeerIdsCsv string
	// contains filtered or unexported fields
}

ClientArgs contains the client arguments and functions.

func (*ClientArgs) BuildBifrostCommand

func (a *ClientArgs) BuildBifrostCommand() *cli.Command

BuildBifrostCommand returns the controller-bus sub-command set.

func (*ClientArgs) BuildClient

func (a *ClientArgs) BuildClient() (bifrost_api.BifrostAPIClient, error)

BuildClient builds the client or returns it if it has been set.

func (*ClientArgs) BuildCommands

func (a *ClientArgs) BuildCommands() []*cli.Command

BuildCommands attaches the commands.

func (*ClientArgs) BuildFlags

func (a *ClientArgs) BuildFlags() []cli.Flag

BuildFlags attaches the flags to a flag set.

func (*ClientArgs) GetContext

func (a *ClientArgs) GetContext() context.Context

GetContext returns the context.

func (*ClientArgs) LoadOrGenerateIdentifyKey

func (a *ClientArgs) LoadOrGenerateIdentifyKey() ([]byte, crypto.PrivKey, error)

LoadOrGenerateIdentifyKey loads or generates the IdentifyKeyPath.

func (*ClientArgs) ParseRemotePeerIdsCsv

func (a *ClientArgs) ParseRemotePeerIdsCsv() []string

ParseRemotePeerIdsCsv parses the RemotePeerIdsCsv field.

func (*ClientArgs) RunAccept

func (a *ClientArgs) RunAccept(*cli.Context) error

RunAccept runs the accept command.

func (*ClientArgs) RunDial

func (a *ClientArgs) RunDial(*cli.Context) error

RunDial runs the dial command.

func (*ClientArgs) RunForwarding

func (a *ClientArgs) RunForwarding(_ *cli.Context) error

RunForwarding runs the forwarding command.

func (*ClientArgs) RunIdentifyController

func (a *ClientArgs) RunIdentifyController(_ *cli.Context) error

RunIdentifyController runs an identify controller.

func (*ClientArgs) RunListen

func (a *ClientArgs) RunListen(*cli.Context) error

RunListen runs the listen command.

func (*ClientArgs) RunPeerInfo

func (a *ClientArgs) RunPeerInfo(_ *cli.Context) error

RunPeerInfo runs the peer information command.

func (*ClientArgs) RunSubscribe

func (a *ClientArgs) RunSubscribe(_ *cli.Context) error

RunSubscribe runs the subscription command.

func (*ClientArgs) SetClient

func (a *ClientArgs) SetClient(client bifrost_api.BifrostAPIClient)

SetClient sets the client instance.

func (*ClientArgs) SetContext

func (a *ClientArgs) SetContext(c context.Context)

SetContext sets the context.

type DaemonArgs

type DaemonArgs struct {
	// WebsocketListen is the listen address for the WebSocket transport.
	WebsocketListen string
	// UDPListen is the listen address for the UDP transport.
	UDPListen string
	// HoldOpenLinks holds open links without an inactivity timeout when set.
	HoldOpenLinks bool
	// Pubsub selects the pubsub provider preset by name.
	Pubsub string

	// EstablishPeers is a list of peers to establish
	// peer-id comma separated
	EstablishPeers cli.StringSlice
	// UDPPeers is a static peer list
	// peer-id@address
	UDPPeers cli.StringSlice
	// WebsocketPeers is a static peer list
	// peer-id@address
	WebsocketPeers cli.StringSlice
}

DaemonArgs contains common flags for bifrost-powered daemons.

func (*DaemonArgs) ApplyToConfigSet

func (a *DaemonArgs) ApplyToConfigSet(confSet configset.ConfigSet, overwrite bool) error

ApplyToConfigSet applies controller configurations to a config set. Map is from string descriptor to config object.

func (*DaemonArgs) BuildFlags

func (a *DaemonArgs) BuildFlags() []cli.Flag

BuildFlags attaches the flags to a flag set.

type EnvelopeArgs

type EnvelopeArgs struct {
	// KeyPaths is the list of key file paths.
	KeyPaths cli.StringSlice
	// Context is the application context string for the envelope.
	Context string
	// Threshold is the number of shares needed minus one.
	Threshold uint
	// InputPath is the input file path (default: stdin).
	InputPath string
	// OutputPath is the output file path (default: stdout).
	OutputPath string
}

EnvelopeArgs contains the arguments for envelope commands.

func (*EnvelopeArgs) BuildCommands

func (a *EnvelopeArgs) BuildCommands() []*cli.Command

BuildCommands returns the envelope subcommands.

func (*EnvelopeArgs) BuildFlags

func (a *EnvelopeArgs) BuildFlags() []cli.Flag

BuildFlags returns the common CLI flags for envelope commands.

func (*EnvelopeArgs) RunSeal

func (a *EnvelopeArgs) RunSeal(_ *cli.Context) error

RunSeal seals data into an envelope.

func (*EnvelopeArgs) RunUnseal

func (a *EnvelopeArgs) RunUnseal(c *cli.Context) error

RunUnseal unseals an envelope.

type PipeArgs

type PipeArgs struct {
	// ListenAddr is the address to listen on (server mode).
	// Example: ":5112"
	ListenAddr string
	// ConnectAddr is the address to connect to (client mode).
	// Format: "peer-id@host:port"
	ConnectAddr string
	// ProtocolID is the stream protocol ID.
	ProtocolID string
	// PrivKeyPath is the path to the private key file.
	// If empty, a key will be generated.
	PrivKeyPath string
	// Quiet suppresses status messages to stderr.
	Quiet bool
}

PipeArgs contains the arguments for the pipe command.

func (*PipeArgs) BuildFlags

func (a *PipeArgs) BuildFlags() []cli.Flag

BuildFlags returns the CLI flags for the pipe command.

func (*PipeArgs) Run

func (a *PipeArgs) Run(c *cli.Context) error

Run executes the pipe command.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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