Documentation ¶
Index ¶
- func DumpMap() (dump []string)
- func DumpPipes() (dump []string)
- func DumpReadArray() (dump []string)
- func DumpReadArrayWithType() (dump []string)
- func DumpWriteArray() (dump []string)
- func ReadArray(ctx context.Context, read Io, callback func([]byte)) error
- func ReadArrayWithType(ctx context.Context, read Io, callback func(interface{}, string)) error
- func ReadMap(read Io, config *config.Config, callback func(*Map)) error
- func RegisterPipe(name string, constructor func(string) (Io, error))
- func RegisterReadArray(dataType string, ...)
- func RegisterReadArrayWithType(dataType string, ...)
- func RegisterReadMap(dataType string, ...)
- func RegisterWriteArray(dataType string, function func(read Io) (ArrayWriter, error))
- func WriteTo(std Io, w io.Writer) (int64, error)
- func WriteToFromFile(f *os.File, w io.Writer) (int64, error)
- type ArrayWriter
- type Io
- type Map
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DumpMap ¶
func DumpMap() (dump []string)
DumpMap returns an array of compiled builtins supporting deserialization as a key/value map (or hash)
func DumpPipes ¶
func DumpPipes() (dump []string)
DumpPipes returns a sorted array of regestered pipes.
func DumpReadArray ¶
func DumpReadArray() (dump []string)
DumpReadArray returns an array of compiled builtins supporting deserialization as an Array
func DumpReadArrayWithType ¶
func DumpReadArrayWithType() (dump []string)
DumpReadArrayWithType returns an array of compiled builtins supporting deserialization as an ArrayWithType
func DumpWriteArray ¶
func DumpWriteArray() (dump []string)
DumpWriteArray returns an array of compiled builtins supporting serialization as an Array
func ReadArrayWithType ¶
ReadArrayWithType is a template function for stdio.Io
func RegisterPipe ¶
RegisterPipe is used by pipes (/builtins/) to regester themselves to murex. This function should only be called from a packages Init() func.
func RegisterReadArray ¶
func RegisterReadArray(dataType string, function func(ctx context.Context, read Io, callback func([]byte)) error)
RegisterReadArray is used by types (/builtins/types) to regester themselves to murex. This function should only be called from a packages Init() func.
func RegisterReadArrayWithType ¶
func RegisterReadArrayWithType(dataType string, function func(ctx context.Context, read Io, callback func(interface{}, string)) error)
RegisterReadArrayWithType is used by types (/builtins/types) to regester themselves to murex. This function should only be called from a packages Init() func.
func RegisterReadMap ¶
func RegisterReadMap(dataType string, function func(read Io, config *config.Config, callback func(*Map)) error)
RegisterReadMap is used by pipes (/builtins/) to regester themselves to murex. This function should only be called from a packages Init() func.
func RegisterWriteArray ¶
func RegisterWriteArray(dataType string, function func(read Io) (ArrayWriter, error))
RegisterWriteArray is used by pipes (/builtins/) to regester themselves to murex. This function should only be called from a packages Init() func.
Types ¶
type ArrayWriter ¶
ArrayWriter is a simple interface types can adopt for buffered writes of formatted arrays in structured types (eg JSON)
func WriteArray ¶
func WriteArray(writer Io, dt string) (ArrayWriter, error)
WriteArray is a template function for stdio.Io
type Io ¶
type Io interface { Stats() (uint64, uint64) GetDataType() string SetDataType(string) IsTTY() bool File() *os.File Read([]byte) (int, error) ReadLine(callback func([]byte)) error ReadArray(ctx context.Context, callback func([]byte)) error ReadArrayWithType(ctx context.Context, callback func(interface{}, string)) error ReadMap(*config.Config, func(*Map)) error ReadAll() ([]byte, error) Write([]byte) (int, error) Writeln([]byte) (int, error) WriteArray(string) (ArrayWriter, error) //ReadFrom(r io.Reader) (n int64, err error) WriteTo(io.Writer) (int64, error) Open() Close() ForceClose() }
Io is the interface that's used for the shell functions pipelining of data eg via standard in, out and err. It is written to be compatible with Go Reader and Writer interfaces however does expand upon them with additional helper methods to enable easier writing of builtin shell functions.
func CreatePipe ¶
CreatePipe returns an stdio.Io interface for a specified pipe type or errors if the pipe type is invalid.