fsrpc

package
v0.0.0-...-66acf6f Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: BSD-3-Clause, BSD-3-Clause Imports: 12 Imported by: 0

README

fsrpc

This package implements RPC interfaces that connected clients can call in KBFS, to do certain operations, such as listing files.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFS

func NewFS(config libkbfs.Config, log logger.Logger) keybase1.FsInterface

NewFS returns a new FS protocol implementation

func ParseTlfHandle

func ParseTlfHandle(
	ctx context.Context, kbpki libkbfs.KBPKI, mdOps libkbfs.MDOps,
	osg idutil.OfflineStatusGetter, name string, t tlf.Type) (
	*tlfhandle.Handle, error)

ParseTlfHandle is a wrapper around libkbfs.ParseTlfHandle that automatically resolves non-canonical names.

Types

type CannotJoinPathErr

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

CannotJoinPathErr is returned on Join error

func (CannotJoinPathErr) Error

func (e CannotJoinPathErr) Error() string

type InvalidPathErr

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

InvalidPathErr is error for invalid paths

func (InvalidPathErr) Error

func (e InvalidPathErr) Error() string

type Path

type Path struct {
	PathType      PathType
	TLFType       tlf.Type
	TLFName       string
	TLFComponents []string
}

Path defines a file path in KBFS such as /keybase/public or /keybase/private/gabrielh

func NewPath

func NewPath(pathStr string) (Path, error)

NewPath constructs a Path from a string

func (Path) DirAndBasename

func (p Path) DirAndBasename() (dir Path, basename string, err error)

DirAndBasename returns directory and base filename

func (Path) GetDirNode

func (p Path) GetDirNode(ctx context.Context, config libkbfs.Config) (libkbfs.Node, error)

GetDirNode returns a nil node if this doesn't have type TLFPathType

func (Path) GetFileNode

func (p Path) GetFileNode(ctx context.Context, config libkbfs.Config) (libkbfs.Node, error)

GetFileNode returns a file node

func (Path) GetNode

func (p Path) GetNode(ctx context.Context, config libkbfs.Config) (libkbfs.Node, data.EntryInfo, error)

GetNode returns a node

func (Path) Join

func (p Path) Join(childName string) (childPath Path, err error)

Join will append a path to this path

func (Path) String

func (p Path) String() string

type PathType

type PathType int

PathType describes the types for different paths

const (
	// InvalidPathType denotes an invalid path type
	InvalidPathType PathType = iota
	// RootPathType is a root path type (like /)
	RootPathType
	// KeybasePathType is the keybase root (like /keybase)
	KeybasePathType
	// KeybaseChildPathType is a keybase reserved path (like /keybase/public)
	KeybaseChildPathType
	// TLFPathType is a top level folder (/keybase/public/gabrielh)
	TLFPathType
)

Jump to

Keyboard shortcuts

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