assetpath

package
v0.0.0-kmdagger1 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service provides methods for constructing asset paths for plugins. It supports core plugins, external plugins stored on the local filesystem, and external plugins stored on the plugins CDN, and it will switch to the correct implementation depending on the plugin and the config.

func ProvideService

func ProvideService(cdn *pluginscdn.Service) *Service

func (*Service) Base

func (s *Service) Base(pluginJSON plugins.JSONData, class plugins.Class, pluginDir string) (string, error)

Base returns the base path for the specified plugin.

func (*Service) Module

func (s *Service) Module(pluginJSON plugins.JSONData, class plugins.Class, pluginDir string) (string, error)

Module returns the module.js path for the specified plugin.

func (*Service) RelativeURL

func (s *Service) RelativeURL(p *plugins.Plugin, pathStr, defaultStr string) (string, error)

RelativeURL returns the relative URL for an arbitrary plugin asset. If pathStr is an empty string, defaultStr is returned.

Jump to

Keyboard shortcuts

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