Categorygithub.com/colindev/events
repositorypackage
3.0.1+incompatible
Repository: https://github.com/colindev/events.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

Event Driver

Depend on Redis

Go Report Card Build Status

  • GoDoc event
  • GoDoc launcher
  • GoDoc listener
  • GoDoc client
  • GoDoc server
  • GoDoc cli

Server

./events-server -env [env file]

Listaner


lis := listener.New(func()(client.Conn, error){ return client.Dial("[APP NAME]", "[HOST:PORT]")}).
    On(event.Event("prefix.*"), func(ev event.Event, rd event.RawData){
        // do some thing...
    }).
    On(event.Event("another.name"), func(ev event.Event, rd event.RawData){
        // do some thing for "another.name"
    })
    
lis.Run("prefix.*", "another.*")


Launcher


lau := launcher.New(client.NewPool(func()(client.Conn, error){ return client.Dial("[APP NAME]", "[HOST:PORT]")}, maxIdleConn))
lau.Fire(event.Event("prefix.a"), event.RawData("......"))

App name 行為

  • "" 空字串代表匿名連線, server 不會紀錄此連線的歷程
  • 非空字串, 記名連線, server 會接收 client conn 的 recover 訊號重新發送上次斷線時間點的全部事件
    • TODO #29, #4

其他部份

https://github.com/colindev/events/milestone/1