provider

package
v0.0.0-...-6c8a6c4 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	User     string `yaml:"user"`
	Password string `yaml:"password"`
}

Auth is a structure for basic authentication.

func (Auth) String

func (a Auth) String() string

String serialisation a structure Auth to string.

type EmptyProvider

type EmptyProvider struct{}

EmptyProvider is empty provider. It is used if all supported providers if not defined.

func (EmptyProvider) IsEmpty

func (ep EmptyProvider) IsEmpty() bool

IsEmpty returns true if a structure is empty.

func (EmptyProvider) Pump

func (ep EmptyProvider) Pump(name string) func()

Pump generate an job with empty function.

type File

type File struct {
	Path string `yaml:"path"`
}

File define available fields for file source.

func (File) IsEmpty

func (f File) IsEmpty() bool

IsEmpty returns true if a structure is empty.

func (File) Pump

func (f File) Pump(name string) func()

Pump generate an job function for updating data from file sources.

type Http

type Http struct {
	Endpoint string      `yaml:"endpoint"`
	Method   string      `yaml:"method"`
	Auth     Auth        `yaml:"auth"`
	Header   http.Header `yaml:"header"`
	Body     string      `yaml:"body"`
}

Http define available fields for http source.

func (Http) IsEmpty

func (h Http) IsEmpty() bool

IsEmpty returns true if a structure is empty.

func (Http) Pump

func (h Http) Pump(name string) func()

Pump generate an job function for updating data from http sources.

type Provider

type Provider interface {
	Pump(name string) func()
	IsEmpty() bool
}

Provider is a general interface for definition a new provider.

type Static

type Static struct {
	Value string `yaml:"value"`
}

Static define available fields for static source.

func (Static) IsEmpty

func (s Static) IsEmpty() bool

IsEmpty returns true if a structure is empty.

func (Static) Pump

func (s Static) Pump(name string) func()

Pump generate an job function for updating data from static sources.

Jump to

Keyboard shortcuts

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