Documentation ¶
Overview ¶
Example (Printer) ¶
package main import ( "context" "time" "github.com/go-logr/logr" "github.com/LeKovr/mqbridge/types" ) func main() { ctx, cancel := context.WithCancel(context.Background()) epa := types.NewBlankEndPointAttr(ctx) pipe := make(chan string) go epa.Printer(logr.Discard(), pipe) pipe <- "test row" time.Sleep(100 * time.Millisecond) cancel() epa.WG.Wait() }
Output: test row
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EndPoint ¶
type EndPoint interface { // Listen holds signature for Listen func which starts listening goroutine Listen(id int, channel string, pipe chan string) error // Notify holds signature for Notify func which starts notify goroutine Notify(id int, channel string, pipe chan string) error }
EndPoint declares plugin interface
type EndPointAttr ¶ added in v0.3.1
type EndPointAttr struct { Log logr.Logger WG *sync.WaitGroup Ctx context.Context Abort chan string }
EndPointAttr holds common endpoint attributes
func NewBlankEndPointAttr ¶ added in v0.3.1
func NewBlankEndPointAttr(ctx context.Context) EndPointAttr
NewBlankEndPointAttr creates new EndPointAttr for testing purposes func NewBlankEndPointAttr(ctx context.Context) EndPointAttr {
Click to show internal directories.
Click to hide internal directories.