assets

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2020 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package assets provides functionality to load asset files that were packed into the binary during compilation.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupported = fmt.Errorf("operation not supported for asset file")

Functions

This section is empty.

Types

type Environment added in v0.3.0

type Environment struct {
	Assets http.FileSystem
}

Environment used to configure the behaviour of calls to the ssh library.

func (*Environment) Include added in v0.3.0

func (env *Environment) Include(options ...func(*Environment)) script.Option

Include the assets library in a script environment.

func (*Environment) Library added in v0.3.0

func (env *Environment) Library(options ...func(*Environment)) script.Library

Library prepares a new assets library for use within a script environment.

func (*Environment) OpenFile added in v0.3.0

func (env *Environment) OpenFile(path string) (file.Type, error)

OpenFile that was packed into the compiled binary. The resulting file does not support many operations such as Chown, Write, etc. but you may read it's contents or copy it to another file i.e. one opened by ssh or sys.

@callable: assets.openFile @param: path @String @retval: file @File @retval: err @Error

@usage: f, err = assets.openFile("/path/to/asset")

type File added in v0.3.0

type File struct {
	http.File
	// contains filtered or unexported fields
}

func (File) Chmod added in v0.3.0

func (f File) Chmod(os.FileMode) error

Chmod is unsupported and always returns an error.

func (File) Chown added in v0.3.0

func (f File) Chown(uid, gid int) error

Chown is unsupported and always returns an error.

func (File) Move added in v0.3.0

func (f File) Move(dstPath string) error

Move is unsupported and always returns an error.

func (File) Name added in v0.3.0

func (f File) Name() string

Name of the file as provided to openFile.

func (File) Remove added in v0.3.0

func (f File) Remove() error

Remove is unsupported and always returns an error.

func (File) Sync added in v0.3.0

func (f File) Sync() error

Sync does nothing.

func (File) Write added in v0.3.0

func (f File) Write(p []byte) (int, error)

Write is unsupported and always returns an error.

Jump to

Keyboard shortcuts

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