config

package
v0.0.0-...-274b144 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package config provides types and functions to configure AIS CLI.

  • Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.

Index

Constants

This section is empty.

Variables

View Source
var (
	ConfigDir string

	DefaultAliasConfig = AliasConfig{

		"get":      "object get",
		"put":      "object put",
		"rmo":      "object rm",
		"prefetch": "object prefetch",

		"ls":     "bucket ls",
		"create": "bucket create",
		"cp":     "bucket cp",
		"rmb":    "bucket rm",
		"evict":  "bucket evict",

		"start":         "job start",
		"stop":          "job stop",
		"wait":          "job wait",
		apc.ActDsort:    "job start " + apc.ActDsort,
		apc.ActDownload: "job start " + apc.ActDownload,
		apc.ActBlobDl:   "job start " + apc.ActBlobDl,

		"space-cleanup": "storage cleanup",
		"scrub":         "storage validate",
	}
)

Functions

func Path

func Path() string

func Reset

func Reset() error

func Save

func Save(cfg *Config) error

Types

type AliasConfig

type AliasConfig cos.StrKVs // (see DefaultAliasConfig below)

func (AliasConfig) Str

func (a AliasConfig) Str(indent string) (s string)

func (AliasConfig) String

func (a AliasConfig) String() string

compare w/ showAliasHandler(*cli.Context)

type AuthConfig

type AuthConfig struct {
	URL string `json:"url"`
}

type ClusterConfig

type ClusterConfig struct {
	URL               string `json:"url"`
	DefaultAISHost    string `json:"default_ais_host"`
	DefaultDockerHost string `json:"default_docker_host"`
	// TLS
	Certificate   string `json:"client_crt"`     // X.509 certificate
	CertKey       string `json:"client_crt_key"` // X.509 key
	ClientCA      string `json:"client_ca_tls"`  // #6410
	SkipVerifyCrt bool   `json:"skip_verify_crt"`
}

type Config

type Config struct {
	Cluster         ClusterConfig `json:"cluster"`
	Timeout         TimeoutConfig `json:"timeout"`
	Auth            AuthConfig    `json:"auth"`
	Aliases         AliasConfig   `json:"aliases"`
	DefaultProvider string        `json:"default_provider,omitempty"` // NOTE: not supported yet (see app.go)
	NoColor         bool          `json:"no_color"`
	Verbose         bool          `json:"verbose"` // more warnings, errors with backtraces and details
	NoMore          bool          `json:"no_more"`
}

all of the above

func Load

func Load(args []string, reset string) (*Config, error)

func (*Config) WarnTLS

func (c *Config) WarnTLS(server string)

type TimeoutConfig

type TimeoutConfig struct {
	TCPTimeoutStr  string        `json:"tcp_timeout"`
	TCPTimeout     time.Duration `json:"-"`
	HTTPTimeoutStr string        `json:"http_timeout"`
	HTTPTimeout    time.Duration `json:"-"`
}

Jump to

Keyboard shortcuts

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