updater

package
v0.0.0-...-318167e Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Updater

type Updater struct {
	Schema      map[string]interface{}
	Interval    int
	Source      string
	ID          uuid.UUID
	Method      string
	RequestBody map[string]interface{}
	Timeout     int
	Scheduler   *gocron.Scheduler
}

func NewUpdater

func NewUpdater(schema map[string]interface{}, interval int, source string, method string, requestBody map[string]interface{}, timeout int) *Updater

NewUpdater Creates a new Updater

func (*Updater) FetchData

func (u *Updater) FetchData() map[string]interface{}

FetchData Fetches the data from the source

func (*Updater) GetClient

func (u *Updater) GetClient() (client *http.Client)

GetClient Returns the client configured with the timeout inverval

func (*Updater) HandleEvent

func (u *Updater) HandleEvent()

func (*Updater) Run

func (u *Updater) Run()

Run Create the scheduler and start running the background taks

func (*Updater) SendUpdate

func (u *Updater) SendUpdate()

func (*Updater) Stop

func (u *Updater) Stop()

Stop Clears all the background tasks

Jump to

Keyboard shortcuts

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