assetmanager

package
v5.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset interface {
	ID() string
	Type() assets.Type
	Media() string
	URL() (string, error)
	Contents() (string, error)
	Attributes() []html.Attribute
	IsLocal() bool
	String() string
	Debug(d string) bool
}

type LocalAsset

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

func NewLocalAsset

func NewLocalAsset(relDir, assetPath string) (*LocalAsset, error)

func (*LocalAsset) Attributes

func (l *LocalAsset) Attributes() []html.Attribute

func (*LocalAsset) Contents

func (l *LocalAsset) Contents() (string, error)

func (*LocalAsset) Debug

func (l *LocalAsset) Debug(d string) bool

func (*LocalAsset) ID

func (l *LocalAsset) ID() string

func (*LocalAsset) IsLocal

func (l *LocalAsset) IsLocal() bool

func (*LocalAsset) Media

func (l *LocalAsset) Media() string

func (*LocalAsset) Path

func (l *LocalAsset) Path() string

func (*LocalAsset) String

func (l *LocalAsset) String() string

func (*LocalAsset) Type

func (l *LocalAsset) Type() assets.Type

func (*LocalAsset) URL

func (l *LocalAsset) URL() (string, error)

func (*LocalAsset) UpdatePath

func (l *LocalAsset) UpdatePath(p string)

type Manager

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

func NewManager

func NewManager(htmlDir, staticDir, jsonDir string) (*Manager, error)

func (*Manager) AddLocal

func (m *Manager) AddLocal(a *LocalAsset)

func (*Manager) AddRemote

func (m *Manager) AddRemote(a *RemoteAsset)

func (*Manager) All

func (m *Manager) All() []Asset

func (*Manager) StaticDir

func (m *Manager) StaticDir() string

func (*Manager) String

func (m *Manager) String() string

func (*Manager) WithID

func (m *Manager) WithID(id string) map[assets.Type][]Asset

func (*Manager) WithType

func (m *Manager) WithType(t assets.Type) []Asset

type RemoteAsset

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

func NewRemoteAsset

func NewRemoteAsset(ID, src string, attributes []html.Attribute, ty assets.Type) *RemoteAsset

func (*RemoteAsset) Attributes

func (r *RemoteAsset) Attributes() []html.Attribute

func (*RemoteAsset) Contents

func (r *RemoteAsset) Contents() (string, error)

func (*RemoteAsset) Debug

func (r *RemoteAsset) Debug(d string) bool

func (*RemoteAsset) ID

func (r *RemoteAsset) ID() string

func (*RemoteAsset) IsLocal

func (r *RemoteAsset) IsLocal() bool

func (*RemoteAsset) Media

func (r *RemoteAsset) Media() string

func (*RemoteAsset) String

func (r *RemoteAsset) String() string

func (*RemoteAsset) Type

func (r *RemoteAsset) Type() assets.Type

func (*RemoteAsset) URL

func (r *RemoteAsset) URL() (string, error)

Jump to

Keyboard shortcuts

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