stream

package
v0.0.0-...-dc49242 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	BaseURL  string
	PageSize int
	// contains filtered or unexported fields
}

func NewApp

func NewApp(db db.DB) *App

func (*App) Bind

func (a *App) Bind(r chi.Router)

func (*App) GetAdmin

func (a *App) GetAdmin() (app.Admin, error)

Return an Admin object that can render admin homepage panels and register all of the administrative pages.

func (*App) Migrate

func (a *App) Migrate() error

func (*App) Name

func (a *App) Name() string

func (*App) Register

func (a *App) Register(reg *mtr.Registry)

func (*App) WithBaseURL

func (a *App) WithBaseURL(url string) *App

type Event

type Event struct {
	// An Id is a basic auto-increment id within the local db
	Id int
	// Title is a title for the event
	Title string
	// SourceId is the id of this event in the upstream system, eg. a commit hash
	// or a tweet ID
	SourceId string `db:"source_id"`
	// Timestamp is a unix timestamp of when this event happened
	Timestamp time.Time
	// Type is an indicator of where this came from, eg. "github" or "bluesky"
	Type string
	// Url is a permalink for this event
	Url string

	// Data is the full event in its original format, probably json
	Data string
	// SummaryRendered is a pre-rendered summary of the event, which gets displayed
	// on the event stream list
	SummaryRendered string `db:"summary_rendered"`
}

An Event is something like a post, a git commit, a photo upload, etc.

type EventService

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

An EventService manages events.

func NewEventService

func NewEventService(db db.DB) *EventService

func (*EventService) InsertArchive

func (s *EventService) InsertArchive(e *Event) error

func (*EventService) Select

func (s *EventService) Select(where string, args ...interface{}) ([]*Event, error)

Select multiple posts via a query.

type Loader

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

func NewLoader

func NewLoader(db db.DB) *Loader

func (*Loader) Load

func (l *Loader) Load(r io.Reader) error

Jump to

Keyboard shortcuts

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