Skip to content

Plugin interface for the Nanowire data processing plugin system

License

Notifications You must be signed in to change notification settings

SpotlightData/nanowire-plugin-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Plugin interface for the Nanowire data processing plugin system

Resources

License

Stars

Watchers

Forks

Packages

No packages published