output

package
v3.0.8-alpha.10+incomp... Latest Latest
Warning

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

Go to latest
Published: May 28, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomOutputer

type CustomOutputer interface {
	// AddOutputer add a new outputer instance
	AddOutputer(target Outputer) OutputerKey

	// RemoveOutputer delete the outputer instace by the outputer key
	RemoveOutputer(key OutputerKey)

	// FetchOutputer find and return the puter by the outputer key
	FetchOutputer(key OutputerKey) Puter

	// CreateCustomOutputer create a new custom outputer
	CreateCustomOutputer(name string, run func(data types.MapStr) error) (OutputerKey, Puter)
}

CustomOutputer the interface which used to maintence the custom outputer

type InstOutputer

type InstOutputer interface {
	// CreateInst create a instance for the model
	CreateInst(target model.Model) (inst.Inst, error)
	// FindInstsLikeName find all insts by the name
	FindInstsLikeName(target model.Model, instName string) (inst.Iterator, error)
	// FindInstsByCondition find all insts by the condition
	FindInstsByCondition(target model.Model, cond common.Condition) (inst.Iterator, error)
}

InstOutputer the inst outputer interface

type Manager

type Manager interface {
	// Model interface
	ModelOutputer

	// Custom outputer
	CustomOutputer

	// InstOutputer
	InstOutputer
}

Manager is the interface that must be implemented by every output manager.

func New

func New() Manager

New create a new Manager instance

type MapOutputer

type MapOutputer map[OutputerKey]Outputer

MapOutputer the outputer storage

type ModelOutputer

type ModelOutputer interface {
	// CreateClassification create a new classification
	CreateClassification(name string) model.Classification

	// FindClassificationsLikeName find a array of the classification by the name
	FindClassificationsLikeName(name string) (model.ClassificationIterator, error)

	// FindClassificationsByCondition find a array of the classification by the condition
	FindClassificationsByCondition(condition common.Condition) (model.ClassificationIterator, error)
}

ModelOutputer the interface which used to maintence the model

type Outputer

type Outputer interface {

	// Name the Inputer description.
	// This information will be printed when the Inputer is abnormal, which is convenient for debugging.
	Name() string

	// Run the output main loop. This should block until singnalled to stop by invocation of the Stop() method.
	Put(data types.MapStr) error

	// Stop is the invoked to signal that the Run() method should its execution.
	// It will be invoked at most once.
	Stop() error
}

Outputer is the interface that must be implemented by every Outputer.

type OutputerKey

type OutputerKey string

OutputerKey the output name

type Puter

type Puter interface {
	// save into the storage
	Put(data types.MapStr) error
}

Puter send the data input

Directories

Path Synopsis
module

Jump to

Keyboard shortcuts

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