Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

WIP (DO NOT LOOK AT THIS) #56

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions coreapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ type CoreAPI interface {
// Unixfs returns an implementation of Unixfs API
Unixfs() UnixfsAPI

// Files returns an implementation of Files API.
Files() FilesAPI

// Block returns an implementation of Block API
Block() BlockAPI

Expand Down
33 changes: 33 additions & 0 deletions files.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package iface

import (
"context"
"os"

"github.com/ipfs/go-cid"
)

type FileInfo interface {
os.FileInfo
CID() cid.Cid
}

type FilesAPI interface {
Stat(ctx context.Context, path string) (FileInfo, error)
}

/* AFERO interface for reference

Chmod(name string, mode os.FileMode) : error
Chtimes(name string, atime time.Time, mtime time.Time) : error
Create(name string) : File, error
Mkdir(name string, perm os.FileMode) : error
MkdirAll(path string, perm os.FileMode) : error
Name() : string
Open(name string) : File, error
OpenFile(name string, flag int, perm os.FileMode) : File, error
Remove(name string) : error
RemoveAll(path string) : error
Rename(oldname, newname string) : error
Stat(name string) : os.FileInfo, error
*/