Documentation
¶
Index ¶
- Constants
- Variables
- func Failed(s string) bool
- func GetJSON(resp *http.Response) (map[string]any, error)
- func GetProvisioningState(resp *http.Response) (string, error)
- func GetResourceLocation(resp *http.Response) (string, error)
- func GetStatus(resp *http.Response) (string, error)
- func InProgress(s string) bool
- func IsTerminalState(s string) bool
- func IsValidURL(s string) bool
- func PollHelper(ctx context.Context, endpoint string, pl runtime.Pipeline, ...) error
- func ResultHelper[T any](resp *http.Response, failed bool, out *T) error
- func StatusCodeValid(resp *http.Response) bool
- func Succeeded(s string) bool
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" StatusNotStarted = "NotStarted" StatusRunning = "Running" StatusUndefined = "Undefined" StatusDeduped = "Deduped" )
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 GetJSON ¶
GetJSON reads the response body into a raw JSON object. It returns ErrNoBody if there was no content.
func GetProvisioningState ¶
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 ¶
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 ¶
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 InProgress ¶
InProgress returns true if the LRO's state is in progress.
func IsTerminalState ¶
IsTerminalState returns true if the LRO's state is terminal.
func IsValidURL ¶
IsValidURL verifies that the URL is valid and absolute.
func PollHelper ¶
func StatusCodeValid ¶
returns true if the LRO response contains a valid HTTP status code
Types ¶
This section is empty.