25 lines
535 B
Markdown
25 lines
535 B
Markdown
Real stomp - websocket impl stomp library in go
|
|
|
|
> How to use?
|
|
>> go get "git.sis.ski/moxitech/realstomp-go"
|
|
|
|
Example of create connection:
|
|
|
|
```
|
|
// Stomper interface defines the basic methods
|
|
type Stomper interface {
|
|
Send(topic string, id int, data []byte) error
|
|
}
|
|
|
|
// StompClient implements the Stomper interface
|
|
type StompClient struct {
|
|
conn *stomp.Conn
|
|
state bool
|
|
brokerURL string
|
|
waitMessages map[string]*time.Timer
|
|
mutex sync.Mutex
|
|
}
|
|
|
|
// make client from StompClient and invoke connect method
|
|
|
|
``` |