fetcher

package
v0.0.0-...-172ad5f Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetcher

type Fetcher interface {
	Init() error
	Fetch() (io.Reader, error)
}

func Func

func Func(fn func() (io.Reader, error)) Fetcher

type File

type File struct {
	Path     string
	Interval time.Duration
	// contains filtered or unexported fields
}

func (*File) Fetch

func (f *File) Fetch() (io.Reader, error)

func (*File) Init

func (f *File) Init() error

type Github

type Github struct {
	//Github username and repository name
	User, Repo string
	//Interval between fetches
	Interval time.Duration
	//Asset is used to find matching release asset.
	//By default a file will match if it contains
	//both GOOS and GOARCH.
	Asset func(filename string) bool
	// contains filtered or unexported fields
}

func (*Github) Fetch

func (h *Github) Fetch() (io.Reader, error)

Fetch the binary from the provided Repository

func (*Github) Init

func (h *Github) Init() error

Init validates the provided config

type HTTP

type HTTP struct {
	//URL to poll for new binaries
	URL          string
	Interval     time.Duration
	CheckHeaders []string
	// contains filtered or unexported fields
}

func (*HTTP) Fetch

func (h *HTTP) Fetch() (io.Reader, error)

Fetch the binary from the provided URL

func (*HTTP) Init

func (h *HTTP) Init() error

Init validates the provided config

type S3

type S3 struct {
	//Access key falls back to env AWS_ACCESS_KEY, then metadata
	Access string
	//Secret key falls back to env AWS_SECRET_ACCESS_KEY, then metadata
	Secret string
	//Region defaults to ap-southeast-2
	Region string
	Bucket string
	Key    string
	//Interval between checks
	Interval time.Duration
	//HeadTimeout defaults to 5 seconds
	HeadTimeout time.Duration
	//GetTimeout defaults to 5 minutes
	GetTimeout time.Duration
	// contains filtered or unexported fields
}

func (*S3) Fetch

func (s *S3) Fetch() (io.Reader, error)

Fetch the binary from S3

func (*S3) Init

func (s *S3) Init() error

Init validates the provided config

Jump to

Keyboard shortcuts

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