github.com/artisanhe/tools@v1.0.1-0.20210607022958-19a8fef2eb04/catgo/cat-go/message/event.go (about) 1 package message 2 3 type Event struct { 4 Message 5 } 6 7 func (e *Event) Complete() { 8 if e.Message.flush != nil { 9 e.Message.flush(e) 10 } 11 } 12 13 func NewEvent(mtype, name string, flush Flush) *Event { 14 return &Event{ 15 Message: NewMessage(mtype, name, flush), 16 } 17 }