api

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 12 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserAgent = fmt.Sprintf(
	"sacloud/iaas-api-go/v%s (%s/%s; +https://github.com/sacloud/iaas-api-go) %s",
	iaas.Version,
	runtime.GOOS,
	runtime.GOARCH,
	client.DefaultUserAgent,
)

Functions

func NewCaller

func NewCaller() (iaas.APICaller, error)

func NewCallerWithOptions

func NewCallerWithOptions(opts *CallerOptions) iaas.APICaller

NewCallerWithOptions 指定のオプションでiaas.APICallerを構築して返す

func SetupFakeDefaults

func SetupFakeDefaults()

Types

type CallerOptions

type CallerOptions struct {
	*client.Options

	APIRootURL  string
	DefaultZone string
	Zones       []string

	TraceAPI      bool
	FakeMode      bool
	FakeStorePath string
}

CallerOptions iaas.APICallerを作成する際のオプション

func DefaultOption

func DefaultOption() (*CallerOptions, error)

DefaultOption 環境変数、プロファイルからCallerOptionsを組み立てて返す

プロファイルは環境変数`SAKURACLOUD_PROFILE`または`USACLOUD_PROFILE`でプロファイル名が指定されていればそちらを優先し、 未指定の場合は通常のプロファイル処理(~/.usacloud/currentファイルから読み込み)される。 同じ項目を複数箇所で指定していた場合、環境変数->プロファイルの順で上書きされたものが返される

func DefaultOptionWithProfile

func DefaultOptionWithProfile(profileName string) (*CallerOptions, error)

DefaultOptionWithProfile 環境変数、プロファイルからCallerOptionsを組み立てて返す

プロファイルは引数を優先し、空の場合は環境変数`SAKURACLOUD_PROFILE`または`USACLOUD_PROFILE`が利用され、 それも空の場合は通常のプロファイル処理(~/.usacloud/currentファイルから読み込み)される。 同じ項目を複数箇所で指定していた場合、環境変数->プロファイルの順で上書きされたものが返される

func MergeOptions

func MergeOptions(opts ...*CallerOptions) *CallerOptions

MergeOptions 指定のCallerOptionsの非ゼロ値フィールドをoのコピーにマージして返す

func OptionsFromEnv

func OptionsFromEnv() *CallerOptions

OptionsFromEnv 環境変数からCallerOptionsを組み立てて返す

func OptionsFromProfile

func OptionsFromProfile(profileName string) (*CallerOptions, error)

OptionsFromProfile 指定のプロファイルからCallerOptionsを組み立てて返す プロファイル名に空文字が指定された場合はカレントプロファイルが利用される

Jump to

Keyboard shortcuts

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