cli

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NodeVersion = "dev"

RunNode starts a relay node. Called when pulse is run with no subcommand. NodeVersion is set by main.go from ldflags.

Functions

func ApplyFlags

func ApplyFlags(cfg *config.Config, f *FlagValues)

ApplyFlags merges CLI flags into the loaded config. Flags take precedence.

func ApplyNodeState added in v0.2.0

func ApplyNodeState(cfg *config.Config, dataDir string, explicitFlags map[string]bool)

ApplyNodeState loads state.dat and applies fields not explicitly set via CLI flags.

func CtrlDo

func CtrlDo(socketPath string, cmd interface{}) (map[string]json.RawMessage, error)

CtrlDo sends a JSON command to the daemon's control socket and returns the response.

func DecodeJoinCode added in v0.2.0

func DecodeJoinCode(code string) (relay, token, network string, err error)

DecodeJoinCode decodes a pls_ join code into relay, token, network.

func DoJoin

func DoJoin(cfg *config.Config, relayAddr, token string) error

DoJoin performs the join flow against a relay CA.

func EncodeJoinCode added in v0.2.0

func EncodeJoinCode(relay, token, network string) string

EncodeJoinCode encodes relay address, token, and network ID into a single string. Format: pls_<base64(json)>

func LoadOrInitCA

func LoadOrInitCA(dir, token string) (*node.CA, error)

LoadOrInitCA loads or creates a CA from the given directory.

func PrintUsage

func PrintUsage()

func ResolveDataDir

func ResolveDataDir(dataDir string) string

ResolveDataDir resolves the data directory from flags or defaults.

func RunACL

func RunACL(args []string)

func RunBulk added in v0.2.0

func RunBulk(args []string)

func RunCA

func RunCA(args []string)

func RunCASign

func RunCASign(args []string)

func RunCert

func RunCert(args []string)

func RunCompletion added in v0.2.0

func RunCompletion(args []string)

func RunConnect

func RunConnect(args []string)

func RunDNS

func RunDNS(args []string)

func RunEvents added in v0.1.8

func RunEvents(args []string)

func RunForward

func RunForward(args []string)

func RunGroups added in v0.2.0

func RunGroups(args []string)

func RunID

func RunID(args []string)

func RunInvite added in v0.2.0

func RunInvite(args []string)

func RunJoin

func RunJoin(args []string)

func RunLogs added in v0.1.8

func RunLogs(args []string)

func RunMeshIP added in v0.2.0

func RunMeshIP(args []string)

func RunNode

func RunNode(args []string)

func RunPin added in v0.2.0

func RunPin(args []string)

func RunRemoteConfig added in v0.2.2

func RunRemoteConfig(args []string)

func RunRestart added in v0.2.0

func RunRestart(args []string)

func RunRevoke

func RunRevoke(args []string)

func RunRoute

func RunRoute(args []string)

func RunSetName

func RunSetName(args []string)

func RunStart

func RunStart(args []string)

func RunStats added in v0.1.8

func RunStats(args []string)

func RunStatus

func RunStatus(args []string)

func RunStop

func RunStop(args []string)

func RunTag

func RunTag(args []string)

func RunTemplate added in v0.2.0

func RunTemplate(args []string)

func RunToken

func RunToken(args []string)

func RunTop

func RunTop(args []string)

func RunUnpin added in v0.2.0

func RunUnpin(args []string)

func RunUntag

func RunUntag(args []string)

func SocketPath

func SocketPath(args []string) string

SocketPath resolves the control socket path from flags or defaults.

Types

type FlagValues added in v0.2.2

type FlagValues struct {
	Addr          string
	Listen        string
	TCP           string
	DataDir       string
	NetworkID     string
	JoinAddr      string
	JoinToken     string
	CAEnabled     bool
	CAToken       string
	SOCKSEnabled  bool
	SOCKSListen   string
	DNSEnabled    bool
	DNSListen     string
	TunEnabled    bool
	TunQueues     int
	FECEnabled    bool
	ScribeEnabled bool
	ScribeListen  string
	ExitEnabled   bool
	ExitCIDRs     string
	MeshCIDR      string
}

FlagValues holds all the CLI flag values for running a node.

func NodeFlags

func NodeFlags(fs *flag.FlagSet) *FlagValues

NodeFlags registers all flags for running a node on the given FlagSet.

Jump to

Keyboard shortcuts

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