node

package
v0.0.0-...-4f52952 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeFeed = "DATA_FEED"
	TypeRDN  = "RANDOM_NUMBER"
)

Variables

View Source
var (
	Jobs []*Job
	Fsys fs.FS
)
View Source
var Reducers = make(map[string]func(interface{}, ...interface{}) (interface{}, error))

Functions

func ADD

func ADD(value interface{}, args ...interface{}) (interface{}, error)

func Boot

func Boot(jobsPath string)

func DIV

func DIV(value interface{}, args ...interface{}) (interface{}, error)

func LoadJobs

func LoadJobs(jobsPath string) error

func LoadReducers

func LoadReducers()

func MUL

func MUL(value interface{}, args ...interface{}) (interface{}, error)

func PARSE

func PARSE(jsonInterface interface{}, args ...interface{}) (interface{}, error)

func Request

func Request(job Job) interface{}

func Run

func Run()

func SUB

func SUB(value interface{}, args ...interface{}) (interface{}, error)

Types

type Feed

type Feed struct {
	Url         string              `json:"url"`
	RequestType string              `json:"request_type"`
	Headers     []map[string]string `json:"headers"`
	Reducers    []Reducer           `json:"reducers"`
}

type Job

type Job struct {
	Active    bool   `json:"active"`
	Name      string `json:"name"`
	JobType   string `json:"job_type"`
	AdapterId string `json:"adapter_id"`
	Oracle    string `json:"oracle"`
	Feeds     []Feed `json:"feeds"`
}

type Reducer

type Reducer struct {
	Function string        `json:"function"`
	Args     []interface{} `json:"args"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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