reloaders

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenericReloader

type GenericReloader struct {
	Opts GenericReloaderOpts
}

func (GenericReloader) GetMethod

func (r GenericReloader) GetMethod() string

func (GenericReloader) GetOpts

func (r GenericReloader) GetOpts() ReloaderOpts

func (GenericReloader) Reload

func (r GenericReloader) Reload() error

func (GenericReloader) SetCounter

func (r GenericReloader) SetCounter(c int) Reloader

func (GenericReloader) SetOpts

func (r GenericReloader) SetOpts(opts ReloaderOpts) bool

type GenericReloaderOpts

type GenericReloaderOpts struct {
}

type HttpReloader

type HttpReloader struct {
	Manager string           `json:"-"`
	Counter int              `json:"-"`
	Method  string           `mapstructure:"method" json:"method"`
	Opts    HttpReloaderOpts `json:"opts"`
}

func (HttpReloader) GetMethod

func (h HttpReloader) GetMethod() string

func (HttpReloader) GetOpts

func (h HttpReloader) GetOpts() ReloaderOpts

func (HttpReloader) Reload

func (h HttpReloader) Reload() error

func (*HttpReloader) ReloaderRetryPolicy

func (h *HttpReloader) ReloaderRetryPolicy(resp *http.Response, err error) (bool, error)

func (HttpReloader) SetCounter

func (h HttpReloader) SetCounter(c int) Reloader

func (HttpReloader) SetOpts

func (h HttpReloader) SetOpts(opts ReloaderOpts) bool

type HttpReloaderOpts

type HttpReloaderOpts struct {
	Client       *retryablehttp.Client `json:"-"`
	ContentType  string                `json:"content-type"`
	Host         string                `json:"host"`
	Port         string                `mapstructure:"port" json:"port"`
	Uri          string                `json:"uri"`
	Method       string                `json:"method"`
	Payload      string                `json:"payload"`
	Retries      string                `json:"retries"`
	RetryWaitMax string                `json:"retry-wait-max"`
	RetryWaitMin string                `json:"retry-wait-min"`
	Timeout      string                `json:"timeout"`
}

func (*HttpReloaderOpts) GetClient

func (h *HttpReloaderOpts) GetClient() *retryablehttp.Client

type Reloader

type Reloader interface {
	Reload() error
	GetMethod() string
	GetOpts() ReloaderOpts
	SetOpts(ReloaderOpts) bool
	SetCounter(int) Reloader
}

func New

func New(entry string) (Reloader, error)

func NewGenericReloader

func NewGenericReloader(manager string, method string, entry []byte) (Reloader, error)

func NewGenericReloaderWithCustomError

func NewGenericReloaderWithCustomError(manager string, method string, err error) (Reloader, error)

func NewHttpReloader

func NewHttpReloader(manager string, method string, entry []byte) (Reloader, error)

type ReloaderError

type ReloaderError struct {
	Code    int
	Message string
}

func NewReloaderError

func NewReloaderError() *ReloaderError

func (*ReloaderError) Error

func (r *ReloaderError) Error() string

func (*ReloaderError) WithCode

func (r *ReloaderError) WithCode(c int) *ReloaderError

func (*ReloaderError) WithMessage

func (r *ReloaderError) WithMessage(m string) *ReloaderError

type ReloaderOpts

type ReloaderOpts interface {
}

Jump to

Keyboard shortcuts

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