山魈用于处理来自传入事件的Go库。

安装命令: go get github.com/leejarvis/mandrill

例子:


package main



import (

    \"fmt\"

    \"net/http\"

    \"github.com/leejarvis/mandrill\"

)



func main() {

    http.Handle(\"/\", mandrill.EventHandler(func(e mandrill.Event) {

        fmt.Println(e.Type) // sent/click/deferred

        // 插入事件到数据库或其他操作

    }))

    http.ListenAndServe(\":3000\", nil)

}