api

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(service *services.ObjectService) http.HandlerFunc

Delete defines an HTTP handler function for deleting an object by key. It expects a JSON request body with the "key" field and deletes the corresponding object.

func Get

func Get(service *services.ObjectService) http.HandlerFunc

Get defines an HTTP handler function for retrieving an object by key. It expects a JSON request body with the "key" field and retrieves the corresponding object.

func Put

func Put(service *services.ObjectService) http.HandlerFunc

Put defines an HTTP handler function for creating or updating an object. It expects a JSON request body with "key" and "value" fields.

func Route

func Route(service *services.ObjectService, ctx context.Context, cfg *config.Config) *http.ServeMux

Route creates a new mux with the liveness and readiness probe (/liveness, /readiness), the static assets endpoint (/) and the store endpoints (/api/v1/store).

func View added in v0.1.7

func View(engine *templating.Engine, name string, data any) http.HandlerFunc

View defines an HTTP handler function for rendering a template with data.

func ViewIndex added in v0.1.7

func ViewIndex(engine *templating.Engine, serverSessions *security.ServerSessions) http.HandlerFunc

ViewIndex defines an HTTP handler function for rendering the index template.

func ViewStore added in v0.1.7

func ViewStore(engine *templating.Engine, serverSessions *security.ServerSessions) http.HandlerFunc

ViewStore defines an HTTP handler function for rendering the store template.

Types

This section is empty.

Jump to

Keyboard shortcuts

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