Documentation
¶
Index ¶
- Constants
- func AddFileToDirectory(ipfs *core.IpfsNode, dirb *uio.Directory, reader io.Reader, fname string) error
- func DecodeExif(reader io.Reader) *exif.Exif
- func EncodeImage(reader io.Reader, format Format, size ImageSize) ([]byte, error)
- func GetArchiveAtPath(ipfs *core.IpfsNode, path string) (io.Reader, error)
- func GetDataAtPath(ipfs *core.IpfsNode, path string) ([]byte, error)
- func GetEncryptedReaderBytes(reader io.Reader, key []byte) ([]byte, error)
- func IdFromEncodedPublicKey(key string) (peer.ID, error)
- func IdentityConfig(sk libp2pc.PrivKey) (config.Identity, error)
- func MultiaddrFromId(id string) (ma.Multiaddr, error)
- func ParsePeerParam(text string) (ma.Multiaddr, peer.ID, error)
- func PeersWithAddresses(addrs []string) (pis []pstore.PeerInfo, err error)
- func PinData(ipfs *core.IpfsNode, data io.Reader) (*cid.Cid, error)
- func PinDirectory(ipfs *core.IpfsNode, dir ipld.Node, exclude []string) error
- func PinPath(ipfs *core.IpfsNode, path string, recursive bool) error
- func PrintSwarmAddrs(node *core.IpfsNode) error
- func PrivKeyFromMnemonic(mnemonic *string) (libp2pc.PrivKey, string, error)
- func UnmarshalPrivateKeyFromString(key string) (libp2pc.PrivKey, error)
- func UnmarshalPublicKeyFromString(key string) (libp2pc.PubKey, error)
- func UnpinPath(ipfs *core.IpfsNode, path string) error
- type FileMetadata
- type Format
- type ImagePath
- type ImageSize
- type IpnsEntry
- type Metadata
- type PhotoMetadata
- type PublishOpts
Constants ¶
const ( ThumbnailSize ImageSize = 100 SmallSize = 320 MediumSize = 800 LargeSize = 1600 )
const ( ThumbnailPath ImagePath = "/thumb" SmallPath = "/small" MediumPath = "/medium" LargePath = "/photo" )
Variables ¶
This section is empty.
Functions ¶
func AddFileToDirectory ¶
func AddFileToDirectory(ipfs *core.IpfsNode, dirb *uio.Directory, reader io.Reader, fname string) error
AddFileToDirectory adds bytes as file to a virtual directory (dag) structure
func DecodeExif ¶
DecodeExif returns exif data from a reader if present
func EncodeImage ¶
EncodeImage creates a jpeg|gif thumbnail from an image - jpeg quality is currently the default (75/100)
func GetArchiveAtPath ¶
GetArchiveAtPath builds an archive from directory links under an ipfs path NOTE: currently will bork if dir path contains other dirs (depth > 1)
func GetDataAtPath ¶
GetDataAtPath return bytes under an ipfs path
func GetEncryptedReaderBytes ¶
GetEncryptedReaderBytes reads reader bytes and returns the encrypted result
func IdFromEncodedPublicKey ¶
IdFromEncodedPublicKey return the underlying id from an encoded public key
func IdentityConfig ¶
IdentityConfig initializes a new identity.
func MultiaddrFromId ¶
MultiaddrFromId creates a multiaddr from an id string
func ParsePeerParam ¶
ParsePeerParam takes a peer address string and returns p2p params
func PeersWithAddresses ¶
PeersWithAddresses is a function that takes in a slice of string peer addresses (multiaddr + peerid) and returns a slice of properly constructed peers
func PinDirectory ¶
PinDirectory pins a directory exluding any provided links
func PrintSwarmAddrs ¶
PrintSwarmAddrs prints the addresses of the host
func PrivKeyFromMnemonic ¶
PrivKeyFromMnemonic creates a private key form a mnemonic phrase
func UnmarshalPrivateKeyFromString ¶
UnmarshalPrivateKeyFromString attempts to create a private key from a base64 encoded string
func UnmarshalPublicKeyFromString ¶
UnmarshalPublicKeyFromString attempts to create a public key from a base64 encoded string