config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package config contains a JSON-serializable configuration file for use by the CLI tooling. This is a separate package to allow a browser-based user to download a ready-to-run configuration file from the server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DefaultTenant *tenant.ID
	Host          string
	Insecure      bool
	Session       *session.Session
	Token         string
}

Config contains the JSON-serializable configuration data.

func (*Config) Clone

func (c *Config) Clone() *Config

Clone returns a deep copy of the Config.

func (*Config) ConfigureHostname

func (c *Config) ConfigureHostname(urlString string, requirePassword bool) (*url.URL, error)

ConfigureHostname parses the given host as a URL and updates the Host and Insecure fields. The url must include a username and may include a password. If no password is provided, then one will be read in a secure fashion from the console.

func (*Config) ConfigureSession

func (c *Config) ConfigureSession(sn *session.Session, tkn *token.Token)

ConfigureSession extracts the elements from the IssueResponse.

func (*Config) WriteTo

func (c *Config) WriteTo(w io.Writer) (int64, error)

WriteTo writes the configuration to the given writer.

func (*Config) WriteToFile

func (c *Config) WriteToFile(out string) error

WriteToFile writes the configuration to disk. This method will create any necessary directories.

Jump to

Keyboard shortcuts

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