Documentation
¶
Index ¶
Constants ¶
View Source
const ( StdIn string = "stdin" StdOut string = "stdout" )
Variables ¶
This section is empty.
Functions ¶
func ApplyConfigurationFromFile ¶
func ApplyConfigurationFromFile(filepath string)
Entry point to read in the provided file, resolve the connections, readers and writers and apply the configuration
Types ¶
type Config ¶
type Config struct {
Connections []ConfigConnection
Nodes ConfigNodes
Settings ConfigSettings
Conns []Connection `json:"-"`
// contains filtered or unexported fields
}
func (Config) Close ¶
Close all provided reader and writers Only the "first" occurring error will be returned, writers are closed first.
func (*Config) Initialise ¶
type ConfigConnection ¶
type ConfigFile ¶
type ConfigFile struct {
ID string
Path string
// Determines whether this file is in truncate mode or append mode. By default this is false
// meaning it is in append mode.
Trunc bool
// contains filtered or unexported fields
}
func (ConfigFile) Writer ¶
func (c ConfigFile) Writer() (io.WriteCloser, error)
[ConfigModel.Writer]
type ConfigModel ¶
type ConfigModel interface {
// GetID returns the ID of the model
GetID() string
// Validate will perform any validation on behalf of the object, or any pre-setup that is required
Validate() error
// Reader will get a reader for the underlying configuration
Reader() (io.ReadCloser, error)
// Writer will get a writer for the underlying configuration
Writer() (io.WriteCloser, error)
}
An interface that all Config* objects will implement.
type ConfigNodes ¶
type ConfigNodes struct {
Ports []ConfigPort
Files []ConfigFile
Sockets []ConfigSocket
Ipcs []ConfigIPC
}
type ConfigPort ¶
type ConfigPort struct {
ID string
Channel string
Mode goSerial.Mode
// The resolved and connected port, in a scenario where we call validate
Port *serial.CustomPort `json:"-"`
ReadTimeout int
}
func (*ConfigPort) Open ¶
func (c *ConfigPort) Open() error
func (*ConfigPort) Reader ¶
func (c *ConfigPort) Reader() (io.ReadCloser, error)
[ConfigModel.Reader]
func (*ConfigPort) Writer ¶
func (c *ConfigPort) Writer() (io.WriteCloser, error)
[ConfigModel.Writer]
type ConfigSettings ¶
type ConfigSettings struct {
// Timeout in seconds
Timeout int
}
type ConfigSocket ¶
func (ConfigSocket) Reader ¶
func (c ConfigSocket) Reader() (io.ReadCloser, error)
[ConfigModel.Reader]
func (ConfigSocket) Writer ¶
func (c ConfigSocket) Writer() (io.WriteCloser, error)
[ConfigModel.Writer]
Click to show internal directories.
Click to hide internal directories.