assets

package
v0.0.0-...-79996cc Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package assets gets us off go-bindata by using Go 1.16 embed support.

For Go 1.16 embed, this source file had to live inside the assets/ folder to embed the sub-files, so couldn't be under pkg/ like pkg/bindata/ was.

Historically code referred to assets like "assets/fonts/DejaVuSans.ttf" but Go embed would just use "fonts/DejaVuSans.ttf" as that's what's relative to this source file.

The functions in this module provide backwards compatibility by ignoring the "assets/" prefix sent by calling code.

Index

Constants

This section is empty.

Variables

View Source
var Embedded embed.FS

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset returns the byte data of an embedded asset.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the list of embedded files at the directory name.

func AssetNames

func AssetNames() []string

AssetNames dumps the names of all embedded assets, with their legacy "assets/" prefix from go-bindata.

Types

This section is empty.

Jump to

Keyboard shortcuts

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