client

package
v0.1.24 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: GPL-3.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const CidBufferSize = 64

Variables

View Source
var IpfsCloseFile = func(clientId Client, contentId *Content) (error errno.Error) {
	return errno.ErrorNone
}
View Source
var IpfsFileCid = func(clientId Client, contentId *Content, cidPtr *byte) (error errno.Error) {
	return errno.ErrorNone
}
View Source
var IpfsNewContent = func(clientId Client, contentId *Content) (error errno.Error) {
	return errno.ErrorNone
}
View Source
var IpfsOpenFile = func(clientId Client, contentId *Content, cid *byte, cidSize uint32) (error errno.Error) {
	return errno.ErrorNone
}
View Source
var IpfsPushFile = func(clientId Client, contentId *Content, cidPtr *byte) (error errno.Error) {
	return errno.ErrorNone
}
View Source
var IpfsReadFile = func(clientId Client, contentId *Content, buf *byte, bufLen uint32, dataPtr *byte, readPtr *int32) (error errno.Error) {
	return errno.ErrorNone
}
View Source
var IpfsSeekFile = func(clientId Client, contentId *Content, offset int64, whence int, offsetPtr *int) (error errno.Error) {
	return errno.ErrorNone
}
View Source
var IpfsWriteFile = func(clientId Client, contentId *Content, buf *byte, bufLen uint32, writePtr *int32) (error errno.Error) {
	return errno.ErrorNone
}
View Source
var NewIPFSClient = func(clientId *uint32) (error errno.Error) {
	return errno.ErrorNone
}

Functions

This section is empty.

Types

type Client

type Client uint32

func New

func New() (Client, error)

func (Client) Create added in v0.1.23

func (c Client) Create() (*Content, error)

Creates creates and returns the new content.

func (Client) Open added in v0.1.23

func (c Client) Open(_cid cid.Cid) (*Content, error)

Open creates a new content using the cid given as the file. Returns a new content.

type Content added in v0.1.23

type Content struct {
	Id uint32
	// contains filtered or unexported fields
}

func (*Content) Cid added in v0.1.23

func (c *Content) Cid() (cid.Cid, error)

Cid returns the cid of the file and an error.

func (*Content) Close added in v0.1.23

func (c *Content) Close() error

Close closes the file associated with the content. Returns an error.

func (*Content) Push added in v0.1.23

func (c *Content) Push() (cid.Cid, error)

Push adds the file into the network. Updates the cid of the file. Returns cid and an error

func (*Content) Read added in v0.1.23

func (c *Content) Read(p []byte) (int, []byte, error)

Read reads up to len p in the file. Returns how much was read and an error.

func (*Content) Seek added in v0.1.23

func (c *Content) Seek(offset int64, whence int) (int64, error)

Seek moves to a position inside the file. Offset is how much to move the current position Whence has three options: 0 = SeekStart, 1 = SeekCurrent, or 2 = SeekEnd Combines both offset and whence to find a new offset inside the file Returns the new offset and an error

func (*Content) Write added in v0.1.23

func (c *Content) Write(p []byte) (int, error)

Write writes the passed in data into the file. Returns how much was written and an error.

Jump to

Keyboard shortcuts

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