Skip to content

Latest commit

 

History

History
58 lines (43 loc) · 1.19 KB

readme.md

File metadata and controls

58 lines (43 loc) · 1.19 KB

nanowireplugin

-- import "github.com/SpotlightData/nanowire-plugin-go"

Package nanowireplugin provides a Go interface to the Nanowire pipeline system. It's a very simple library to implement as it only consists of a single function which binds a user-defined callback function to the internal Nanowire work queue.

Usage

func Bind

func Bind(callback TaskEvent, name string) (err error)

Bind links a user function to the Nanowire pipeline system and calls it whenever a task is ready

type Config

type Config struct {
	AmqpHost    string
	AmqpPort    string
	AmqpMgrPort string
	AmqpUser    string

	MinioScheme string
	MinioHost   string
	MinioPort   string
	MinioAccess string

	MonitorURL string
}

Config stores credentials for various services

type TaskEvent

type TaskEvent func(nmo *nmo.NMO, jsonld map[string]interface{}, url *url.URL) map[string]interface{}

TaskEvent is a callback function signature triggered when a new file is ready to be processed

type V3Payload

type V3Payload struct {
	NMO    *nmo.NMO               `json:"nmo"`
	JSONLD map[string]interface{} `json:"jsonld"`
}

V3Payload wraps NMO with an empty JSONLD object