Documentation
¶
Index ¶
- func MergeConfigFromFile(filePath string, config *Config) error
- func WriteConfigToJSON(filePath string, config *Config) error
- func WriteConfigToYAML(filePath string, config *Config) error
- func WriteServerToJSON(filePath string, server *Server) error
- func WriteServerToYAML(filePath string, server *Server) error
- type AuthProvider
- type Config
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MergeConfigFromFile ¶
MergeConfigFromFile merges the configuration from a file into the existing Config.
func WriteConfigToJSON ¶
WriteConfigToJSON writes a Config configuration to a JSON file.
func WriteConfigToYAML ¶
WriteConfigToYAML writes a Config configuration to a YAML file.
func WriteServerToJSON ¶
WriteServerToJSON writes a Server configuration to a JSON file.
func WriteServerToYAML ¶
WriteServerToYAML writes a Server configuration to a YAML file.
Types ¶
type AuthProvider ¶
type AuthProvider struct {
Type string `json:"type,omitempty" yaml:"type,omitempty"` // Type is the type of authentication provider.
Profile string `json:"profile,omitempty" yaml:"profile,omitempty"` // Profile is the profile of the authentication provider.
Parameters map[string]interface{} `json:"parameters,omitempty" yaml:"parameters,omitempty"` // Parameters are additional parameters for the authentication provider.
}
AuthProvider represents the authentication provider configuration.
type Config ¶
type Config struct {
Servers map[string]Server `json:"servers,omitempty" yaml:"servers,omitempty"` // Servers is a map of server configurations.
}
Config represents the overall configuration structure.
func ReadConfigFromJSON ¶
ReadConfigFromJSON reads a Config configuration from a JSON file.
type Server ¶
type Server struct {
Host string `json:"host,omitempty" yaml:"host,omitempty"` // Host is the Command server DNS name or IP address.
Port int `json:"port,omitempty" yaml:"port,omitempty"` // Port is the Command server port.
//AuthPort int `json:"auth_port,omitempty" yaml:"auth_port,omitempty"` // AuthPort is the authentication port.
Username string `json:"username,omitempty" yaml:"username,omitempty"` // Username is the username for authentication.
Password string `json:"password,omitempty" yaml:"password,omitempty"` // Password is the password for authentication.
Domain string `json:"domain,omitempty" yaml:"domain,omitempty"` // Domain is the domain for authentication.
ClientID string `json:"client_id,omitempty" yaml:"client_id,omitempty"` // ClientID is the client ID for OAuth.
ClientSecret string `json:"client_secret,omitempty" yaml:"client_secret,omitempty"` // ClientSecret is the client secret for OAuth.
OAuthTokenUrl string `json:"token_url,omitempty" yaml:"token_url,omitempty"` // OAuthTokenUrl is full URL for OAuth token request endpoint.
APIPath string `json:"api_path,omitempty" yaml:"api_path,omitempty"` // APIPath is the API path.
AuthProvider AuthProvider `json:"auth_provider,omitempty" yaml:"auth_provider,omitempty"` // AuthProvider contains the authentication provider details.
SkipTLSVerify bool `json:"skip_tls_verify,omitempty" yaml:"skip_tls_verify,omitempty"` // TLSVerify determines whether to verify the TLS certificate.
CACertPath string `json:"ca_cert_path,omitempty" yaml:"ca_cert_path,omitempty"` // CACertPath is the path to the CA certificate to trust.
AuthType string `json:"auth_type,omitempty" yaml:"auth_type, omitempty"` // AuthType is the type of authentication to use.
}
Server represents the server configuration for authentication.
func ReadServerFromJSON ¶
ReadServerFromJSON reads a Server configuration from a JSON file.
func ReadServerFromYAML ¶
ReadServerFromYAML reads a Server configuration from a YAML file.