| 1234567891011121314151617181920212223242526 |
- package eventBase
- type PairEvent[K any, V any] struct {
- EmptyEvent
- key K
- value V
- }
- func NewPairEvent[K any, V any](id int64, name string, key K, value V) PairEvent[K, V] {
- return PairEvent[K, V]{
- EmptyEvent: EmptyEvent{
- id: id,
- name: name,
- },
- key: key,
- value: value,
- }
- }
- func (p *PairEvent[K, V]) Key() K {
- return p.key
- }
- func (p *PairEvent[K, V]) Value() V {
- return p.value
- }
|