config

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultOutputFolder = "built"
)

Variables

This section is empty.

Functions

func GetDefaultPath

func GetDefaultPath() string

func Init

func Init(configPath string)

func SetAccessToken added in v0.43.0

func SetAccessToken(token string) error

func SetProject

func SetProject(project string) error

func Write

func Write(config *Config) error

Write writes the configuration file in the path {USER_HOME}/.perses/config if the directory doesn't exist, the function will create it

Types

type Config

type Config struct {
	RestClientConfig perseshttp.RestConfigClient `json:"rest_client_config,omitempty" yaml:"rest_client_config,omitempty"`
	Project          string                      `json:"project,omitempty" yaml:"project,omitempty"`
	RefreshToken     string                      `json:"refresh_token,omitempty" yaml:"refresh_token,omitempty"`
	Dac              Dac                         `json:"dac,omitempty" yaml:"dac,omitempty"`
	// contains filtered or unexported fields
}
var Global *Config

func (*Config) GetAPIClient

func (c *Config) GetAPIClient() (api.ClientInterface, error)

func (*Config) SetAPIClient

func (c *Config) SetAPIClient(apiClient api.ClientInterface)

func (*Config) SetFilePath added in v0.42.0

func (c *Config) SetFilePath(filePath string)

type Dac added in v0.44.0

type Dac struct {
	// outputFolder is the folder where the dac-generated files are stored
	OutputFolder string `json:"output_folder,omitempty" yaml:"output_folder,omitempty"`
}

Dac wraps the configuration related to Dashboard-as-Code

type PublicConfig added in v0.45.0

type PublicConfig struct {
	RestClientConfig perseshttp.PublicRestConfigClient `json:"rest_client_config,omitempty" yaml:"rest_client_config,omitempty"`
	Project          string                            `json:"project,omitempty" yaml:"project,omitempty"`
	RefreshToken     secret.Hidden                     `json:"refresh_token,omitempty" yaml:"refresh_token,omitempty"`
	Dac              Dac                               `json:"dac,omitempty" yaml:"dac,omitempty"`
}

PublicConfig should be only used when displaying the config to the client

func NewPublicConfig added in v0.45.0

func NewPublicConfig(cfg *Config) *PublicConfig

Jump to

Keyboard shortcuts

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