You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
354 B
22 lines
354 B
package event |
|
|
|
type Event[T any] interface { |
|
Topic() string |
|
Payload2Bytes(T) []byte |
|
Bytes2Payload([]byte) T |
|
} |
|
|
|
type online struct { |
|
} |
|
|
|
func (o *online) Topic() string { |
|
return "postal_event_online" |
|
} |
|
|
|
func (o *online) Payload2Bytes(t string) []byte { |
|
return []byte(t) |
|
} |
|
|
|
func (o *online) Bytes2Payload(bytes []byte) string { |
|
return string(bytes) |
|
}
|
|
|