server

package
v0.0.0-...-0464d78 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var URLs = [][2]interface{}{

	{"/", indexPage},

	{"/stats/mem", memoryUsage},

	{"/api/search", searchAPI},
	{"/api/search/advanced", advancedSearchAPI},

	{"/api/competitions-list", getCompetitionsList},
	{"/api/competition/weeks", getCompetitionWeeks},
	{"/api/competition/standing-table", getCompetitionStandingTable},
	{"/api/competition/matches/week", getMatchesByWeekNumber},

	{"/api/match/info", getMatchInfo},
	{"/api/matches", getMatchesByDate},

	{"/api/transfers/regions", getTransfersRegions},
	{"/api/transfers", getTransfers},
}

Functions

func Serve

func Serve(addr string, s *fasthttp.Server, mux *ServeMux) error

func ServeTLS

func ServeTLS(addr, certFile, keyFile string, s *fasthttp.Server, mux *ServeMux) error

Types

type Handler

type Handler func(ctx *fasthttp.RequestCtx, cli *api.Session, c *cache.Cache) error

type ServeMux

type ServeMux struct {
	APIClient *api.Session
	Cache     *cache.Cache

	// Logger
	Logger *logging.FileLogger

	// ErrorHandler
	ErrorHandler func(ctx *fasthttp.RequestCtx, err error)

	// Logs functions ping speed
	LogSpeed bool
	// contains filtered or unexported fields
}

func (*ServeMux) AddHandler

func (m *ServeMux) AddHandler(path string, f Handler)

func (*ServeMux) HandleHTTP

func (m *ServeMux) HandleHTTP(ctx *fasthttp.RequestCtx)

func (*ServeMux) Init

func (m *ServeMux) Init()

Jump to

Keyboard shortcuts

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