cli

package
v0.72.3 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultEnvironments = []Environment{
	{
		Name:        "local",
		GatewayURL:  "http://localhost:6001",
		Description: "Local development environment (node-1)",
		IsActive:    true,
	},
	{
		Name:        "devnet",
		GatewayURL:  "https://devnet.orama.network",
		Description: "Development network (testnet)",
		IsActive:    false,
	},
	{
		Name:        "testnet",
		GatewayURL:  "https://testnet.orama.network",
		Description: "Test network (staging)",
		IsActive:    false,
	},
}

Default environments

Functions

func GetEnvironmentConfigPath

func GetEnvironmentConfigPath() (string, error)

GetEnvironmentConfigPath returns the path to the environment config file

func HandleAuthCommand

func HandleAuthCommand(args []string)

HandleAuthCommand handles authentication commands

func HandleConnectCommand

func HandleConnectCommand(peerAddr string, timeout time.Duration)

HandleConnectCommand handles the connect command

func HandleDevCommand added in v0.69.13

func HandleDevCommand(args []string)

HandleDevCommand handles the dev command group

func HandleEnvCommand

func HandleEnvCommand(args []string)

HandleEnvCommand handles the 'env' command and its subcommands

func HandleHealthCommand

func HandleHealthCommand(format string, timeout time.Duration)

HandleHealthCommand handles the health command

func HandlePeerIDCommand

func HandlePeerIDCommand(format string, timeout time.Duration)

HandlePeerIDCommand handles the peer-id command

func HandlePeersCommand

func HandlePeersCommand(format string, timeout time.Duration)

HandlePeersCommand handles the peers command

func HandleProdCommand added in v0.69.13

func HandleProdCommand(args []string)

HandleProdCommand handles production environment commands

func HandlePubSubCommand

func HandlePubSubCommand(args []string, format string, timeout time.Duration)

HandlePubSubCommand handles pubsub commands

func HandleQueryCommand

func HandleQueryCommand(sql, format string, timeout time.Duration)

HandleQueryCommand handles the query command

func HandleStatusCommand

func HandleStatusCommand(format string, timeout time.Duration)

HandleStatusCommand handles the status command

func InitializeEnvironments

func InitializeEnvironments() error

InitializeEnvironments initializes the environment config with defaults

func SaveEnvironmentConfig

func SaveEnvironmentConfig(envConfig *EnvironmentConfig) error

SaveEnvironmentConfig saves the environment configuration

func SwitchEnvironment

func SwitchEnvironment(name string) error

SwitchEnvironment switches to a different environment

Types

type Environment

type Environment struct {
	Name        string `json:"name"`
	GatewayURL  string `json:"gateway_url"`
	Description string `json:"description"`
	IsActive    bool   `json:"is_active"`
}

Environment represents a DeBros network environment

func GetActiveEnvironment

func GetActiveEnvironment() (*Environment, error)

GetActiveEnvironment returns the currently active environment

func GetEnvironmentByName

func GetEnvironmentByName(name string) (*Environment, error)

GetEnvironmentByName returns an environment by name

type EnvironmentConfig

type EnvironmentConfig struct {
	Environments      []Environment `json:"environments"`
	ActiveEnvironment string        `json:"active_environment"`
}

EnvironmentConfig stores all configured environments

func LoadEnvironmentConfig

func LoadEnvironmentConfig() (*EnvironmentConfig, error)

LoadEnvironmentConfig loads the environment configuration

type IPFSClusterPeerInfo added in v0.72.0

type IPFSClusterPeerInfo struct {
	PeerID string
	Addrs  []string
}

IPFSClusterPeerInfo contains IPFS Cluster peer information for cluster discovery

type IPFSPeerInfo added in v0.72.0

type IPFSPeerInfo struct {
	PeerID string
	Addrs  []string
}

IPFSPeerInfo holds IPFS peer information for configuring Peering.Peers

Jump to

Keyboard shortcuts

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