res

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const UrlPrefix = "res:"

Variables

This section is empty.

Functions

func Fs

func Fs() http.FileSystem

func IsUrl

func IsUrl(url string) bool

func Path

func Path(url string) string

Types

type Resource

type Resource = *ResourceT

func FromPath

func FromPath(path string) Resource

func FromUrl

func FromUrl(url string) Resource

func (Resource) CopyToDir

func (me Resource) CopyToDir(afs afero.Fs, targetDir string)

func (Resource) CopyToFile

func (me Resource) CopyToFile(afs afero.Fs, targetFile string)

func (Resource) Open

func (me Resource) Open() http.File

func (Resource) Path

func (me Resource) Path() string

func (Resource) ReadBytes

func (me Resource) ReadBytes() []byte

func (Resource) ReadText

func (me Resource) ReadText() string

func (Resource) RenderWithTemplate

func (me Resource) RenderWithTemplate(w io.Writer, data map[string]any)

func (Resource) Url

func (me Resource) Url() string

type ResourceT

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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