Documentation ¶
Overview ¶
Package procedure provides functionality to call of external programs to process file objects throught STDIN or TMPFILE interfaces.
All subprograms have to implement JSON api interface throught STDOUT pipelines or pure file response. JSON will be detected automaticly
Example STDOUT file:
procedure resize-image.sh
Example STOUT json:
[4]byte{JSON_SIZE_BIGENDING} { "field1": "value1", "field2": "value2", } [...FILE_STREAM_RESPONSE...]
Example STDOUT tmpfile:
shell exec magick {{input_tmp_file}} {{output_tmp_file}} STDOUT: optional as JSON
Index ¶
- Constants
- Variables
- func NewAction(procedure, outFile string, toJSON bool, args ...string) *models.Action
- func NewActionAsFile(procedure, outFile string, toJSON bool, args ...string) *models.Action
- func NewActionMeta(procedure, outputTag string, toJSON bool, args ...string) *models.Action
- type Converter
Constants ¶
View Source
const ( ParamName = "name" ParamArguments = "args" ParamTargetMeta = "target-meta" ParamToJSONString = "tojson" ParamOutputFile = "output-file" ParamInputFile = "input-file" )
Command parameters
View Source
const ActionName = "procedure"
ActionName of command
Variables ¶
View Source
var ( ErrInvalidProcedureParameter = errors.New("[procedure] invalid procedure arguments") ErrCantCreateTmpFile = errors.New("[procedure] invalid tmp file creation") )
Error list...
Functions ¶
func NewActionAsFile ¶
NewActionAsFile procedure defenition of processing as input file
Types ¶
type Converter ¶
Converter contains whole functions to convert image
func (*Converter) Process ¶
func (ic *Converter) Process(in converters.Input, out converters.Output) error
Process input file by procedure command execution Example:
{ "name": "procedure", "values": { "name": "test.sh", "args": ["arg1", "arg2"], "tojson": true, "output-file": "..." } }
{{tmp}} – new file on the disk automaticaly removes after processing By default it works as STDOUT file stream
Click to show internal directories.
Click to hide internal directories.