ipfs

package
v0.0.0-...-ebf7931 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileData

type FileData struct {
	FileName   string
	FileSize   int64
	IpfsHash   string
	UploadedAt int64
}

type FileDataSerialized

type FileDataSerialized struct {
	FileName   string `json:"FileName"`
	FileSize   int64  `json:"FileSize"`
	IpfsHash   string `json:"IpfsHash"`
	UploadedAt int64  `json:"UploadedAt"`
}

Fix these

type FileDownloadData

type FileDownloadData struct {
	IpfsHash string
	FileData *[]byte
}

type IpfsDirectory

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

Store directories. Not used currently.

type IpfsFiles

type IpfsFiles struct {
	DataPath string
	// contains filtered or unexported fields
}

func (*IpfsFiles) Append

func (f *IpfsFiles) Append(node *Node)

func (*IpfsFiles) DeleteNode

func (f *IpfsFiles) DeleteNode(node *Node)

func (IpfsFiles) Files

func (f IpfsFiles) Files() []*Node

Return array of ipfsfiles within the virtual file system

func (IpfsFiles) FindNode

func (f IpfsFiles) FindNode(nodeName string) *Node

func (IpfsFiles) FindNodeDataFromName

func (f IpfsFiles) FindNodeDataFromName(fileName string) *FileData

func (IpfsFiles) FindNodeFromName

func (f IpfsFiles) FindNodeFromName(fileName string) string

func (IpfsFiles) FirstFile

func (f IpfsFiles) FirstFile() (FileData, error)

func (IpfsFiles) LastFile

func (f IpfsFiles) LastFile() (FileData, error)

func (*IpfsFiles) Len

func (f *IpfsFiles) Len() int

func (*IpfsFiles) LoadFileSystemData

func (f *IpfsFiles) LoadFileSystemData() error

Reads file system data from disk

func (IpfsFiles) PrintFileName

func (f IpfsFiles) PrintFileName()

Probably will not be used.. could use to get data from a specific file?

func (*IpfsFiles) Remove

func (f *IpfsFiles) Remove(fileName string)

func (IpfsFiles) Reverse

func (f IpfsFiles) Reverse()

func (IpfsFiles) WriteFileSystemDataToDisk

func (f IpfsFiles) WriteFileSystemDataToDisk() error

Writes file system data to disk

type IpfsNode

type IpfsNode struct {
	LocalFolder string
	// contains filtered or unexported fields
}

tie things to struct, create API 1x on creation.

func (*IpfsNode) DeleteFile

func (i *IpfsNode) DeleteFile(ipfsFileHash string) error

This can be gained from the ipfs_file_list. The node data will have the ipfs file hash that we can use to remove the file.

func (*IpfsNode) GetFile

func (i *IpfsNode) GetFile(fileName string, filesList IpfsFiles) (*FileDownloadData, error)

func (*IpfsNode) Init

func (i *IpfsNode) Init() context.CancelFunc

Return the context from this function, then defer the cancel request until whichever calling function exits

func (*IpfsNode) ListFilesFromNode

func (i *IpfsNode) ListFilesFromNode() error

func (*IpfsNode) UploadFileAndPin

func (i *IpfsNode) UploadFileAndPin(fileStream []byte) (string, error)

This can take a raw stream of bytes. As the gRPC server accumulates bytes via the client, we can write the file to IPFS.

type Node

type Node struct {
	Data FileData
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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