Documentation
¶
Overview ¶
Example (Plugin) ¶
package main import ( "context" "io/ioutil" "os" "time" plugin "github.com/LeKovr/mqbridge/plugins/file" "github.com/LeKovr/mqbridge/types" ) const ( TestRow0 = "test row one" TestRow1 = "test row two" ) func main() { ctx, cancel := context.WithCancel(context.Background()) epa := types.NewBlankEndPointAttr(ctx) plug, _ := plugin.New(epa, "test") pipe := make(chan string) file, _ := ioutil.TempFile(".", "mqbridge-test-in") defer os.Remove(file.Name()) file.WriteString(TestRow0 + "\n") plug.Listen(0, file.Name(), pipe) plug.Notify(0, "-", pipe) file.WriteString(TestRow1 + "\n") time.Sleep(100 * time.Millisecond) cancel() epa.WG.Wait() }
Output: test row one test row two
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.