示例#1
0
// NewInput creates a new Input instance for a given service descriptor. Configuration is automatically determined by the thingiversio/config package.
func NewInput(desc string) (i *Input, err error) {
	var d Descriptor
	d, err = ParseDescriptor(desc)
	if err == nil {
		i, err = NewInputFromConfig(config.Configure(false, d.AsTagSet()))
	}
	return
}
示例#2
0
// NewOutput creates a new Output instance for a given service descriptor. Configuration is automatically determined by the thingiversio/config package.
func NewOutput(desc string) (o *Output, err error) {
	var d Descriptor
	d, err = ParseDescriptor(desc)
	if err == nil {
		o, err = NewOutputFromConfig(config.Configure(true, d.AsTagSet()))
	}
	return
}