web

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Index        = View[IndexArgs]("views/index.gohtml")
	RequestTable = View[HeadlineArgs]("views/requests/list.gohtml")
	RequestView  = View[dbo.Request]("views/requests/get.gohtml")

	EndpointTable = View[EndpointArgs]("views/endpoints/list.gohtml")
)
View Source
var Static embed.FS

Functions

func Handler

func Handler[T any](v *view.View[T], handler func(ctx context.Context, req *http.Request) (T, error)) http.HandlerFunc

func View

func View[Args any](path string) *view.View[Args]

func Web

func Web(store *dbo.Queries) http.Handler

Types

type EndpointArgs

type EndpointArgs struct {
	Records  []dbo.Endpoint
	Page     int
	PageSize int
}

type HeadlineArgs

type HeadlineArgs struct {
	Records  []dbo.Headline
	Page     int
	PageSize int
	Term     string
}

type IndexArgs

type IndexArgs struct {
	TopEndpoints []dbo.Endpoint
}

Jump to

Keyboard shortcuts

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