Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Closer ¶
type Closer interface {
Close() error
}
Closer is the interface that groups the Close methods.
type EventHandler ¶
type EventHandler interface { Typ() string Check(context.Context, any) (need bool, err error) Encode(any) ([]byte, error) Decode([]byte) (any, error) Handle(context.Context, any) error }
EventHandler is the interface that groups a few methods.
type Hydro ¶
type Hydro struct { *haxmap.Map[string, EventHandler] // contains filtered or unexported fields }
Hydro is the simplest wal implementation.
func (*Hydro) Register ¶
func (h *Hydro) Register(handler EventHandler)
Register registers a new event handler.
type HydroEvent ¶
type HydroEvent struct { // A global unique identifier. ID uint64 `json:"ID"` // Registered event type name. Type string `json:"type"` // The encoded log item. Item []byte `json:"item"` }
HydroEvent indicates a log event.
func NewHydroEvent ¶
func NewHydroEvent(ID uint64, typ string, item []byte) *HydroEvent
NewHydroEvent initializes a new HydroEvent instance.
type Registry ¶
type Registry interface {
Register(EventHandler)
}
Registry is the interface that wraps the basic Register method.
Click to show internal directories.
Click to hide internal directories.