Documentation ¶
Index ¶
Constants ¶
View Source
const (
// TestPath can be used for testing purposes
TestPath = "mock_location.json"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CfgHandler ¶ added in v0.2.0
type CfgHandler struct { // Pointer to an instance of the host CLI config struct Cfg *Config // Path of the local config file FilePath string // contains filtered or unexported fields }
CfgHandler defines the fields required to manage config.
func NewHandler ¶ added in v0.2.0
func NewHandler(cfg *Config) (*CfgHandler, error)
NewHandler links the specified arguments to a new instance of config handler and returns a pointer to it.
func (*CfgHandler) Load ¶ added in v0.2.0
func (h *CfgHandler) Load() error
Load reads config values from the local config file (using the file path linked to the handler) and stores them into the linked instance of host CLI config struct.
func (*CfgHandler) Save ¶ added in v0.2.0
func (h *CfgHandler) Save() error
Save writes config values from the linked instance of host CLI config struct to the local config file (using the file path linked to the handler).
type Config ¶
type Config struct { // ServiceRegistry *ServiceRegistryConfig `json:"serviceregistry"` InstanceID string `json:"instanceId"` Name string `json:"name"` AccessToken string `json:"access_token" doc:"Bearer access token."` RefreshToken string `json:"refresh_token" doc:"Offline or refresh token."` MasAuthURL string `json:"mas_auth_url"` MasAccessToken string `json:"mas_access_token"` MasRefreshToken string `json:"mas_refresh_token"` APIUrl string `` /* 156-byte string literal not displayed */ AuthURL string `json:"auth_url" doc:"URL of the authentication server"` ClientID string `json:"client_id" doc:"OpenID client identifier."` Insecure bool `` /* 132-byte string literal not displayed */ Scopes []string `` /* 162-byte string literal not displayed */ DevPreviewEnabled bool `json:"dev_preview_enabled" doc:"Enables Developer preview commands"` }
Config is a type which describes the properties which can be in the config
func (*Config) HasServiceRegistry ¶
Click to show internal directories.
Click to hide internal directories.