local

package
v0.0.0-...-a780236 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LS_MODE_ALL = -1 + iota
	LS_MODE_FILE
	LS_MODE_DIR
)
View Source
const (
	STAT_DIR          = true
	STAT_FILE         = false
	PERM_FILE_PUBLIC  = os.FileMode(0644)
	PERM_FILE_PRIVATE = os.FileMode(0600)
	PERM_DIR_PUBLIC   = os.FileMode(0755)
	PERM_DIR_PRIVATE  = os.FileMode(0700)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Local

type Local struct {
	RootPath string
}

func New

func New(rootPath string) *Local

func (*Local) Append

func (lc *Local) Append(filename string, content []byte, options ...interface{}) error

func (*Local) Chown

func (lc *Local) Chown(folderPath string, perm os.FileMode) error

func (*Local) Copy

func (lc *Local) Copy(src, dst string) error

func (*Local) Delete

func (lc *Local) Delete(src string) error

func (*Local) Directories

func (lc *Local) Directories(path string) []string

func (*Local) Files

func (lc *Local) Files(path string) []string

func (*Local) Get

func (lc *Local) Get(filename string) ([]byte, error)

func (*Local) GetVisibility

func (lc *Local) GetVisibility(filename string) string

func (*Local) Has

func (lc *Local) Has(filename string) bool

func (*Local) Metadata

func (lc *Local) Metadata(filename string) meta.Metadata

func (*Local) Mkdir

func (lc *Local) Mkdir(folderPath string, perm os.FileMode) error

func (*Local) Move

func (lc *Local) Move(src, dst string) error

func (*Local) SetVisibility

func (lc *Local) SetVisibility(filename string, visibility string) error

func (*Local) Walk

func (lc *Local) Walk(root string, lsMode int) []string

func (*Local) Write

func (lc *Local) Write(filename string, content []byte, options ...interface{}) error

type Metadata

type Metadata struct {
	Path      string      `json:"path"`
	Dirname   string      `json:"dirname"`
	Extension string      `json:"extension"`
	Filename  string      `json:"filename"`
	ModTime   time.Time   `json:"modified_at"`
	Size      int64       `json:"size"`
	PermMode  os.FileMode `json:"perm_mode"`
	Type      string      `json:"type"`
	Stat      os.FileInfo `json:"-"`
}

func FileInfo

func FileInfo(filename string) (Metadata, error)

func (Metadata) MIMEType

func (m Metadata) MIMEType() (*mimetype.MIME, error)

Jump to

Keyboard shortcuts

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