server

package
v0.0.0-...-1495e9f Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EditGenerator

type EditGenerator struct {
	generator.Generator
	IsEditable bool
}

EditGenerator contains the generator and if it is editable

type Handler

type Handler func(*http.Request, http.ResponseWriter) error

Handler takes a context, request and response writer

type Server

type Server struct {
	Logger *log.Logger
	generator.Store
}

Server contains the logger and a generator.Store

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(addr string) error

ListenAndServe creates a context, registers all handlers and starts listening on the provided addr

type ShowGenerator

type ShowGenerator struct {
	generator.Generator
	IsEditable bool
}

ShowGenerator contains the generator and if it is editable

type ShowMeta

type ShowMeta struct {
	Timestamp time.Time `json:"timestamp"`
	Name      string    `json:"name"`
	Count     int       `json:"count"`
}

type ShowResponse

type ShowResponse struct {
	Meta ShowMeta `json:"meta"`
	Data []string `json:"data"`
}

Jump to

Keyboard shortcuts

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