events

package
v0.52.5 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: GPL-3.0 Imports: 15 Imported by: 1

Documentation

Overview

Package events based on https://thoughtbot.com/blog/writing-a-server-sent-events-server-in-go

Index

Constants

View Source
const Any = "*"

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker interface {
	http.Handler
	SendMessage(ctx context.Context, event Event)
}

func GetBroker added in v0.44.0

func GetBroker() Broker

type Event

type Event interface {
	Name(Event) string
	Data(Event) string
}

type KeepAlive

type KeepAlive struct {
	TS int64 `json:"ts"`
	// contains filtered or unexported fields
}

func (*KeepAlive) Data added in v0.44.0

func (e *KeepAlive) Data(evt Event) string

func (*KeepAlive) Name added in v0.44.0

func (e *KeepAlive) Name(evt Event) string

type RefreshResource added in v0.44.0

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

func (*RefreshResource) Data added in v0.44.0

func (rr *RefreshResource) Data(evt Event) string

func (*RefreshResource) Name added in v0.44.0

func (e *RefreshResource) Name(evt Event) string

func (*RefreshResource) With added in v0.44.0

func (rr *RefreshResource) With(resource string, ids ...string) *RefreshResource

type ScanStatus

type ScanStatus struct {
	Scanning    bool  `json:"scanning"`
	Count       int64 `json:"count"`
	FolderCount int64 `json:"folderCount"`
	// contains filtered or unexported fields
}

func (*ScanStatus) Data added in v0.44.0

func (e *ScanStatus) Data(evt Event) string

func (*ScanStatus) Name added in v0.44.0

func (e *ScanStatus) Name(evt Event) string

type ServerStart

type ServerStart struct {
	StartTime time.Time `json:"startTime"`
	Version   string    `json:"version"`
	// contains filtered or unexported fields
}

func (*ServerStart) Data added in v0.44.0

func (e *ServerStart) Data(evt Event) string

func (*ServerStart) Name added in v0.44.0

func (e *ServerStart) Name(evt Event) string

Jump to

Keyboard shortcuts

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