server

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is responsible for the management of a Gosherve instance. This includes the logger, metrics, configuration and starting the HTTP server.

func NewServer

func NewServer(webroot *fs.FS, src string) *Server

NewServer returns a newly constructed Server

func (*Server) LookupRedirect

func (s *Server) LookupRedirect(alias string) (string, error)

LookupRedirect checks if an alias/redirect has been specified and returns it. If not found, this method will update the list of redirects and retry the lookup.

func (*Server) NumRedirects

func (s *Server) NumRedirects() int

NumRedirects returns the number of redirects that are currently defined

func (*Server) RefreshRedirects

func (s *Server) RefreshRedirects() error

RefreshRedirects is used to refresh the list of configured redirects in the manager by fetching the latest copy from the specified source.

func (*Server) Start

func (s *Server) Start()

Start is used to start the Gosherve server, listening on port 8080. A metrics server is also started on port 8081.

Jump to

Keyboard shortcuts

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