package poller

import "github.com/Azure/azure-sdk-for-go/sdk/internal/poller"

Index

Constants

const (
	StatusSucceeded  = "Succeeded"
	StatusCanceled   = "Canceled"
	StatusFailed     = "Failed"
	StatusInProgress = "InProgress"
)

the well-known set of LRO status/provisioning state values.

const (
	StatusCancelled = "Cancelled"
	StatusCompleted = "Completed"
)

these are non-conformant states that we've seen in the wild. we support them for back-compat.

Variables

var ErrNoBody = errors.New("the response did not contain a body")

ErrNoBody is returned if the response didn't contain a body.

Functions

func Failed

func Failed(s string) bool

Failed returns true if the LRO's state is terminal failure.

func GetJSON

func GetJSON(resp *http.Response) (map[string]any, error)

GetJSON reads the response body into a raw JSON object. It returns ErrNoBody if there was no content.

func GetProvisioningState

func GetProvisioningState(resp *http.Response) (string, error)

GetProvisioningState returns the LRO's state from the response body. If there is no state in the response body the empty string is returned.

func GetResourceLocation

func GetResourceLocation(resp *http.Response) (string, error)

GetResourceLocation returns the LRO's resourceLocation value from the response body. Typically used for Operation-Location flows. If there is no resourceLocation in the response body the empty string is returned.

func GetStatus

func GetStatus(resp *http.Response) (string, error)

GetStatus returns the LRO's status from the response body. Typically used for Azure-AsyncOperation flows. If there is no status in the response body the empty string is returned.

func IsTerminalState

func IsTerminalState(s string) bool

IsTerminalState returns true if the LRO's state is terminal.

func IsValidURL

func IsValidURL(s string) bool

IsValidURL verifies that the URL is valid and absolute.

func StatusCodeValid

func StatusCodeValid(resp *http.Response) bool

returns true if the LRO response contains a valid HTTP status code

func Succeeded

func Succeeded(s string) bool

Succeeded returns true if the LRO's state is terminal success.

Source Files

util.go

Version
v1.11.1 (latest)
Published
Apr 7, 2025
Platform
js/wasm
Imports
7 packages
Last checked
8 minutes ago

Tools for package owners.