opfs

package
v0.0.0-...-b94449b Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package opfs is an fs implementation that supports stat, reads, and globbing.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("plandir: not found")

Functions

func NewPlanDirFS

func NewPlanDirFS(dir string) fsPlanDir

Types

type FS

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

func New

func New(root string) FS

func (FS) Abs

func (fs FS) Abs(name string) string

func (FS) Glob

func (fs FS) Glob(pattern string) ([]string, error)

func (FS) Join

func (fs FS) Join(paths ...string) string

func (FS) Open

func (fs FS) Open(name string) (fs.File, error)

func (FS) ReadDir

func (fs FS) ReadDir(name string) ([]fs.DirEntry, error)

func (FS) ReadFile

func (fs FS) ReadFile(name string) ([]byte, error)

func (FS) Stat

func (fs FS) Stat(name string) (fs.FileInfo, error)

type PlanDir

type PlanDir interface {
	fs.GlobFS
	fs.StatFS
	fs.ReadDirFS
	fs.ReadFileFS
	Join(paths ...string) string
	WithSubplan(spdir string) PlanDir
	Subplan() string
	Resolve(kind string, pats []string) ([]string, error)
}

type StateFileEntry

type StateFileEntry struct {
	Info     fs.FileInfo
	SHA256   []byte
	Contents []byte
}

func (*StateFileEntry) ChecksumOnly

func (f *StateFileEntry) ChecksumOnly() *StateFileEntry

func (StateFileEntry) MarshalJSON

func (f StateFileEntry) MarshalJSON() ([]byte, error)

func (*StateFileEntry) UnmarshalJSON

func (f *StateFileEntry) UnmarshalJSON(b []byte) error

func (*StateFileEntry) WithoutTimestamps

func (f *StateFileEntry) WithoutTimestamps() *StateFileEntry

type StateFileInfo

type StateFileInfo struct {
	RawName    string      `json:"name"`
	RawModTime time.Time   `json:"mtime,omitempty"`
	RawMode    fs.FileMode `json:"mode,omitempty"`
	RawSize    int64       `json:"size,omitempty"`
	SHA256     []byte      `json:"checksum,omitempty"`
	Contents   []byte      `json:"contents,omitempty"`
}

func (StateFileInfo) IsDir

func (sfi StateFileInfo) IsDir() bool

func (StateFileInfo) ModTime

func (sfi StateFileInfo) ModTime() time.Time

func (StateFileInfo) Mode

func (sfi StateFileInfo) Mode() fs.FileMode

func (StateFileInfo) Name

func (sfi StateFileInfo) Name() string

func (StateFileInfo) Size

func (sfi StateFileInfo) Size() int64

func (StateFileInfo) Sys

func (sfi StateFileInfo) Sys() interface{}

Jump to

Keyboard shortcuts

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