pollclient

package
v0.0.0-...-64c179a Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: MIT Imports: 12 Imported by: 8

Documentation

Index

Constants

View Source
const (
	LongRunningOperationPollStatusFailed    = "Failed"
	LongRunningOperationPollStatusSucceeded = "Succeeded"
	LongRunningOperationPollStatusCancelled = "Cancelled"
)
View Source
const (
	PollResultNoPollingNeeded       = LongRunningOperationPollResult("noPollingNeeded")
	PollResultCompletedSuccessfully = LongRunningOperationPollResult("completedSuccessfully")
	PollResultTryAgainLater         = LongRunningOperationPollResult("tryAgainLater")
	PollResultBadRequest            = LongRunningOperationPollResult("badRequest")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseClient

type BaseClient struct {
	autorest.Client
	BaseURI        string
	SubscriptionID string
}

BaseClient was modeled off some of the other Baseclients in the go sdk and contains an autorest client

func NewWithBaseURI

func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient

NewWithBaseURI creates an instance of the BaseClient client.

type LongRunningOperationPollResult

type LongRunningOperationPollResult string

type PollClient

type PollClient struct {
	BaseClient
}

PollClient inherits from the autorest client and has the methods needed to handle GETs to the polling url

func NewPollClient

func NewPollClient(creds config.Credentials) PollClient

NewPollClient returns a client using hte env values from config

func NewPollClientWithBaseURI

func NewPollClientWithBaseURI(baseURI string, creds config.Credentials) PollClient

NewPollClientWithBaseURI returns a paramterized client

func (PollClient) Get

func (client PollClient) Get(ctx context.Context, pollURL string) (result PollResponse, err error)

Get takes a context and a polling url and performs a Get request on the url

func (PollClient) GetPreparer

func (client PollClient) GetPreparer(ctx context.Context, pollURL string) (*http.Request, error)

GetPreparer prepares the Get request.

func (PollClient) GetResponder

func (client PollClient) GetResponder(resp *http.Response) (result PollResponse, err error)

GetResponder handles the response to the Get request. The method always closes the http.Response Body.

func (PollClient) GetSender

func (client PollClient) GetSender(req *http.Request) (*http.Response, error)

GetSender sends the Get request. The method will close the http.Response Body if it receives an error.

func (PollClient) PollLongRunningOperationIfNeeded

func (client PollClient) PollLongRunningOperationIfNeeded(ctx context.Context, status *v1beta1.ASOStatus, kind api.PollingURLKind) (LongRunningOperationPollResult, error)

func (PollClient) PollLongRunningOperationIfNeededV1Alpha1

func (client PollClient) PollLongRunningOperationIfNeededV1Alpha1(ctx context.Context, status *v1alpha1.ASOStatus, kind api.PollingURLKind) (LongRunningOperationPollResult, error)

func (PollClient) PollLongRunningOperationIfNeededV1Alpha2

func (client PollClient) PollLongRunningOperationIfNeededV1Alpha2(ctx context.Context, status *v1alpha2.ASOStatus, kind api.PollingURLKind) (LongRunningOperationPollResult, error)

type PollResponse

type PollResponse struct {
	autorest.Response `json:"-"`
	Name              string             `json:"name,omitempty"`
	Status            string             `json:"status,omitempty"`
	Error             azure.ServiceError `json:"error,omitempty"`
}

PollResponse models the expected response from the poll url

Jump to

Keyboard shortcuts

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