diff options
author | Ruben Pollan <meskio@sindominio.net> | 2018-01-22 19:51:37 +0100 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2018-01-22 19:51:37 +0100 |
commit | 78afb3d88fbdc69df9d04505a51b5fa40a2ea37d (patch) | |
tree | 94cff657d3df0097af5926bf5a7633d0c48b717e /bitmask/main.go | |
parent | 96a892f8400bc60a3a4021d7783776e2315036ba (diff) |
[feat] add event support
Diffstat (limited to 'bitmask/main.go')
-rw-r--r-- | bitmask/main.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/bitmask/main.go b/bitmask/main.go index b4607b3..a6452ca 100644 --- a/bitmask/main.go +++ b/bitmask/main.go @@ -14,21 +14,25 @@ const ( // Bitmask holds the bitmask client data type Bitmask struct { - //eventsoc *zmq4.Socket coresoc *zmq4.Socket + eventsoc *zmq4.Socket statusCh chan string } // Init the connection to bitmask func Init() (*Bitmask, error) { statusCh := make(chan string) - socket, err := initCore() + coresoc, err := initCore() + if err != nil { + return nil, err + } + eventsoc, err := initEvents() if err != nil { return nil, err } - b := Bitmask{socket, statusCh} - go b.fetchStatus() + b := Bitmask{coresoc, eventsoc, statusCh} + go b.eventsHandler() return &b, nil } |