api

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRunningPlugin added in v0.1.6

func RegisterRunningPlugin(p *Plugin)

func StopAllRunningPlugins added in v0.1.6

func StopAllRunningPlugins()

Types

type CacheConfigInjector

type CacheConfigInjector interface {
	CacheSystem() DeployableCache
}

CacheConfigInjector interface to be used by a function to inject the cache system config into a deployment package

type CacheSystem

type CacheSystem interface {
	FileSystem
	DeployableCache

	Flush(system FileSystem) error
	Clear() error
}

CacheSystem represent a ephemeral file system used for intermediate state between map/reduce phases

type DeployableCache added in v0.1.5

type DeployableCache interface {
	//Deploy will deploy a cache based on the config and viper values - can use plugins
	Deploy() error
	//Undeploy will remove a prior deployment
	Undeploy() error
	//Check checks if the cache is deployable, e.g. if the plugin is running, all configs are set. Should not interact with the cloud provider, just locally check if everything is ready
	Check() error
	//FunctionInjector can be used by function deployment code to modify function deployments to use the underling cache system, warning needs to be implemented for each platform individually
	FunctionInjector() CacheConfigInjector
}

type FileInfo

type FileInfo struct {
	Name string // file path
	Size int64  // file size in bytes
}

FileInfo provides information about a file

type FileSystem

type FileSystem interface {
	ListFiles(pathGlob string) ([]FileInfo, error)
	Stat(filePath string) (FileInfo, error)
	OpenReader(filePath string, startAt int64) (io.ReadCloser, error)
	OpenWriter(filePath string) (io.WriteCloser, error)
	Delete(filePath string) error
	Join(elem ...string) string
	Split(path string) []string
	Init() error
}

FileSystem provides the file backend for MapReduce jobs. Input data is read from a file system. Intermediate and output data is written to a file system. This is abstracted to allow remote filesystems like S3 to be supported.

type Metrics added in v0.1.7

type Metrics struct {
	Fields map[string]string
	// contains filtered or unexported fields
}

func CollectMetrics added in v0.1.7

func CollectMetrics(fields map[string]string) (*Metrics, error)

CollectMetrics creates or gets the Metrics Singleton, and starts the activation log writer. Provided fields will be added to the log.

func (*Metrics) AddField added in v0.1.7

func (j *Metrics) AddField(key string, description string) error

func (*Metrics) Collect added in v0.1.7

func (j *Metrics) Collect(result map[string]interface{})

func (*Metrics) Info added in v0.2.1

func (j *Metrics) Info() string

func (*Metrics) Reset added in v0.1.7

func (j *Metrics) Reset()

func (*Metrics) Start added in v0.1.7

func (j *Metrics) Start()

type Plugin

type Plugin struct {
	FullName       string `json:"name"`       // FullName of the plugin, must be a go `get`-able package
	ExecutableName string `json:"executable"` // Name of the executable installed by go install
	// contains filtered or unexported fields
}

func (*Plugin) GetConnection

func (p *Plugin) GetConnection() grpc.ClientConnInterface

func (*Plugin) Init

func (p *Plugin) Init() error

func (*Plugin) Interact

func (p *Plugin) Interact(in io.Reader) error

func (*Plugin) IsConnected

func (p *Plugin) IsConnected() bool

func (*Plugin) IsReady added in v0.1.5

func (p *Plugin) IsReady() bool

func (*Plugin) Start

func (p *Plugin) Start(args ...string) error

func (*Plugin) Stop

func (p *Plugin) Stop()

Jump to

Keyboard shortcuts

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