Documentation
¶
Index ¶
- Variables
- func GenerateBootstrapConfig(name, id string, listenPort, rqliteHTTPPort, rqliteRaftPort int) string
- func GenerateGatewayConfig(bootstrapPeers string) string
- func GenerateNodeConfig(name, id string, listenPort, rqliteHTTPPort, rqliteRaftPort int, ...) string
- func GetEnvironmentConfigPath() (string, error)
- func HandleAuthCommand(args []string)
- func HandleConfigCommand(args []string)
- func HandleConnectCommand(peerAddr string, timeout time.Duration)
- func HandleEnvCommand(args []string)
- func HandleHealthCommand(format string, timeout time.Duration)
- func HandlePeerIDCommand(format string, timeout time.Duration)
- func HandlePeersCommand(format string, timeout time.Duration)
- func HandlePubSubCommand(args []string, format string, timeout time.Duration)
- func HandleQueryCommand(sql, format string, timeout time.Duration)
- func HandleServiceCommand(args []string)
- func HandleSetupCommand(args []string)
- func HandleStatusCommand(format string, timeout time.Duration)
- func InitializeEnvironments() error
- func SaveEnvironmentConfig(envConfig *EnvironmentConfig) error
- func SwitchEnvironment(name string) error
- type Environment
- type EnvironmentConfig
Constants ¶
This section is empty.
Variables ¶
var DefaultEnvironments = []Environment{ { Name: "local", GatewayURL: "http://localhost:6001", Description: "Local development environment", IsActive: true, }, { Name: "devnet", GatewayURL: "https://devnet.debros.network", Description: "Development network (testnet)", IsActive: false, }, { Name: "testnet", GatewayURL: "https://testnet.debros.network", Description: "Test network (staging)", IsActive: false, }, }
Default environments
Functions ¶
func GenerateBootstrapConfig ¶
func GenerateBootstrapConfig(name, id string, listenPort, rqliteHTTPPort, rqliteRaftPort int) string
GenerateBootstrapConfig generates a bootstrap configuration
func GenerateGatewayConfig ¶
GenerateGatewayConfig generates a gateway configuration
func GenerateNodeConfig ¶
func GenerateNodeConfig(name, id string, listenPort, rqliteHTTPPort, rqliteRaftPort int, joinAddr, bootstrapPeers string) string
GenerateNodeConfig generates a node configuration
func GetEnvironmentConfigPath ¶
GetEnvironmentConfigPath returns the path to the environment config file
func HandleAuthCommand ¶
func HandleAuthCommand(args []string)
HandleAuthCommand handles authentication commands
func HandleConfigCommand ¶
func HandleConfigCommand(args []string)
HandleConfigCommand handles config management commands
func HandleConnectCommand ¶
HandleConnectCommand handles the connect command
func HandleEnvCommand ¶
func HandleEnvCommand(args []string)
HandleEnvCommand handles the 'env' command and its subcommands
func HandleHealthCommand ¶
HandleHealthCommand handles the health command
func HandlePeerIDCommand ¶
HandlePeerIDCommand handles the peer-id command
func HandlePeersCommand ¶
HandlePeersCommand handles the peers command
func HandlePubSubCommand ¶
HandlePubSubCommand handles pubsub commands
func HandleQueryCommand ¶
HandleQueryCommand handles the query command
func HandleServiceCommand ¶
func HandleServiceCommand(args []string)
HandleServiceCommand handles systemd service management commands
func HandleSetupCommand ¶
func HandleSetupCommand(args []string)
HandleSetupCommand handles the interactive 'setup' command for VPS installation
func HandleStatusCommand ¶
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 ¶
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