armcore

package module
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: Apache-2.0 Imports: 12 Imported by: 12

Documentation

Index

Constants

View Source
const (
	// LogRPRegistration entries contain information specific to the automatic registration of an RP.
	// Entries of this classification are written IFF the policy needs to take any action.
	LogRPRegistration azcore.LogClassification = "RPRegistration"
)

Variables

This section is empty.

Functions

func NewRPRegistrationPolicy

func NewRPRegistrationPolicy(cred azcore.Credential, o *RegistrationOptions) azcore.Policy

NewRPRegistrationPolicy creates a policy object configured using the specified pipeline and options. The policy controls if an unregistered resource provider should automatically be registered. See https://aka.ms/rps-not-found for more information. Pass nil to accept the default options; this is the same as passing the result from a call to DefaultRegistrationOptions().

Types

type Poller added in v0.1.1

type Poller interface {
	// Done signals if the polling operation has reached a terminal state.
	Done() bool
	// Poll sends a polling request to the service endpoint and returns the http.Response received from the endpoint or an error.
	Poll(ctx context.Context, p azcore.Pipeline) (*http.Response, error)
	// FinalResponse will perform a final GET and return the final http response for the polling operation and unmarshal the content of the payload into the respType interface that is provided.
	FinalResponse(ctx context.Context, pipeline azcore.Pipeline, respType interface{}) (*http.Response, error)
	// ResumeToken returns a token string that can be used to resume polling on a poller that has not yet reached a terminal state.
	ResumeToken() (string, error)
	// PollUntilDone will handle the entire span of the polling operation until a terminal state is reached, then return the final http response for the polling operation and unmarshal the content of the payload into the respType interface that is provided.
	PollUntilDone(ctx context.Context, frequency time.Duration, pipeline azcore.Pipeline, respType interface{}) (*http.Response, error)
}

Poller defines the methods that will be called internally in the generated code for long-running operations. NOTE: this is only meant for internal use in generated code.

func NewPoller added in v0.1.1

func NewPoller(pollerType string, finalState string, resp *azcore.Response, errorHandler methodErrorHandler) (Poller, error)

NewPoller creates a polling tracker based on the verb of the original request and returns the polling tracker implementation for the method verb or an error. NOTE: this is only meant for internal use in generated code.

func NewPollerFromResumeToken added in v0.1.1

func NewPollerFromResumeToken(pollerType string, token string, errorHandler methodErrorHandler) (Poller, error)

NewPollerFromResumeToken creates a polling tracker from a resume token string. NOTE: this is only meant for internal use in generated code.

type Provider

type Provider struct {
	// The provider ID.
	ID *string `json:"id,omitempty"`

	// The namespace of the resource provider.
	Namespace *string `json:"namespace,omitempty"`

	// The registration policy of the resource provider.
	RegistrationPolicy *string `json:"registrationPolicy,omitempty"`

	// The registration state of the resource provider.
	RegistrationState *string `json:"registrationState,omitempty"`
}

Provider - Resource provider information.

type ProviderResponse

type ProviderResponse struct {
	// Resource provider information.
	Provider *Provider

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ProviderResponse is the response envelope for operations that return a Provider type.

type RegistrationOptions

type RegistrationOptions struct {
	// MaxAttempts is the total number of times to attempt automatic registration
	// in the event that an attempt fails.
	// The default value is 3.
	// Set to zero to disable the policy.
	MaxAttempts int

	// PollingDelay is the amount of time to sleep between polling intervals.
	// The default value is 15 seconds.
	PollingDelay time.Duration

	// PollingDuration is the amount of time to wait before abandoning polling.
	// The default valule is 5 minutes.
	PollingDuration time.Duration

	// HTTPClient sets the transport for making HTTP requests.
	// Defaults to azcore.DefaultHTTPClientTransport()
	HTTPClient azcore.Transport

	// Retry configures the built-in retry policy behavior.
	// Defaults to azcore.DefaultRetryOptions()
	Retry azcore.RetryOptions
}

RegistrationOptions configures the registration policy's behavior.

func DefaultRegistrationOptions

func DefaultRegistrationOptions() RegistrationOptions

DefaultRegistrationOptions returns an instance of RegistrationOptions initialized with default values.

Jump to

Keyboard shortcuts

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