config

package
v0.22.150 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 2 Imported by: 20 modules, 16 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Region is the region of backend service
	// See also <https://docs.ucloud.cn/api/summary/regionlist> ...
	Region string `default:""`

	// Zone is the zone of backend service
	// See also <https://docs.ucloud.cn/api/summary/regionlist> ...
	Zone string `default:""`

	// ProjectId is the unique identify of project, used for organize resources,
	// Most of resources should belong to a project.
	// Sub-Account must have an project id.
	// See also <https://docs.ucloud.cn/api/summary/get_project_list> ...
	ProjectId string `default:""`

	// BaseUrl is the url of backend api
	// See also <doc link> ...
	BaseUrl string `default:"https://api.ucloud.cn"`

	// UserAgent is an attribute for sdk client, used for distinguish who is using sdk.
	// See also https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent
	// It will be appended to the end of sdk user-agent.
	// eg. "Terraform/0.10.1" -> "GO/1.9.1 GO-SDK/0.1.0 Terraform/0.10.1"
	// NOTE: it will conflict with the User-Agent of HTTPHeaders
	UserAgent string `default:""`

	// Timeout is timeout for every request.
	Timeout time.Duration `default:"30s"`

	// MaxRetries is the number of max retry times.
	// Set MaxRetries more than 0 to enable auto-retry for network and service availability problem
	// if auto-retry is enabled, it will enable default retry policy using exponential backoff.
	MaxRetries int `default:"0"`

	// LogLevel is equal to logrus level,
	// if logLevel not be set, use INFO level as default.
	LogLevel log.Level `default:"log.InfoLevel"`
	// contains filtered or unexported fields
}

Config is the config of ucloud sdk, use for setting up client

func NewConfig

func NewConfig() Config

NewConfig will return a new client config with default options.

func (*Config) GetActionLevel

func (c *Config) GetActionLevel(action string) log.Level

GetActionLevel will return the log level of action

func (*Config) SetActionLevel

func (c *Config) SetActionLevel(action string, level log.Level)

SetActionLevel will return the log level of action

Jump to

Keyboard shortcuts

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