async

package
v1.14.5 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 13 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// DefaultPollerFrequency is how often a poller should check for completion, in seconds.
	DefaultPollerFrequency = 1 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Creator

type Creator[T any] interface {
	Getter
	CreateOrUpdateAsync(ctx context.Context, spec azure.ResourceSpecGetter, resumeToken string, parameters interface{}) (result interface{}, poller *runtime.Poller[T], err error)
}

Creator creates or updates a resource asynchronously.

type Deleter

type Deleter[T any] interface {
	DeleteAsync(ctx context.Context, spec azure.ResourceSpecGetter, resumeToken string) (poller *runtime.Poller[T], err error)
}

Deleter deletes a resource asynchronously.

type FutureScope

type FutureScope interface {
	azure.AsyncStatusUpdater
}

FutureScope stores and retrieves Futures and Conditions.

type Getter added in v1.2.0

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

Getter gets a resource.

type Reconciler added in v1.1.0

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

Reconciler reconciles a resource.

type Service added in v1.1.0

type Service[C, D any] struct {
	Scope FutureScope
	Creator[C]
	Deleter[D]
}

Service handles asynchronous creation and deletion of resources. It implements the Reconciler interface.

func New added in v1.1.0

func New[C, D any](scope FutureScope, createClient Creator[C], deleteClient Deleter[D]) *Service[C, D]

New creates an async Service.

func (*Service[C, D]) CreateOrUpdateResource added in v1.6.0

func (s *Service[C, D]) CreateOrUpdateResource(ctx context.Context, spec azure.ResourceSpecGetter, serviceName string) (result interface{}, err error)

CreateOrUpdateResource creates a new resource or updates an existing one asynchronously.

func (*Service[C, D]) DeleteResource added in v1.1.0

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

DeleteResource deletes a resource asynchronously.

type TagsGetter added in v1.6.0

type TagsGetter interface {
	GetAtScope(ctx context.Context, scope string) (result armresources.TagsResource, err error)
}

TagsGetter is an interface that can get a tags resource.

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