vfs

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound    = errors.New("not found")
	ErrReadOnly    = errors.New("read-only")
	ErrUnsupported = errors.New("unsupported operation")
)

Functions

This section is empty.

Types

type ControlKind added in v0.0.7

type ControlKind string
const (
	ControlNone        ControlKind = ""
	ControlMetaDir     ControlKind = "meta_dir"
	ControlOpsDir      ControlKind = "ops_dir"
	ControlQueriesDir  ControlKind = "queries_dir"
	ControlViewsDir    ControlKind = "views_dir"
	ControlIndexFile   ControlKind = "index_file"
	ControlCapsFile    ControlKind = "capabilities_file"
	ControlRequestFile ControlKind = "request_file"
	ControlResultFile  ControlKind = "result_file"
	ControlViewDir     ControlKind = "view_dir"
	ControlViewFile    ControlKind = "view_file"
)

type NodeKind added in v0.0.7

type NodeKind string
const (
	NodeKindResource   NodeKind = "resource"
	NodeKindControlDir NodeKind = "control_dir"
	NodeKindControl    NodeKind = "control"
)

type NodeType

type NodeType int
const (
	NodeDir NodeType = iota
	NodeFile
)

type Operations

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

func NewOperations

func NewOperations(cfg OperationsConfig) *Operations

func (*Operations) Create added in v0.0.5

func (o *Operations) Create(ctx context.Context, path string) (*VNode, error)

func (*Operations) ExecuteOp added in v0.0.7

func (o *Operations) ExecuteOp(ctx context.Context, path string, payload []byte) ([]byte, error)

func (*Operations) ListView added in v0.0.7

func (o *Operations) ListView(ctx context.Context, path string) ([]*VNode, error)

func (*Operations) Mkdir added in v0.0.7

func (o *Operations) Mkdir(ctx context.Context, path string) (*VNode, error)

func (*Operations) Read

func (o *Operations) Read(ctx context.Context, path string) ([]byte, error)

func (*Operations) ReadDir

func (o *Operations) ReadDir(ctx context.Context, path string) ([]*VNode, error)

func (*Operations) Remove added in v0.0.7

func (o *Operations) Remove(ctx context.Context, path string) error

func (*Operations) Rename added in v0.0.7

func (o *Operations) Rename(ctx context.Context, oldPath, newPath string) error

func (*Operations) RunQuery added in v0.0.7

func (o *Operations) RunQuery(ctx context.Context, path string, payload []byte) ([]byte, error)

func (*Operations) Stat added in v0.0.7

func (o *Operations) Stat(ctx context.Context, path string) (*VNode, error)

func (*Operations) Tree

func (o *Operations) Tree() *Tree

func (*Operations) Write

func (o *Operations) Write(ctx context.Context, path string, data []byte) error

type OperationsConfig

type OperationsConfig struct {
	CLI      clipkg.Runner
	Tree     *Tree
	Drive    *adapter.DriveAdapter
	Wiki     *adapter.WikiAdapter
	Calendar *adapter.CalendarAdapter
	Task     *adapter.TaskAdapter
	IM       *adapter.IMAdapter
	Mail     *adapter.MailAdapter
	Meeting  *adapter.MeetingAdapter
	ReadOnly bool
	TTL      time.Duration
	CacheDir string
}

type Tree

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

func NewTree

func NewTree(domains []string) *Tree

func (*Tree) DomainNode

func (t *Tree) DomainNode(domain string) *VNode

func (*Tree) Resolve

func (t *Tree) Resolve(path string) *VNode

func (*Tree) Root

func (t *Tree) Root() *VNode

type VNode

type VNode struct {
	Name          string
	Token         string
	DocType       doctype.DocType
	PendingCreate bool
	NodeType      NodeType
	Kind          NodeKind
	Control       ControlKind
	Domain        string

	CreatedTime time.Time
	Page        doctype.PageInfo
	TargetPath  string
	Action      string
	// contains filtered or unexported fields
}

func NewRootNode

func NewRootNode() *VNode

func (*VNode) AddChild

func (n *VNode) AddChild(child *VNode)

func (*VNode) Children

func (n *VNode) Children() []*VNode

func (*VNode) ClearChildren

func (n *VNode) ClearChildren()

func (*VNode) GetChild

func (n *VNode) GetChild(name string) *VNode

func (*VNode) GetModTime added in v0.0.7

func (n *VNode) GetModTime() time.Time

func (*VNode) GetSize added in v0.0.7

func (n *VNode) GetSize() int64

func (*VNode) IsDir

func (n *VNode) IsDir() bool

func (*VNode) NeedsRefresh

func (n *VNode) NeedsRefresh(ttl time.Duration) bool

func (*VNode) Parent

func (n *VNode) Parent() *VNode

func (*VNode) Path

func (n *VNode) Path() string

func (*VNode) SetModTime added in v0.0.7

func (n *VNode) SetModTime(t time.Time)

func (*VNode) SetPopulated

func (n *VNode) SetPopulated()

func (*VNode) SetSize added in v0.0.7

func (n *VNode) SetSize(s int64)

Jump to

Keyboard shortcuts

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