package op

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

Index

Functions

func Applicable

func Applicable(resp *http.Response) bool

Applicable returns true if the LRO is using Operation-Location.

func CanResume

func CanResume(token map[string]any) bool

CanResume returns true if the token can rehydrate this poller type.

Types

type Poller

type Poller[T any] struct {
	OpLocURL   string                `json:"oplocURL"`
	LocURL     string                `json:"locURL"`
	OrigURL    string                `json:"origURL"`
	Method     string                `json:"method"`
	FinalState pollers.FinalStateVia `json:"finalState"`
	ResultPath string                `json:"resultPath"`
	CurState   string                `json:"state"`
	// contains filtered or unexported fields
}

Poller is an LRO poller that uses the Operation-Location pattern.

func New

func New[T any](pl exported.Pipeline, resp *http.Response, finalState pollers.FinalStateVia, resultPath string) (*Poller[T], error)

New creates a new Poller from the provided initial response. Pass nil for response to create an empty Poller for rehydration.

func (*Poller[T]) Done

func (p *Poller[T]) Done() bool

func (*Poller[T]) Poll

func (p *Poller[T]) Poll(ctx context.Context) (*http.Response, error)

func (*Poller[T]) Result

func (p *Poller[T]) Result(ctx context.Context, out *T) error

Source Files

op.go

Version
v1.18.0 (latest)
Published
Apr 3, 2025
Platform
linux/amd64
Imports
9 packages
Last checked
5 hours ago

Tools for package owners.