pz

package
v0.0.0-...-aac4c30 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Name      string    `json:"name"`
	Path      string    `json:"path"`
	IsDir     bool      `json:"is_dir"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Size      int64     `json:"size,omitempty"`
	Files     []File    `json:"files,omitempty"` // Note: Files can also be a directory
}

func (*File) Content

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

type Filesystem

type Filesystem struct {
	Root  string
	Cache map[string]File
}

func NewFilesystem

func NewFilesystem(root string) *Filesystem

func (*Filesystem) Get

func (f *Filesystem) Get(path string) (File, error)

func (*Filesystem) List

func (f *Filesystem) List(path string, ignoreCache bool) (File, error)

type Option

type Option struct {
	Name         string
	Desc         string
	Value        interface{}
	Type         string
	Min          int  // For int & float
	Max          int  // For int & float
	MinSpecified bool // For int & float
	MaxSpecified bool // For int & float
}

type Options

type Options map[string]Option

func Parse

func Parse(name string, path string) (Options, error)

func (*Options) Get

func (o *Options) Get(name string) (Option, bool)

func (*Options) JSON

func (o *Options) JSON() (map[string]interface{}, error)

func (*Options) Save

func (o *Options) Save(name string, path string) error

func (*Options) Set

func (o *Options) Set(name string, value interface{}) error

Jump to

Keyboard shortcuts

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