mark

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: Apache-2.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultPort = 7357
View Source
const EnvURL = "TB_EVENTS_URL"

Variables

This section is empty.

Functions

func AddrFile

func AddrFile(dir string) string

func Find

func Find(explicit, dir string) (string, error)

func Send

func Send(ctx context.Context, endpoint, device string, texts []string) (int, error)

Types

type Event

type Event struct {
	At     time.Time
	Text   string
	Device string
	Seq    int
}

func Parse

func Parse(body []byte, contentType string) ([]Event, error)

type Hub

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

func NewHub

func NewHub() *Hub

func (*Hub) Add

func (h *Hub) Add(device string, texts ...string) int

func (*Hub) AddEvents

func (h *Hub) AddEvents(evs []Event) int

func (*Hub) Between

func (h *Hub) Between(start, end time.Time, names ...string) []Event

func (*Hub) Count

func (h *Hub) Count() (kept, dropped int)

func (*Hub) Handler

func (h *Hub) Handler() http.Handler

type Server

type Server struct {
	URL    string
	Port   int
	Shared bool
	// contains filtered or unexported fields
}

func Serve

func Serve(h *Hub, port int, dir string) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

Jump to

Keyboard shortcuts

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