loc

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Applicable

func Applicable(resp *http.Response) bool

Applicable returns true if the LRO is using Location.

func CanResume added in v1.0.0

func CanResume(token map[string]interface{}) bool

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

Types

type Poller

type Poller[T any] struct {
	Type     string `json:"type"`
	PollURL  string `json:"pollURL"`
	CurState string `json:"state"`
	// contains filtered or unexported fields
}

Poller is an LRO poller that uses the Location pattern.

func New

func New[T any](pl exported.Pipeline, resp *http.Response) (*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 added in v1.0.0

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

func (*Poller[T]) Result added in v1.0.0

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

Jump to

Keyboard shortcuts

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