Documentation ¶
Index ¶
- func FileEditor(data []byte, client IpfsClient, fileName string, w fyne.Window) *fyne.Container
- func FileMetadata(fileData FileData)
- type Empty
- type FileData
- type IpfsClient
- func (c *IpfsClient) ChunkFile(fileName string) bool
- func (c *IpfsClient) DeleteFile(fileName string, showMessage bool) error
- func (c *IpfsClient) DeleteFileMetadata(fileName string)
- func (c *IpfsClient) Download(fileName string) error
- func (c *IpfsClient) DownloadCappedFile(fileName, path string) error
- func (c *IpfsClient) DownloadFile(fileName, path string) error
- func (c *IpfsClient) DownloadedFileContent(fileName string) (*[]byte, error)
- func (c *IpfsClient) GetFileMetadata(fileName string) *FileData
- func (c *IpfsClient) LoadFiles()
- func (c *IpfsClient) SaveFileMetadata(data FileData)
- func (c *IpfsClient) SubscribeFileStream()
- func (c *IpfsClient) UnsubscribeClient()
- func (c *IpfsClient) UploadFile(path, fileName string) error
- func (c *IpfsClient) UploadFileData(fileData []byte, fileSize int64, fileName string) error
- func (c *IpfsClient) UploadFileStream(fileData *os.File, fileSize int64, fileName string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileEditor ¶
func FileEditor(data []byte, client IpfsClient, fileName string, w fyne.Window) *fyne.Container
By the nature of the IPFS system, IPFS hashes are immutable. Thus, in order for us to peoperly "update" a file, we must first delete the file then re-add the file.
func FileMetadata ¶
func FileMetadata(fileData FileData)
Create fyne table, insert file data within.
Types ¶
type IpfsClient ¶
type IpfsClient struct { Id int64 Client pufs_pb.IpfsFileSystemClient Files []string FileUpload chan string DeletedFile chan string FileDeleted chan bool FileUploadedInApp chan bool Settings *settings.Settings InvalidFileTypes []string FileMetadata map[string]FileData // contains filtered or unexported fields }
Note: FileUploadedInApp Denotes if the file was uploaded in the application. If so, skip the reload when server sends back the ACK that a file was uploaded
func (*IpfsClient) ChunkFile ¶
func (c *IpfsClient) ChunkFile(fileName string) bool
func (*IpfsClient) DeleteFile ¶
func (c *IpfsClient) DeleteFile(fileName string, showMessage bool) error
func (*IpfsClient) DeleteFileMetadata ¶
func (c *IpfsClient) DeleteFileMetadata(fileName string)
func (*IpfsClient) Download ¶
func (c *IpfsClient) Download(fileName string) error
func (*IpfsClient) DownloadCappedFile ¶
func (c *IpfsClient) DownloadCappedFile(fileName, path string) error
func (*IpfsClient) DownloadFile ¶
func (c *IpfsClient) DownloadFile(fileName, path string) error
We must chunk the file here if its over the 4MB limit.
func (*IpfsClient) DownloadedFileContent ¶
func (c *IpfsClient) DownloadedFileContent(fileName string) (*[]byte, error)
Returns byte array of file content. Uses the file path for downloaded files. Validates a given file is found with that name. (Note: this should be calld after "Download" has ran successfully)
func (*IpfsClient) GetFileMetadata ¶
func (c *IpfsClient) GetFileMetadata(fileName string) *FileData
func (*IpfsClient) SaveFileMetadata ¶
func (c *IpfsClient) SaveFileMetadata(data FileData)
func (*IpfsClient) SubscribeFileStream ¶
func (c *IpfsClient) SubscribeFileStream()
Listen for file changes realtime. Take ID and store this upstream.
func (*IpfsClient) UnsubscribeClient ¶
func (c *IpfsClient) UnsubscribeClient()
func (*IpfsClient) UploadFile ¶
func (c *IpfsClient) UploadFile(path, fileName string) error
func (*IpfsClient) UploadFileData ¶
func (c *IpfsClient) UploadFileData(fileData []byte, fileSize int64, fileName string) error
Uploads a file stream that is under the 4MB gRPC file size cap