gocgi

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MIT Imports: 16 Imported by: 0

README

gocgi

simple server for host legacy cgi application e.g. cgit

Documentation

Index

Constants

View Source
const (
	SessionCookieKey = "gocgi-session"
)

Variables

This section is empty.

Functions

func WithBasicAuth

func WithBasicAuth(users []string, handler http.Handler) http.Handler

func WithLogger

func WithLogger(logger *log.Logger, handler http.Handler) http.Handler

Types

type BasicAuthHandler

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

func (*BasicAuthHandler) Check

func (h *BasicAuthHandler) Check(username, passwd string) bool

func (*BasicAuthHandler) CheckCookie

func (h *BasicAuthHandler) CheckCookie(r *http.Request) bool

func (*BasicAuthHandler) CheckUsername

func (h *BasicAuthHandler) CheckUsername(username string) bool

func (*BasicAuthHandler) ServeHTTP

func (h *BasicAuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type FlagMap

type FlagMap map[string]string

func (*FlagMap) Set

func (f *FlagMap) Set(s string) error

func (*FlagMap) String

func (f *FlagMap) String() string

type FlagStrings

type FlagStrings []string

func (*FlagStrings) Set

func (f *FlagStrings) Set(s string) error

func (*FlagStrings) String

func (f *FlagStrings) String() string

type GoCGIOptions

type GoCGIOptions struct {
	Addr       string
	Path       string
	Root       string
	Dir        string
	Env        FlagStrings
	InheritEnv FlagStrings
	Args       FlagStrings
	Stderr     string
	StaticMap  FlagMap
	Users      FlagStrings
}

func NewGoCGIOptions

func NewGoCGIOptions() *GoCGIOptions

func (*GoCGIOptions) BindFlags

func (g *GoCGIOptions) BindFlags(flagSet *flag.FlagSet)

type LoggerHandler

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

func (*LoggerHandler) ServeHTTP

func (h *LoggerHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Server

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

func New

func New(logger *log.Logger, opts *GoCGIOptions) (*Server, error)

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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