server

package
v0.0.0-...-2b5c1d7 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const AppName = "http_server"

AppName is the application name

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuthMiddleware

type BasicAuthMiddleware struct {
	Username string
	Password string
}

BasicAuthMiddleware holds the informations to build a basic authentication middleware

func NewBasicAuthMiddleware

func NewBasicAuthMiddleware(username, password string) *BasicAuthMiddleware

NewBasicAuthMiddleware returns a new basic auth middleware

func (*BasicAuthMiddleware) ServeHTTP

func (ba *BasicAuthMiddleware) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)

ServeHTTP implements the negroni middleware interface

type Error

type Error struct {
	Code    int    `json:"-"`
	Message string `json:"error"`
}

Error represents an http error

func (*Error) Error

func (err *Error) Error() string

Error implements the error interface

type Season

type Season struct {
	*polochon.ShowSeason
	Episodes map[int]*index.Episode `json:"episodes"`
}

Season represents the season output of the server

func NewSeason

func NewSeason(season *polochon.ShowSeason, indexed *index.Season) *Season

NewSeason returns a new season to be JSON formated

type Server

type Server struct {
	*subapp.Base
	// contains filtered or unexported fields
}

Server represents a http server

func New

func New(config *configuration.Config, vs *library.Library, auth *auth.Manager) *Server

New returns a new server

func (*Server) Run

func (s *Server) Run(log *logrus.Entry) error

Run starts the server

func (*Server) Stop

func (s *Server) Stop(log *logrus.Entry)

Stop stops the http server

Jump to

Keyboard shortcuts

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