resources

package
v0.12.14 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultProfile added in v0.12.1

func DefaultProfile(profile string) api.BuildOptions

Types

type App added in v0.12.1

type App interface {
	Conf() *common.Conf
	ESProfile(profile string) api.BuildOptions
}

type BuildErrors

type BuildErrors []api.Message

func (BuildErrors) Error

func (b BuildErrors) Error() string

type FormatCommon

type FormatCommon struct {
	Bundle bool
}

func (FormatCommon) Apply

func (f FormatCommon) Apply(opt *api.BuildOptions)

type FormatDefault

type FormatDefault struct{}

func (FormatDefault) Apply

func (f FormatDefault) Apply(opt *api.BuildOptions)

type FormatIIFE

type FormatIIFE struct {
	Bundle     bool
	GlobalName string
}

func (FormatIIFE) Apply

func (f FormatIIFE) Apply(opt *api.BuildOptions)

type FormatModule

type FormatModule struct {
	Bundle bool
}

func (FormatModule) Apply

func (f FormatModule) Apply(opt *api.BuildOptions)

type FormatRaw

type FormatRaw struct{}

func (FormatRaw) Apply

func (f FormatRaw) Apply(opt *api.BuildOptions)

type Kind

type Kind int
const (
	KindJS Kind = iota
	KindTS
)

func (Kind) Loader

func (e Kind) Loader() api.Loader

func (Kind) String

func (e Kind) String() string

type Registry

type Registry = *registry

func NewRegistry

func NewRegistry(s App) Registry

func (Registry) MainScript

func (rs Registry) MainScript() *Resource

func (Registry) MainStyle

func (rs Registry) MainStyle() *Resource

func (Registry) Script

func (rs Registry) Script(entry ScriptEntry, format ScriptFormat, profile string, mode ResourceMode) (*Resource, error)

func (Registry) Serve

func (rs Registry) Serve(id string, w http.ResponseWriter, r *http.Request)

func (Registry) Static

func (rs Registry) Static(entry StaticEntry, contentType string) (*Resource, error)

func (Registry) Style

func (rs Registry) Style(entry StyleEntry, minify bool, mode ResourceMode) (*Resource, error)

type Resource

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

func NewResource

func NewResource(content []byte, contentType string, s resourceSettings) *Resource

func (*Resource) Content

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

func (*Resource) ID

func (s *Resource) ID() 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)

type ResourceMode

type ResourceMode int
const (
	ModeHost ResourceMode = iota
	ModeNoHost
	ModeNoCache
)

type ScriptBytes

type ScriptBytes struct {
	Content []byte
	Kind    Kind
}

func (ScriptBytes) Apply

func (e ScriptBytes) Apply(opt *api.BuildOptions) error

func (ScriptBytes) Read

func (e ScriptBytes) Read() ([]byte, error)

type ScriptEntry

type ScriptEntry interface {
	Read() ([]byte, error)
	Apply(*api.BuildOptions) error
	// contains filtered or unexported methods
}

type ScriptFS

type ScriptFS struct {
	FS   fs.FS
	Path string
	Name string
}

func (ScriptFS) Apply

func (e ScriptFS) Apply(opt *api.BuildOptions) error

func (ScriptFS) Read

func (e ScriptFS) Read() ([]byte, error)

type ScriptFormat

type ScriptFormat interface {
	Apply(*api.BuildOptions)
	// contains filtered or unexported methods
}

type ScriptInlineBytes

type ScriptInlineBytes struct {
	Content []byte
	Kind    Kind
}

func (ScriptInlineBytes) Apply

func (e ScriptInlineBytes) Apply(opt *api.BuildOptions) error

func (ScriptInlineBytes) Read

func (e ScriptInlineBytes) Read() ([]byte, error)

type ScriptInlineFS

type ScriptInlineFS struct {
	FS   fs.FS
	Path string
	Name string
}

func (ScriptInlineFS) Apply

func (e ScriptInlineFS) Apply(opt *api.BuildOptions) error

func (ScriptInlineFS) Read

func (e ScriptInlineFS) Read() ([]byte, error)

type ScriptInlinePath

type ScriptInlinePath struct {
	Path string
}

func (ScriptInlinePath) Apply

func (e ScriptInlinePath) Apply(opt *api.BuildOptions) error

func (ScriptInlinePath) Read

func (e ScriptInlinePath) Read() ([]byte, error)

type ScriptInlineString

type ScriptInlineString struct {
	Content string
	Kind    Kind
}

func (ScriptInlineString) Apply

func (e ScriptInlineString) Apply(opt *api.BuildOptions) error

func (ScriptInlineString) Read

func (e ScriptInlineString) Read() ([]byte, error)

type ScriptPath

type ScriptPath struct {
	Path string
}

func (ScriptPath) Apply

func (e ScriptPath) Apply(opt *api.BuildOptions) error

func (ScriptPath) Read

func (e ScriptPath) Read() ([]byte, error)

type ScriptString

type ScriptString struct {
	Content string
	Kind    Kind
}

func (ScriptString) Apply

func (e ScriptString) Apply(opt *api.BuildOptions) error

func (ScriptString) Read

func (e ScriptString) Read() ([]byte, error)

type StaticBytes

type StaticBytes struct {
	Content []byte
}

func (StaticBytes) Read

func (e StaticBytes) Read() ([]byte, error)

type StaticEntry

type StaticEntry interface {
	Read() ([]byte, error)
	// contains filtered or unexported methods
}

type StaticFS

type StaticFS struct {
	FS   fs.FS
	Path string
	Name string
}

func (StaticFS) Read

func (e StaticFS) Read() ([]byte, error)

type StaticPath

type StaticPath struct {
	Path string
}

func (StaticPath) Read

func (e StaticPath) Read() ([]byte, error)

type StaticString

type StaticString struct {
	Content string
}

func (StaticString) Read

func (e StaticString) Read() ([]byte, error)

type StyleBytes

type StyleBytes struct {
	Content []byte
}

func (StyleBytes) Read

func (e StyleBytes) Read() ([]byte, error)

type StyleEntry

type StyleEntry interface {
	Read() ([]byte, error)
	// contains filtered or unexported methods
}

type StyleFS

type StyleFS struct {
	FS   fs.FS
	Path string
	Name string
}

func (StyleFS) Read

func (e StyleFS) Read() ([]byte, error)

type StylePath

type StylePath struct {
	Path string
}

func (StylePath) Read

func (e StylePath) Read() ([]byte, error)

type StyleString

type StyleString struct {
	Content string
}

func (StyleString) Read

func (e StyleString) Read() ([]byte, error)

Jump to

Keyboard shortcuts

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