aldanin

package module
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: ISC Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	// Used when a required template isn't found, or when a panic is caught
	Printf func(format string, a ...any) (n int, err error)
	// Zero-value sets the HTTP Cache-Control Header value to "no-cache, must-revalidate"
	CacheHeaderMaxAge int
	/* Structure expected inside Files:
	www/
		(should have any non-template file needed, like css, js, favicon.ico, etc.)
		templates/
			index.html
			blob.html
			commitLine.html
			directRepo.html
			header.html
			repos.html
			refLine.html
			treeLine.html
	*/
	Files embed.FS
	Repos []struct {
		Name        string
		Description string
		Meta        string // Can be any value. Available to templates for customization
	}
	Root       string // Something like `/repos`
	BrowseRoot string // Something like `/browse`
	Protocol   string // "http" or "https", defaults to "https"
}

func (Base) ResolveBlob added in v0.8.0

func (c Base) ResolveBlob(repo, ref, p string) ([]byte, error)

ResolveBlob returns the bytes of the blob at <ref>:<path> in the repo named <repo>, walking loose objects under c.Root/<repo>/.git. Returns fs.ErrNotExist if any step (repo, ref, tree entry, blob) is missing or rejected by validation; returns other errors only for unexpected I/O or data corruption.

Only branch names are accepted as <ref> in v1 (resolved via refs/heads/<ref> and packed-refs). Pack files are not read; objects must be loose.

func (Base) ServeHTTP

func (c Base) ServeHTTP(w http.ResponseWriter, r *http.Request)

Source Files

  • aldanin.go
  • resolve.go

Directories

Path Synopsis
sample module

Jump to

Keyboard shortcuts

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