config

package
v1.0.106 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package config parses config and plugin configuration files. It provides APIs to read and write config files and manage multiple profiles.

Index

Constants

View Source
const DefaultProfile = "default"

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	Type   string
	Config map[string]interface{}
}

AuthConfig with metadata used for authenticating the caller.

type Config

type Config struct {
	Uri          *url.URL
	Organization string
	Tenant       string
	Parameter    map[string]string
	Header       map[string]string
	Auth         AuthConfig
	Insecure     bool
	Debug        bool
	Output       string
	Version      string
}

The Config structure holds the config data from the selected profile.

func (Config) ClientId

func (c Config) ClientId() string

func (Config) ClientSecret

func (c Config) ClientSecret() string

func (Config) ConfigureCredentialsAuth

func (c Config) ConfigureCredentialsAuth(clientId string, clientSecret string) bool

func (Config) ConfigureLoginAuth

func (c Config) ConfigureLoginAuth(clientId string, redirectUri string, scopes string) bool

func (*Config) ConfigureOrgTenant

func (c *Config) ConfigureOrgTenant(organization string, tenant string) bool

func (Config) ConfigurePatAuth

func (c Config) ConfigurePatAuth(pat string) bool

func (Config) Pat

func (c Config) Pat() string

func (Config) RedirectUri

func (c Config) RedirectUri() string

func (Config) Scopes

func (c Config) Scopes() string

func (Config) SetAuthGrantType

func (c Config) SetAuthGrantType(grantType string)

func (Config) SetAuthProperty

func (c Config) SetAuthProperty(key string, value string)

func (Config) SetAuthScopes

func (c Config) SetAuthScopes(scopes string)

func (*Config) SetDebug

func (c *Config) SetDebug(debug bool)

func (Config) SetHeader

func (c Config) SetHeader(key string, value string)

func (*Config) SetInsecure

func (c *Config) SetInsecure(insecure bool)

func (Config) SetParameter

func (c Config) SetParameter(key string, value string)

func (*Config) SetUri

func (c *Config) SetUri(uri string) error

func (*Config) SetVersion

func (c *Config) SetVersion(version string)

type ConfigFileStore

type ConfigFileStore struct {
	// contains filtered or unexported fields
}

ConfigFileStore reads and writes the configuration file

The config store is looking for the config file in "$HOME/.uipath/config" path.

func NewConfigFileStore

func NewConfigFileStore(filePath string) *ConfigFileStore

func NewConfigFileStoreWithData

func NewConfigFileStoreWithData(filePath string, data []byte) *ConfigFileStore

func (ConfigFileStore) Read

func (s ConfigFileStore) Read() ([]byte, error)

func (ConfigFileStore) Write

func (s ConfigFileStore) Write(data []byte) error

type ConfigProvider

type ConfigProvider struct {
	// contains filtered or unexported fields
}

ConfigProvider parses the config file with the profiles.

func NewConfigProvider

func NewConfigProvider(store ConfigStore) *ConfigProvider

func (ConfigProvider) Config

func (p ConfigProvider) Config(name string) *Config

func (*ConfigProvider) Load

func (p *ConfigProvider) Load() error

func (ConfigProvider) New

func (p ConfigProvider) New() Config

func (*ConfigProvider) Update

func (p *ConfigProvider) Update(profileName string, config Config) error

type ConfigStore

type ConfigStore interface {
	Read() ([]byte, error)
	Write(data []byte) error
}

ConfigStore provides an abstraction for reading and writing the config file.

Jump to

Keyboard shortcuts

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