sse

package
v0.18.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broadcaster

type Broadcaster struct {
	// contains filtered or unexported fields
}

func NewBroadcaster

func NewBroadcaster(logger *slog.Logger) *Broadcaster

func (*Broadcaster) Broadcast

func (b *Broadcaster) Broadcast(event Event)

func (*Broadcaster) Subscribe

func (b *Broadcaster) Subscribe() chan Event

func (*Broadcaster) Unsubscribe

func (b *Broadcaster) Unsubscribe(ch chan Event)

type Event

type Event struct {
	Timestamp time.Time `json:"ts"`
	Sequence  uint64    `json:"seq"`
	QueryType string    `json:"queryType"`
	Domain    string    `json:"domain"`
	Result    string    `json:"result"`
	ClientIP  string    `json:"ip"`
	Source    string    `json:"src"`
	Blocked   bool      `json:"blocked"`
	Cached    bool      `json:"cached"`
	Cause     string    `json:"cause,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL