Documentation ¶
Index ¶
Examples ¶
Constants ¶
View Source
const CidBufferSize = 64
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client uint32
func (Client) Create ¶ added in v0.1.23
func (c Client) Create() (ReadWriteContent, error)
Creates creates and returns the new content.
func (Client) Open ¶ added in v0.1.23
func (c Client) Open(_cid cid.Cid) (ReadOnlyContent, 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 {
// contains filtered or unexported fields
}
func (*Content) Cid ¶ added in v0.1.23
Cid returns the cid of the file and an error.
Example ¶
Output: Cid: bafkreibrl5n5w5wqpdcdxcwaazheualemevr7ttxzbutiw74stdvrfhn2m
func (*Content) Close ¶ added in v0.1.23
Close closes the file associated with the content. Returns an error.
func (*Content) Push ¶ added in v0.1.23
Push adds the file into the network then closes the file Returns cid and an error
func (*Content) Seek ¶ added in v0.1.23
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
type ReadOnlyContent ¶ added in v0.1.32
type ReadOnlyContent interface { io.ReadSeekCloser Cid() (cid.Cid, error) }
type ReadWriteContent ¶ added in v0.1.32
type ReadWriteContent interface { io.ReadWriteSeeker io.Closer Push() (cid.Cid, error) }
Click to show internal directories.
Click to hide internal directories.