server

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 10 Imported by: 8

Documentation

Index

Constants

View Source
const DefaultPort = 2345

Variables

This section is empty.

Functions

This section is empty.

Types

type Input added in v0.0.6

type Input struct {
	url.Values
	// contains filtered or unexported fields
}

func (Input) Scan added in v0.0.6

func (i Input) Scan(target any) error

type JsonError added in v0.0.6

type JsonError struct {
	Code  int
	Error string
}

type Options added in v0.0.3

type Options struct {
	Port int
}

type Output added in v0.0.6

type Output struct {
	Data any
	Code int
}

type Server

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

func NewServer

func NewServer(opts Options) *Server

func (*Server) GetUrl added in v0.0.3

func (s *Server) GetUrl() string

func (*Server) Handle added in v0.0.5

func (s *Server) Handle(url string, handler func(input Input) (filename string, placeholders map[string]string))

func (*Server) HandleJSON added in v0.0.6

func (s *Server) HandleJSON(url string, handler func(input Input) (o Output))

func (*Server) Start

func (s *Server) Start()

func (*Server) Stop

func (s *Server) Stop()

Jump to

Keyboard shortcuts

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