local

package
v0.0.0-...-e34a27c Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2020 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	CtxNames contextKey = iota
	CtxSources
)

Variables

This section is empty.

Functions

func AllSources

func AllSources(register assetfsapi.LocalSourceRegister, ctx context.Context) (sources []assetfsapi.LocalSource)

func Digest

func Digest(pth string) (digest *[sha256.Size]byte, err error)

func FilePath

func FilePath(pth ...string) string

func GetNames

func GetNames(ctx context.Context) (names []string)

func GetSources

func GetSources(ctx context.Context) (sources []assetfsapi.LocalSource)

func SetNames

func SetNames(ctx context.Context, names ...string) context.Context

func SetSources

func SetSources(ctx context.Context, sources ...assetfsapi.LocalSource) context.Context

func UnshiftNames

func UnshiftNames(ctx context.Context, names ...string) context.Context

func UnshiftSources

func UnshiftSources(ctx context.Context, sources ...assetfsapi.LocalSource) context.Context

Types

type File

type File struct {
	FileInfo
	// contains filtered or unexported fields
}

func NewFile

func NewFile(fileInfo FileInfo, reader func() (io.ReadCloser, error), digest *[sha256.Size]byte) *File

func (*File) Appender

func (f *File) Appender() (io.WriteCloser, error)

func (*File) Data

func (f *File) Data() ([]byte, error)

func (*File) DataS

func (f *File) DataS() (string, error)

func (*File) Digest

func (f *File) Digest() (d [sha256.Size]byte)

func (File) GetFileInfo

func (f File) GetFileInfo() os.FileInfo

func (*File) ImportLocal

func (f *File) ImportLocal(localPath, name string, info os.FileInfo) (err error)

func (*File) MustData

func (f *File) MustData() []byte

func (*File) MustDataS

func (f *File) MustDataS() string

func (*File) Open

func (f *File) Open() (io.Reader, error)

func (*File) Reader

func (f *File) Reader() (io.ReadCloser, error)

func (*File) RealPath

func (f *File) RealPath() string

func (*File) Type

func (f *File) Type() api.FileType

func (*File) Writer

func (f *File) Writer() (io.WriteCloser, error)

type FileInfo

type FileInfo = api.BasicFileInfo

type LocalSourcesAttribute

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

func (*LocalSourcesAttribute) LocalSources

func (*LocalSourcesAttribute) SetLocalSources

func (a *LocalSourcesAttribute) SetLocalSources(localSources assetfsapi.LocalSourceRegister)

type SourceDir

type SourceDir struct {
	Path string
}

func NewSourceDir

func NewSourceDir(dir string) *SourceDir

func (*SourceDir) Dir

func (d *SourceDir) Dir() string

func (*SourceDir) Get

func (d *SourceDir) Get(name string) (info assetfsapi.LocalSourceInfo, err error)

type SourceDirInfo

type SourceDirInfo struct {
	os.FileInfo
	LocalPath string
}

func (SourceDirInfo) Path

func (info SourceDirInfo) Path() string

type Sources

type Sources struct {
	ByName map[string]assetfsapi.LocalSource
}

func NewSources

func NewSources(byName ...map[string]assetfsapi.LocalSource) *Sources

func (*Sources) Get

func (m *Sources) Get(name string) assetfsapi.LocalSource

func (*Sources) Register

func (m *Sources) Register(name string, src assetfsapi.LocalSource)

Jump to

Keyboard shortcuts

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