config

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractProjectIDFromToken

func ExtractProjectIDFromToken(token string) string

ExtractProjectIDFromToken extracts the project ID from a token Token format: additionalData--projectID

func GetStoredClientID

func GetStoredClientID() (string, error)

GetStoredClientID reads the client ID from the storage file

Types

type ClientConfig

type ClientConfig struct {
	Name  string `mapstructure:"name"`
	BGP   *bool  `mapstructure:"bgp"` // Pointer to detect if explicitly set
	Cloud string `mapstructure:"cloud"`
}

ClientConfig holds client-specific configuration

type Config

type Config struct {
	Server  ServerConfig  `mapstructure:"server"`
	Logging LoggingConfig `mapstructure:"logging"`
	Client  ClientConfig  `mapstructure:"client"`
}

Config holds all application configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a default configuration

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig loads configuration from file

type LoggingConfig

type LoggingConfig struct {
	Level  string `mapstructure:"level"`
	Format string `mapstructure:"format"`
}

LoggingConfig holds logging configuration

type ServerConfig

type ServerConfig struct {
	Host               string `mapstructure:"host"`
	Port               int    `mapstructure:"port"`
	Token              string `mapstructure:"token"`
	TLS                bool   `mapstructure:"tls"`
	InsecureSkipVerify bool   `mapstructure:"insecure_skip_verify"`
	Timeout            string `mapstructure:"timeout"`
}

ServerConfig holds GRPC server configuration

Jump to

Keyboard shortcuts

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