fetcher

package
v0.0.0-...-3641ea5 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: Apache-2.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 BulkResponse

type BulkResponse struct {
	ZipFilePath string
	Error       error
}

BulkResponse is a message published when Fetcher finish it job due to cancelled context or closed endpoints chanel

type EndpointRequest

type EndpointRequest struct {
	URL      string
	Node     dcos.Node
	FileName string
	Optional bool
}

EndpointRequest is a struct passed to Fetcher with information about url to be fetched

type Fetcher

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

Fetcher is a struct responsible for fetching nodes endpoints

func New

func New(
	tempdir string,
	client *http.Client,
	input <-chan EndpointRequest,
	statusUpdate chan<- StatusUpdate,
	output chan<- BulkResponse,
	prometheusVector prometheus.ObserverVec,
) (*Fetcher, error)

New creates new Fetcher. Fetcher needs to be started with Run()

func (*Fetcher) Run

func (f *Fetcher) Run(ctx context.Context)

Run starts fetcher. This method should be run as a goroutine

type StatusUpdate

type StatusUpdate struct {
	URL   string
	Error error
}

StatusUpdate is an update message published by Fetcher when EndpointRequest is done. If error occurred during fetch then Error field is not nil.

Jump to

Keyboard shortcuts

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