Documentation ¶
Index ¶
- Variables
- func ByFunc(readStateFunc ReadStateFunc) sacloud.StateWaiter
- func UntilArchiveIsReady(ctx context.Context, client sacloud.ArchiveAPI, zone string, id types.ID) (*sacloud.Archive, error)
- func UntilDatabaseIsDown(ctx context.Context, client sacloud.DatabaseAPI, zone string, id types.ID) (*sacloud.Database, error)
- func UntilDatabaseIsUp(ctx context.Context, client sacloud.DatabaseAPI, zone string, id types.ID) (*sacloud.Database, error)
- func UntilDiskIsReady(ctx context.Context, client sacloud.DiskAPI, zone string, id types.ID) (*sacloud.Disk, error)
- func UntilInternetIsReady(ctx context.Context, client sacloud.InternetAPI, zone string, id types.ID) (*sacloud.Internet, error)
- func UntilLoadBalancerIsDown(ctx context.Context, client sacloud.LoadBalancerAPI, zone string, id types.ID) (*sacloud.LoadBalancer, error)
- func UntilLoadBalancerIsUp(ctx context.Context, client sacloud.LoadBalancerAPI, zone string, id types.ID) (*sacloud.LoadBalancer, error)
- func UntilMobileGatewayIsDown(ctx context.Context, client sacloud.MobileGatewayAPI, zone string, id types.ID) (*sacloud.MobileGateway, error)
- func UntilMobileGatewayIsReady(ctx context.Context, client sacloud.MobileGatewayAPI, zone string, id types.ID) (*sacloud.MobileGateway, error)
- func UntilMobileGatewayIsUp(ctx context.Context, client sacloud.MobileGatewayAPI, zone string, id types.ID) (*sacloud.MobileGateway, error)
- func UntilNFSIsDown(ctx context.Context, client sacloud.NFSAPI, zone string, id types.ID) (*sacloud.NFS, error)
- func UntilNFSIsUp(ctx context.Context, client sacloud.NFSAPI, zone string, id types.ID) (*sacloud.NFS, error)
- func UntilServerIsDown(ctx context.Context, client sacloud.ServerAPI, zone string, id types.ID) (*sacloud.Server, error)
- func UntilServerIsUp(ctx context.Context, client sacloud.ServerAPI, zone string, id types.ID) (*sacloud.Server, error)
- func UntilVPCRouterIsDown(ctx context.Context, client sacloud.VPCRouterAPI, zone string, id types.ID) (*sacloud.VPCRouter, error)
- func UntilVPCRouterIsReady(ctx context.Context, client sacloud.VPCRouterAPI, zone string, id types.ID) (*sacloud.VPCRouter, error)
- func UntilVPCRouterIsUp(ctx context.Context, client sacloud.VPCRouterAPI, zone string, id types.ID) (*sacloud.VPCRouter, error)
- type ReadStateFunc
- type SimpleStateWaiter
- func (s *SimpleStateWaiter) AsyncWaitForState(ctx context.Context) (compCh <-chan interface{}, progressCh <-chan interface{}, errorCh <-chan error)
- func (s *SimpleStateWaiter) SetPollingInterval(d time.Duration)
- func (s *SimpleStateWaiter) SetPollingTimeout(d time.Duration)
- func (s *SimpleStateWaiter) WaitForState(ctx context.Context) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ApplianceNotFoundRetryCount アプライアンスの待ち処理時に404エラーとなった場合のリトライ回数 ApplianceNotFoundRetryCount = 30 // InternetNotFoundRetryCount ルータの作成待ち処理時に404エラーとなった場合のリトライ回数 InternetNotFoundRetryCount = 360 )
Functions ¶
func ByFunc ¶ added in v2.26.0
func ByFunc(readStateFunc ReadStateFunc) sacloud.StateWaiter
ByFunc デフォルトのパラメータでSimpleStateWaiterを作成して返す
func UntilArchiveIsReady ¶
func UntilArchiveIsReady(ctx context.Context, client sacloud.ArchiveAPI, zone string, id types.ID) (*sacloud.Archive, error)
UntilArchiveIsReady コピー完了まで待機
func UntilDatabaseIsDown ¶
func UntilDatabaseIsDown(ctx context.Context, client sacloud.DatabaseAPI, zone string, id types.ID) (*sacloud.Database, error)
UntilDatabaseIsDown シャットダウンまで待機
func UntilDatabaseIsUp ¶
func UntilDatabaseIsUp(ctx context.Context, client sacloud.DatabaseAPI, zone string, id types.ID) (*sacloud.Database, error)
UntilDatabaseIsUp 起動まで待機
func UntilDiskIsReady ¶
func UntilDiskIsReady(ctx context.Context, client sacloud.DiskAPI, zone string, id types.ID) (*sacloud.Disk, error)
UntilDiskIsReady コピー完了/ディスク修正完了まで待機
func UntilInternetIsReady ¶
func UntilInternetIsReady(ctx context.Context, client sacloud.InternetAPI, zone string, id types.ID) (*sacloud.Internet, error)
UntilInternetIsReady 準備完了まで待機
func UntilLoadBalancerIsDown ¶
func UntilLoadBalancerIsDown(ctx context.Context, client sacloud.LoadBalancerAPI, zone string, id types.ID) (*sacloud.LoadBalancer, error)
UntilLoadBalancerIsDown シャットダウンまで待機
func UntilLoadBalancerIsUp ¶
func UntilLoadBalancerIsUp(ctx context.Context, client sacloud.LoadBalancerAPI, zone string, id types.ID) (*sacloud.LoadBalancer, error)
UntilLoadBalancerIsUp 起動完了まで待機
func UntilMobileGatewayIsDown ¶
func UntilMobileGatewayIsDown(ctx context.Context, client sacloud.MobileGatewayAPI, zone string, id types.ID) (*sacloud.MobileGateway, error)
UntilMobileGatewayIsDown シャットダウンまで待機
func UntilMobileGatewayIsReady ¶
func UntilMobileGatewayIsReady(ctx context.Context, client sacloud.MobileGatewayAPI, zone string, id types.ID) (*sacloud.MobileGateway, error)
UntilMobileGatewayIsReady コピー完了まで待機
func UntilMobileGatewayIsUp ¶
func UntilMobileGatewayIsUp(ctx context.Context, client sacloud.MobileGatewayAPI, zone string, id types.ID) (*sacloud.MobileGateway, error)
UntilMobileGatewayIsUp 起動まで待機
func UntilNFSIsDown ¶
func UntilNFSIsDown(ctx context.Context, client sacloud.NFSAPI, zone string, id types.ID) (*sacloud.NFS, error)
UntilNFSIsDown シャットダウンまで待機
func UntilNFSIsUp ¶
func UntilNFSIsUp(ctx context.Context, client sacloud.NFSAPI, zone string, id types.ID) (*sacloud.NFS, error)
UntilNFSIsUp 起動まで待機
func UntilServerIsDown ¶
func UntilServerIsDown(ctx context.Context, client sacloud.ServerAPI, zone string, id types.ID) (*sacloud.Server, error)
UntilServerIsDown シャットダウンまで待機
func UntilServerIsUp ¶
func UntilServerIsUp(ctx context.Context, client sacloud.ServerAPI, zone string, id types.ID) (*sacloud.Server, error)
UntilServerIsUp 起動まで待機
func UntilVPCRouterIsDown ¶
func UntilVPCRouterIsDown(ctx context.Context, client sacloud.VPCRouterAPI, zone string, id types.ID) (*sacloud.VPCRouter, error)
UntilVPCRouterIsDown シャットダウンまで待機
Types ¶
type ReadStateFunc ¶ added in v2.26.0
type SimpleStateWaiter ¶ added in v2.26.0
type SimpleStateWaiter struct { // ReadStateFunc 待つべきかの判定func // trueかつerrorが空の場合は待ち処理を完了させる ReadStateFunc ReadStateFunc // Timeout タイムアウト Timeout time.Duration // PollingInterval ポーリング間隔 PollingInterval time.Duration }
SimpleStateWaiter シンプルな待ち処理のためのsacloud.StateWaiterの実装
sacloud.StatePollingWaiterをラップし、シンプルなfuncのみで待つべきかを判定する
func (*SimpleStateWaiter) AsyncWaitForState ¶ added in v2.26.0
func (s *SimpleStateWaiter) AsyncWaitForState(ctx context.Context) (compCh <-chan interface{}, progressCh <-chan interface{}, errorCh <-chan error)
AsyncWaitForState sacloud.StateWaiterの実装
func (*SimpleStateWaiter) SetPollingInterval ¶ added in v2.26.0
func (s *SimpleStateWaiter) SetPollingInterval(d time.Duration)
SetPollingInterval sacloud.StateWaiterの実装
func (*SimpleStateWaiter) SetPollingTimeout ¶ added in v2.26.0
func (s *SimpleStateWaiter) SetPollingTimeout(d time.Duration)
SetPollingTimeout sacloud.StateWaiterの実装
func (*SimpleStateWaiter) WaitForState ¶ added in v2.26.0
func (s *SimpleStateWaiter) WaitForState(ctx context.Context) (interface{}, error)
WaitForState sacloud.StateWaiterの実装