assets

package
v0.0.0-...-c54dfb2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: AGPL-3.0 Imports: 13 Imported by: 2 modules, 8 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(options []model.AssetOption) error

Add adds dynamic assets

func Get

func Get(name, context string) (*model.Asset, bool)

Get looks for an asset. It tries in this order: 1. A dynamic asset for the given context 2. A dynamic asset for the default context 3. A static asset.

func Head(name, context string) (*model.Asset, bool)

Head does the same job as Get, but the returned model.Asset can have no body data. It allows to use a cache for it.

func List

func List() (map[string][]*model.Asset, error)

List returns a map containing all the existing assets (statik & dynamic) Each map key represents the context

func LoadContextualizedLocale

func LoadContextualizedLocale(context, locale string)

LoadContextualizedLocale loads the translations dictionary from dynamic assets for the given locale and context.

func Open

func Open(name string, context string) (*bytes.Reader, error)

Open returns a bytes.Reader for an asset in the given context, or the default context if no context is given.

func Remove

func Remove(name, context string) error

Remove removes an asset Note: Only dynamic assets can be removed

Types

This section is empty.

Directories

Path Synopsis
Package statik contains an HTTP file system that works with zip contents.
Package statik contains an HTTP file system that works with zip contents.

Jump to

Keyboard shortcuts

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