locasync

package
v0.1.0-beta.9 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PollerHandler

type PollerHandler[T any] struct {
	AsyncURL string `json:"asyncURL"`
	OrigURL  string `json:"origURL"`
	Method   string `json:"method"`

	FinalState runtime.FinalStateVia `json:"finalState"`
	CurState   string                `json:"state"`
	// contains filtered or unexported fields
}

PollerHandler is an LRO poller that uses the LocationAsync pattern.

func NewPollerHandler

func NewPollerHandler[T any](pl runtime.Pipeline, resp *http.Response, finalState runtime.FinalStateVia) (*PollerHandler[T], error)

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

func (*PollerHandler[T]) Done

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

Done returns true if the LRO is in a terminal state.

func (*PollerHandler[T]) Poll

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

Poll retrieves the current state of the LRO.

func (*PollerHandler[T]) Result

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

Result retrieves the final result of the LRO.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL