server

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IndexPageInfo

type IndexPageInfo struct {
	Title          string
	BitbucketURL   string
	ProjectKey     string
	RepositorySlug string
	Versions       []struct {
		Name string
		Path string
	}
}

type Server

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

func New

func New(

	logger *slog.Logger,

	all fs.FS,

	versions []*Version,

	webFS fs.FS,

	indexTemplate string,

	getInfo func() (*IndexPageInfo, error),

	timeToLive time.Duration,

	cacheMiddleware func(next http.Handler) http.Handler,
) *Server

New creates a new server using

func (*Server) GetVersionNames

func (s *Server) GetVersionNames() []string

GetVersionNames returns an array with the prefixes of the tags

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Server) Versions

func (s *Server) Versions() iter.Seq[string]

Tags returns an iterator, go 1.23.0, just for the fun of it. func (s *Server) Versions() func(yield func(string) bool) bool {

type Version

type Version struct {
	Name string
	Dir  fs.FS
}

Jump to

Keyboard shortcuts

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