archive

package
v2.32.3 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	Archive sacloud.ArchiveAPI
	Zone    sacloud.ZoneAPI
}

APIClient builderが利用するAPIクライアント

func NewAPIClient

func NewAPIClient(caller sacloud.APICaller) *APIClient

NewAPIClient builderが利用するAPIクライアントを返す

type BlankArchiveBuilder

type BlankArchiveBuilder struct {
	Name         string
	Description  string
	Tags         types.Tags
	IconID       types.ID
	SizeGB       int
	SourceReader io.Reader

	NoWait bool

	Client *APIClient
}

BlankArchiveBuilder ブランクアーカイブの作成〜FTPSでのファイルアップロードを行う

func (*BlankArchiveBuilder) Build

func (b *BlankArchiveBuilder) Build(ctx context.Context, zone string) (*sacloud.Archive, error)

Build ブランクアーカイブの作成〜FTPSでのファイルアップロードを行う

func (*BlankArchiveBuilder) Validate

func (b *BlankArchiveBuilder) Validate(ctx context.Context, zone string) error

Validate 設定値の検証

type Builder

type Builder interface {
	Build(ctx context.Context, zone string) (*sacloud.Archive, error)
	Validate(ctx context.Context, zone string) error
}

Builder アーカイブビルダーが持つ共通インターフェース

type Director

type Director struct {
	Name        string
	Description string
	Tags        types.Tags
	IconID      types.ID
	SizeGB      int

	// for blank builder
	SourceReader io.Reader

	// for standard builder
	SourceDiskID    types.ID
	SourceArchiveID types.ID

	// transfer archive builder
	SourceArchiveZone string

	// for shared archive builder
	SourceSharedKey types.ArchiveShareKey

	// trueの場合アーカイブ作成完了まで待たずにreturnする。SourceReaderを指定する場合(BlankArchiveBuilder)にNoWaitをtrueにするとエラーとする
	NoWait bool

	Client *APIClient
}

Director パラメータに応じて適切なアーカイブビルダーを返す

func (*Director) Builder

func (d *Director) Builder() Builder

パラメータに応じて適切なアーカイブビルダーを返す

Note: 他ゾーンからの転送の場合、転送元/先でゾーンが同一でもエラーとならない。 このためDirectorでは転送元/先ゾーンを意識せずにSourceArchiveZoneが指定されていた場合は 一律でTransferArchiveBuilderを返す。

もしこの挙動で問題が発生する場合は呼び出し側で適切にビルダーを切り替える実装を行う必要がある。

type FromSharedArchiveBuilder

type FromSharedArchiveBuilder struct {
	Name            string
	Description     string
	Tags            types.Tags
	IconID          types.ID
	SourceSharedKey types.ArchiveShareKey

	NoWait bool
	Client *APIClient
}

FromSharedArchiveBuilder 共有アーカイブからアーカイブの作成を行う

func (*FromSharedArchiveBuilder) Build

Build 共有アーカイブからアーカイブの作成を行う

func (*FromSharedArchiveBuilder) Validate

func (b *FromSharedArchiveBuilder) Validate(ctx context.Context, zone string) error

Validate 設定値の検証

type StandardArchiveBuilder

type StandardArchiveBuilder struct {
	Name            string
	Description     string
	Tags            types.Tags
	IconID          types.ID
	SourceDiskID    types.ID
	SourceArchiveID types.ID

	NoWait bool
	Client *APIClient
}

StandardArchiveBuilder 同一アカウント/同一ゾーンのディスク/アーカイブからアーカイブの作成を行う

func (*StandardArchiveBuilder) Build

Build 同一アカウント/同一ゾーンのディスク/アーカイブからアーカイブの作成を行う

func (*StandardArchiveBuilder) Validate

func (b *StandardArchiveBuilder) Validate(ctx context.Context, zone string) error

Validate 設定値の検証

type TransferArchiveBuilder

type TransferArchiveBuilder struct {
	Name        string
	Description string
	Tags        types.Tags
	IconID      types.ID

	SourceArchiveID   types.ID
	SourceArchiveZone string

	NoWait bool
	Client *APIClient
}

TransferArchiveBuilder 共有アーカイブからアーカイブの作成を行う

func (*TransferArchiveBuilder) Build

Build 他ゾーンのアーカイブからアーカイブの作成を行う

func (*TransferArchiveBuilder) Validate

func (b *TransferArchiveBuilder) Validate(ctx context.Context, zone string) error

Validate 設定値の検証

Jump to

Keyboard shortcuts

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