inspect

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inspector

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

Inspector implements an http handler that serves a UI that shows stored messages.

func NewInspector

func NewInspector(s Store) *Inspector

NewInspector returns a new instance of the Inspector.

func (*Inspector) ServeHTTP

func (i *Inspector) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP is a httpHandler that renders the index.tmpl with the messages stored.

type Pagination

type Pagination struct {
	Page  int
	Limit int
}

Pagination defines a page and limit to get paginated messages.

type Query

type Query struct {
	Pagination
}

Query defines the filters to request messages.

type Result

type Result struct {
	Total int
	Msgs  []*messenger.GenericMessage
}

Result defines the paginated messages.

type Store

type Store interface {
	Find(ctx context.Context, q *Query) (*Result, error)
	Republish(ctx context.Context, msgID ...string) error
}

Store knows how to retrieve messages.

Jump to

Keyboard shortcuts

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