static

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileServer

type FileServer struct {
	PublishDir afero.Fs
	// contains filtered or unexported fields
}

func NewFileServer

func NewFileServer(dest afero.Fs) *FileServer

func (*FileServer) Serve

func (s *FileServer) Serve() error

type Headers

type Headers struct {
	For    string
	Values map[string]any
}

type Redirect

type Redirect struct {
	From string
	To   string

	// HTTP status code to use for the redirect.
	// A status code of 200 will trigger a URL rewrite.
	Status int

	// Forcode redirect, even if original request path exists.
	Force bool
}

func (Redirect) IsZero

func (r Redirect) IsZero() bool

type Server

type Server struct {
	Headers   []Headers
	Redirects []Redirect
	// contains filtered or unexported fields
}

func (*Server) CompileConfig

func (s *Server) CompileConfig(logger loggers.Logger) error

func (*Server) MatchHeaders

func (s *Server) MatchHeaders(pattern string) []types.KeyValueStr

func (*Server) MatchRedirect

func (s *Server) MatchRedirect(pattern string) Redirect

Jump to

Keyboard shortcuts

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