api

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package api implements a HTTP api.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API is an http api handler.

func New

func New(app Application, obsvr *observe.Observer) *API

New returns an api handler.

func (*API) ServeHTTP

func (a *API) ServeHTTP(rw http.ResponseWriter, req *http.Request)

ServeHTTP serves and http request.

type Application

type Application interface {
	// Render renders a template with the given data.
	Render(ctx context.Context, path string, data map[string]string) ([]byte, error)
}

Application represents the main application.

Jump to

Keyboard shortcuts

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