31 lines
462 B
Go
31 lines
462 B
Go
package message
|
|
|
|
import (
|
|
"git.sr.ht/~cco/go-scopes/lib"
|
|
)
|
|
|
|
// Message implementation(s)
|
|
|
|
type strMessage string
|
|
|
|
func (msg strMessage) Head() lib.MsgHead {
|
|
return msg
|
|
}
|
|
|
|
func (msg strMessage) Action() string {
|
|
return string(msg)
|
|
}
|
|
|
|
func (msg strMessage) Sender() lib.Address {
|
|
return nil
|
|
}
|
|
|
|
func (msg strMessage) Payload() lib.Payload {
|
|
return nil
|
|
}
|
|
|
|
func StrMessage(action string) lib.Message {
|
|
return strMessage(action)
|
|
}
|
|
|
|
var Quit = StrMessage("quit")
|