server

package
v0.0.0-...-1e0dac5 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Server)

func WithAddr

func WithAddr(addr string) Option

func WithPort

func WithPort(port uint16) Option

type OptionFunc

type OptionFunc func(addr string) Option

type Server

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

func New

func New(ctx context.Context, options ...Option) *Server

func (*Server) Addr

func (s *Server) Addr() string

func (*Server) Decode

func (s *Server) Decode(_ http.ResponseWriter, r *http.Request, v interface{}) error

func (*Server) HandleIndex

func (s *Server) HandleIndex() http.HandlerFunc

func (*Server) HandleTemplate

func (s *Server) HandleTemplate(files ...string) http.HandlerFunc

func (*Server) Port

func (s *Server) Port() uint16

func (*Server) Respond

func (s *Server) Respond(w http.ResponseWriter, _ *http.Request, data interface{}, status int)

func (*Server) Run

func (s *Server) Run(ctx context.Context, addr string)

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, version string)

Serve is the Server Entry Point

func (*Server) SetAddr

func (s *Server) SetAddr(addr string)

func (*Server) SetPort

func (s *Server) SetPort(port uint16)

Jump to

Keyboard shortcuts

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