package async

import "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/pollers/async"

Index

Constants

const Kind = "Azure-AsyncOperation"

Kind is the identifier of this type in a resume token.

Functions

func Applicable

func Applicable(resp *http.Response) bool

Applicable returns true if the LRO is using Azure-AsyncOperation.

Types

type Poller

type Poller struct {
	// The poller's type, used for resume token processing.
	Type string `json:"type"`

	// The URL from Azure-AsyncOperation header.
	AsyncURL string `json:"asyncURL"`

	// The URL from Location header.
	LocURL string `json:"locURL"`

	// The URL from the initial LRO request.
	OrigURL string `json:"origURL"`

	// The HTTP method from the initial LRO request.
	Method string `json:"method"`

	// The value of final-state-via from swagger, can be the empty string.
	FinalState string `json:"finalState"`

	// The LRO's current state.
	CurState string `json:"state"`
}

Poller is an LRO poller that uses the Azure-AsyncOperation pattern.

func New

func New(resp *http.Response, finalState string, pollerID string) (*Poller, error)

New creates a new Poller from the provided initial response and final-state type.

func (*Poller) Done

func (p *Poller) Done() bool

Done returns true if the LRO has reached a terminal state.

func (*Poller) FinalGetURL

func (p *Poller) FinalGetURL() string

FinalGetURL returns the URL to perform a final GET for the payload, or the empty string if not required.

func (*Poller) Status

func (p *Poller) Status() string

Status returns the status of the LRO.

func (*Poller) URL

func (p *Poller) URL() string

URL returns the polling URL.

func (*Poller) Update

func (p *Poller) Update(resp *http.Response) error

Update updates the Poller from the polling response.

Source Files

async.go

Version
v0.19.0
Published
Aug 26, 2021
Platform
linux/amd64
Imports
7 packages
Last checked
39 minutes ago

Tools for package owners.