async

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Creator

type Creator interface {
	FutureHandler
	Getter
	CreateOrUpdateAsync(ctx context.Context, spec azure.ResourceSpecGetter, parameters interface{}) (result interface{}, future azureautorest.FutureAPI, err error)
}

Creator is a client that can create or update a resource asynchronously.

type Deleter

type Deleter interface {
	FutureHandler
	DeleteAsync(ctx context.Context, spec azure.ResourceSpecGetter) (future azureautorest.FutureAPI, err error)
}

Deleter is a client that can delete a resource asynchronously.

type FutureHandler

type FutureHandler interface {
	// IsDone returns true if the operation is complete.
	IsDone(ctx context.Context, future azureautorest.FutureAPI) (isDone bool, err error)
	// Result returns the result of the operation.
	Result(ctx context.Context, future azureautorest.FutureAPI, futureType string) (result interface{}, err error)
}

FutureHandler is a client that can check on the progress of a future.

type FutureScope

type FutureScope interface {
	azure.AsyncStatusUpdater
}

FutureScope is a scope that can perform store futures and conditions in Status.

type Getter added in v1.2.0

type Getter interface {
	Get(ctx context.Context, spec azure.ResourceSpecGetter) (result interface{}, err error)
}

Getter is an interface that can get a resource.

type Reconciler added in v1.1.0

type Reconciler interface {
	CreateResource(ctx context.Context, spec azure.ResourceSpecGetter, serviceName string) (result interface{}, err error)
	DeleteResource(ctx context.Context, spec azure.ResourceSpecGetter, serviceName string) (err error)
}

Reconciler is a generic interface used to perform asynchronous reconciliation of Azure resources.

type Service added in v1.1.0

type Service struct {
	Scope FutureScope
	Creator
	Deleter
}

Service is an implementation of the Reconciler interface. It handles asynchronous creation and deletion of resources.

func New added in v1.1.0

func New(scope FutureScope, createClient Creator, deleteClient Deleter) *Service

New creates a new async service.

func (*Service) CreateResource added in v1.1.0

func (s *Service) CreateResource(ctx context.Context, spec azure.ResourceSpecGetter, serviceName string) (result interface{}, err error)

CreateResource implements the logic for creating a resource Asynchronously.

func (*Service) DeleteResource added in v1.1.0

func (s *Service) DeleteResource(ctx context.Context, spec azure.ResourceSpecGetter, serviceName string) (err error)

DeleteResource implements the logic for deleting a resource Asynchronously.

Directories

Path Synopsis
Package mock_async is a generated GoMock package.
Package mock_async is a generated GoMock package.

Jump to

Keyboard shortcuts

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