retryer

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Kind is the kind of Retryer.
	Kind = "Retryer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Policy

type Policy struct {
	Name         string `yaml:"name" jsonschema:"required"`
	MaxAttempts  int    `yaml:"maxAttempts" jsonschema:"omitempty,minimum=1"`
	WaitDuration string `yaml:"waitDuration" jsonschema:"omitempty,format=duration"`

	BackOffPolicy       string  `yaml:"backOffPolicy" jsonschema:"omitempty,enum=random,enum=exponential"`
	RandomizationFactor float64 `yaml:"randomizationFactor" jsonschema:"omitempty,minimum=0,maximum=1"`

	CountingNetworkError bool  `yaml:"countingNetworkError" jsonschema:"omitempty"`
	FailureStatusCodes   []int `yaml:"failureStatusCodes" jsonschema:"omitempty,uniqueItems=true,format=httpcode-array"`
	// contains filtered or unexported fields
}

Policy is the policy of the retryer

type Retryer

type Retryer struct {
	// contains filtered or unexported fields
}

Retryer is the struct of retryer

func (*Retryer) Close

func (r *Retryer) Close()

Close closes Retryer.

func (*Retryer) DefaultSpec

func (r *Retryer) DefaultSpec() interface{}

DefaultSpec returns the default spec of Retryer.

func (*Retryer) Description

func (r *Retryer) Description() string

Description returns the description of Retryer

func (*Retryer) Handle

func (r *Retryer) Handle(ctx context.HTTPContext) string

Handle handles HTTP request

func (*Retryer) Inherit

func (r *Retryer) Inherit(filterSpec *httppipeline.FilterSpec, previousGeneration httppipeline.Filter)

Inherit inherits previous generation of Retryer.

func (*Retryer) Init

func (r *Retryer) Init(filterSpec *httppipeline.FilterSpec)

Init initializes Retryer.

func (*Retryer) Kind

func (r *Retryer) Kind() string

Kind returns the kind of Retryer.

func (*Retryer) Results

func (r *Retryer) Results() []string

Results returns the results of Retryer.

func (*Retryer) Status

func (r *Retryer) Status() interface{}

Status returns Status generated by Runtime.

type Spec

type Spec struct {
	Policies         []*Policy  `yaml:"policies" jsonschema:"required"`
	DefaultPolicyRef string     `yaml:"defaultPolicyRef" jsonschema:"omitempty"`
	URLs             []*URLRule `yaml:"urls" jsonschema:"required"`
}

Spec is the spec of retryer

func (Spec) Validate

func (spec Spec) Validate() error

Validate implements custom validation for Spec

type URLRule

type URLRule struct {
	urlrule.URLRule `yaml:",inline"`
	// contains filtered or unexported fields
}

URLRule is the URL rule

Jump to

Keyboard shortcuts

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