package pkgutil

import "github.com/markbates/pkger/pkging/pkgutil"

Index

Functions

func Dump

func Dump(w io.Writer, pkg pkging.Pkger) error

func ReadDir

func ReadDir(pkg Opener, dirname string) ([]os.FileInfo, error)

ReadDir reads the directory named by dirname and returns a list of directory entries sorted by filename.

func ReadFile

func ReadFile(pkg Opener, s string) ([]byte, error)

ReadFile reads the file named by filename and returns the contents. A successful call returns err == nil, not err == EOF. Because ReadFile reads the whole file, it does not treat an EOF from Read as an error to be reported.

func WriteFile

func WriteFile(pkg Creator, filename string, data []byte, perm os.FileMode) error

WriteFile writes data to a file named by filename. If the file does not exist, WriteFile creates it with permissions perm; otherwise WriteFile truncates it before writing.

Types

type Creator

type Creator interface {
	Create(name string) (pkging.File, error)
}

type OpenFiler

type OpenFiler interface {
	OpenFile(name string, flag int, perm os.FileMode) (pkging.File, error)
}

type Opener

type Opener interface {
	Open(name string) (pkging.File, error)
}

Source Files

dump.go file.go

Version
v0.2.0
Published
Oct 21, 2019
Platform
js/wasm
Imports
8 packages
Last checked
7 hours ago

Tools for package owners.