assets

package
v0.0.0-...-a7c217f Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: AGPL-3.0 Imports: 13 Imported by: 8

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