embed

package
v0.0.0-...-8f9ce2e Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnableToFindEmbed  = errors.New("unable to find the embed file/directory")
	ErrModuleDoesNotExist = errors.New("module does not exist")
	ErrInvalidTemplateRef = errors.New("invalid template reference name")
)

Functions

func Configure

func Configure(l *goapp.Lifecycle, conf *config.Config)

func ConfigureEmbedMux

func ConfigureEmbedMux(mux *web.Mux, embeds *Embeds, publicPath string, logger *log.Logger)

func PageNotFound

func PageNotFound(res http.ResponseWriter)

Types

type Embed

type Embed struct {
	Module string
	Path   string
}

type Embeds

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

func NewEmbeds

func NewEmbeds() *Embeds

func (*Embeds) Add

func (a *Embeds) Add(module string, fs embed.FS)

func (*Embeds) GetFilesByExt

func (a *Embeds) GetFilesByExt(ext string) []Embed

func (*Embeds) GetModules

func (a *Embeds) GetModules() []string

func (*Embeds) ReadDir

func (a *Embeds) ReadDir(module string, path string) ([]fs.DirEntry, error)

func (*Embeds) ReadFile

func (a *Embeds) ReadFile(module string, path string) ([]byte, error)

Jump to

Keyboard shortcuts

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