Documentation ¶
Index ¶
- Constants
- Variables
- func AllKeys(ctx context.Context, bs blockstore.Blockstore) ([]cid.Cid, error)
- func CopyBlocks(ctx context.Context, id cid.Cid, src, dst blockservice.BlockService) error
- func DecodeCBOR(d []byte, v interface{}) error
- func EncodeCBOR(v interface{}) (*bytes.Buffer, error)
- func Filename(file fs.File) (string, error)
- func LessCID(a, b cid.Cid) bool
- func NewFileWithInfo(fi fs.FileInfo, r io.Reader) (fs.File, error)
- func NewMemfileBytes(name string, data []byte) fs.File
- func NewMemfileReader(name string, r io.Reader) fs.File
- func SanitizeCBORForJSON(v interface{}) (interface{}, error)
- type CBORFiler
- type FSDirEntry
- type FSFileInfo
- type File
- type FileInfo
- type HistoryEntry
- type LDFile
- type Link
- type Links
- type MergeResult
- type MergeType
- type Metadata
- type Node
- type NodeType
- type Path
- type PutResult
- type SemVer
- type Tree
- type WritableMetaNode
Constants ¶
View Source
const ( // LatestVersion is the most recent semantic version of WNFS this // implementation reads/writes LatestVersion = SemVer("2.0.0dev") DefaultMultihashType = multihash.SHA2_256 )
View Source
const ( MetadataLinkName = "metadata" PublicLinkName = "public" PrivateLinkName = "private" SkeletonLinkName = "skeleton" PrettyLinkName = "p" PreviousLinkName = "previous" MergeLinkName = "merge" UserlandLinkName = "userland" )
View Source
const (
ModeDefault = 644
)
Variables ¶
View Source
var ErrNoCommonHistory = fmt.Errorf("no common history")
ErrNoCommonHistory signifies a merge error where two nodes share no common history
View Source
var ErrNoLink = fmt.Errorf("no link")
View Source
var ErrNotFound = errors.New("not found")
View Source
var Timestamp = time.Now
Functions ¶
func AllKeys ¶
func AllKeys(ctx context.Context, bs blockstore.Blockstore) ([]cid.Cid, error)
func CopyBlocks ¶
Copy blocks from src to dst
func DecodeCBOR ¶
func EncodeCBOR ¶
func NewFileWithInfo ¶
NewFileWithInfo creates a new open file with provided file information
func NewMemfileBytes ¶
NewMemfileBytes creates a file from a byte slice
func NewMemfileReader ¶
NewMemfileReader creates a file from an io.Reader
func SanitizeCBORForJSON ¶
func SanitizeCBORForJSON(v interface{}) (interface{}, error)
Types ¶
type FSDirEntry ¶
type FSDirEntry struct {
// contains filtered or unexported fields
}
func NewFSDirEntry ¶
func NewFSDirEntry(name string, isFile bool) FSDirEntry
func (FSDirEntry) IsDir ¶
func (de FSDirEntry) IsDir() bool
func (FSDirEntry) Name ¶
func (de FSDirEntry) Name() string
func (FSDirEntry) Type ¶
func (ds FSDirEntry) Type() fs.FileMode
type FSFileInfo ¶
type FSFileInfo struct {
// contains filtered or unexported fields
}
func NewFSFileInfo ¶
func (FSFileInfo) IsDir ¶
func (fi FSFileInfo) IsDir() bool
func (FSFileInfo) ModTime ¶
func (fi FSFileInfo) ModTime() time.Time
func (FSFileInfo) Mode ¶
func (fi FSFileInfo) Mode() fs.FileMode
func (FSFileInfo) Name ¶
func (fi FSFileInfo) Name() string
func (*FSFileInfo) SetFilename ¶
func (fi *FSFileInfo) SetFilename(name string) error
func (FSFileInfo) Size ¶
func (fi FSFileInfo) Size() int64
func (FSFileInfo) Sys ¶
func (fi FSFileInfo) Sys() interface{}
type HistoryEntry ¶
type Links ¶
type Links struct {
// contains filtered or unexported fields
}
func (Links) SortedSlice ¶
type MergeResult ¶
type MergeResult struct { Name string Type MergeType Cid cid.Cid // finalized (possibly updated) CID Userland cid.Cid Metadata cid.Cid Size int64 IsFile bool HamtRoot *cid.Cid // TODO(b5): refactor this away. unused on public nodes, required for private Key string PrivateName string }
func (MergeResult) CID ¶
func (mr MergeResult) CID() cid.Cid
func (MergeResult) ToLink ¶
func (mr MergeResult) ToLink(name string) Link
type WritableMetaNode ¶
Click to show internal directories.
Click to hide internal directories.