site

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSiteNotFound = errors.New("site not found")

Functions

func CheckDefaultSite

func CheckDefaultSite(siteName *string, defaultSite string) bool

Types

type Descriptor

type Descriptor struct {
	ID     string
	Domain string
	Config *config.SiteConfig
	FS     FS
}

type FS

type FS interface {
	Stat(path string) (*FileInfo, error)
	Open(ctx context.Context, path string) (io.ReadSeekCloser, error)
}

func SubFS

func SubFS(fs FS, dir string) FS

type FileInfo

type FileInfo struct {
	IsDir       bool
	ModTime     time.Time
	Size        int64
	ContentType string
	Hash        string
}

type Resolver

type Resolver interface {
	Kind() string
	// IsWildcard indicates whether this resolver would always resolve successfully.
	IsWildcard() bool
	Resolve(ctx context.Context, matchedID string) (*Descriptor, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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