config

package
v0.4.18 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package config provides the configuration for Admin server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete added in v0.4.4

func Delete() error

Delete deletes the configuration file.

func Preload added in v0.4.7

func Preload(_ *cobra.Command, _ []string) error

Preload read configuration file for viper before running command

func Save added in v0.2.14

func Save(config *Config) error

Save saves the configuration to the given path.

Types

type Auth added in v0.4.7

type Auth struct {
	Token    string `json:"token"`
	Insecure bool   `json:"insecure"`
}

Auth is the authentication information.

func LoadAuth added in v0.4.7

func LoadAuth(addr string) (Auth, error)

LoadAuth loads the authentication information for the given address.

type Config added in v0.2.14

type Config struct {
	// Auths is the map of the address and the token.
	Auths map[string]Auth `json:"auths"`

	// RPCAddr is the address of the rpc server
	RPCAddr string `json:"rpcAddr"`
}

Config is the configuration of CLI.

func Load added in v0.2.14

func Load() (*Config, error)

Load loads the configuration from the given path.

func New added in v0.2.14

func New() *Config

New creates a new configuration.

Jump to

Keyboard shortcuts

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