resources

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(entry string, opt api.BuildOptions) ([]byte, error)

func BuildFS

func BuildFS(fs fs.FS, entry string, opt api.BuildOptions) ([]byte, error)

func Bundle

func Bundle(entry string, o api.BuildOptions) ([]byte, error)

func BundleFS

func BundleFS(fs fs.FS, entry string, o api.BuildOptions) ([]byte, error)

func Transform

func Transform(path string, o api.BuildOptions) ([]byte, error)

func TransformBytes

func TransformBytes(content []byte, o api.BuildOptions) ([]byte, error)

func TransformBytesTS

func TransformBytesTS(content []byte, o api.BuildOptions) ([]byte, error)

Types

type BaseProfile

type BaseProfile struct {
}

func (BaseProfile) Options

func (b BaseProfile) Options(profile string) api.BuildOptions

type BuildErrors

type BuildErrors []api.Message

func (BuildErrors) Error

func (b BuildErrors) Error() string

type BuildProfiles

type BuildProfiles interface {
	Options(profile string) api.BuildOptions
}

type HTMLElement

type HTMLElement struct {
	Tag     string
	Content []byte
	Attrs   templ.Attributes
}

func HTMLParseElement

func HTMLParseElement(tag string, data []byte) (*HTMLElement, error)

type InlineMode

type InlineMode int
const (
	InlineModeHost InlineMode = iota
	InlineModeLocal
	InlineModeNoCache
)

type InlineResource

type InlineResource struct {
	Attrs templ.Attributes
	// contains filtered or unexported fields
}

func (*InlineResource) Content

func (i *InlineResource) Content() []byte

func (*InlineResource) Resource

func (i *InlineResource) Resource() *Resource

func (*InlineResource) Serve

func (i *InlineResource) Serve(w http.ResponseWriter, r *http.Request)

type Registry

type Registry struct {
	Gzip     bool
	Profiles BuildProfiles
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry() *Registry

func (*Registry) InlineScript

func (r *Registry) InlineScript(data []byte, mode InlineMode) (*InlineResource, error)

func (*Registry) InlineStyle

func (r *Registry) InlineStyle(data []byte, mode InlineMode) (*InlineResource, error)

func (*Registry) MainScript

func (rg *Registry) MainScript() *Resource

func (*Registry) MainStyle

func (rg *Registry) MainStyle() *Resource

func (*Registry) Module

func (r *Registry) Module(path string, profile string) (*Resource, error)

func (*Registry) ModuleBundle

func (r *Registry) ModuleBundle(entry string, profile string) (*Resource, error)

func (*Registry) ModuleBundleFS

func (r *Registry) ModuleBundleFS(cacheKey string, fs fs.FS, entry string, profile string) (*Resource, error)

func (*Registry) ModuleBytes

func (r *Registry) ModuleBytes(content []byte, profile string) (*Resource, error)

func (*Registry) ModuleBytesTS

func (r *Registry) ModuleBytesTS(content []byte, profile string) (*Resource, error)

func (*Registry) ModuleRaw

func (r *Registry) ModuleRaw(path string) (*Resource, error)

func (*Registry) ModuleRawBytes

func (r *Registry) ModuleRawBytes(content []byte) (*Resource, error)

func (*Registry) Serve

func (rg *Registry) Serve(hash []byte, w http.ResponseWriter, r *http.Request)

func (*Registry) Style

func (r *Registry) Style(path string) (*Resource, error)

func (*Registry) StyleBytes

func (r *Registry) StyleBytes(content []byte) (*Resource, error)

type Resource

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

func NewResource

func NewResource(content []byte, contentType string, gzip bool) *Resource

func (*Resource) Content

func (s *Resource) Content() []byte

func (*Resource) Hash

func (s *Resource) Hash() []byte

func (*Resource) HashString

func (s *Resource) HashString() string

func (*Resource) Serve

func (s *Resource) Serve(w http.ResponseWriter, r *http.Request)

func (*Resource) ServeCache

func (s *Resource) ServeCache(w http.ResponseWriter, r *http.Request, cache bool)

Jump to

Keyboard shortcuts

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