Documentation ¶
Index ¶
- func GenerateEd25519Key() ([]byte, error)
- func GenerateEd25519KeyFromString(secret string) ([]byte, error)
- type Client
- func (c *Client) AccountBalance(account string) ([]byte, error)
- func (c *Client) AccountCreate() ([]byte, error)
- func (c *Client) AccountExists(account string) ([]byte, error)
- func (c *Client) AccountFund(seed string, amount blockchain.BigInt, to string) ([]byte, error)
- func (c *Client) BloxFreeSpace() ([]byte, error)
- func (c *Client) ConnectToBlox() error
- func (c *Client) DeleteFulaConfig() ([]byte, error)
- func (c *Client) Flush() error
- func (c *Client) Get(key []byte) ([]byte, error)
- func (c *Client) Has(key []byte) (bool, error)
- func (c *Client) ID() string
- func (c *Client) ListFailedPushes() (*LinkIterator, error)
- func (c *Client) ListFailedPushesAsString() (*StringIterator, error)
- func (c *Client) ManifestAvailable(poolID int) ([]byte, error)
- func (c *Client) ManifestRemove(seed string, poolID int, cid string) ([]byte, error)
- func (c *Client) ManifestRemoveStored(seed string, uploader string, poolID int, cid string) ([]byte, error)
- func (c *Client) ManifestRemoveStorer(seed string, storage string, poolID int, cid string) ([]byte, error)
- func (c *Client) ManifestStore(seed string, poolID int, uploader string, cid string) ([]byte, error)
- func (c *Client) ManifestUpload(seed string, poolID int, ReplicationFactor int, uri string) ([]byte, error)
- func (c *Client) Partition() ([]byte, error)
- func (c *Client) PoolCancelJoin(seed string, poolID int) ([]byte, error)
- func (c *Client) PoolCreate(seed string, poolName string) ([]byte, error)
- func (c *Client) PoolJoin(seed string, poolID int) ([]byte, error)
- func (c *Client) PoolLeave(seed string, poolID int) ([]byte, error)
- func (c *Client) PoolList() ([]byte, error)
- func (c *Client) PoolRequests(poolID int) ([]byte, error)
- func (c *Client) PoolUserList(poolID int) ([]byte, error)
- func (c *Client) PoolVote(seed string, poolID int, account string, voteValue bool) ([]byte, error)
- func (c *Client) Pull(key []byte) error
- func (c *Client) Push(key []byte) error
- func (c *Client) Put(value []byte, codec int64) ([]byte, error)
- func (c *Client) Reboot() ([]byte, error)
- func (c *Client) RetryFailedPushes() error
- func (c *Client) Seeded(seed string) ([]byte, error)
- func (c *Client) SetAuth(on string, subject string, allow bool) error
- func (c *Client) Shutdown() error
- func (c *Client) WifiRemoveall() ([]byte, error)
- type Config
- type LinkIterator
- type StringIterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateEd25519Key ¶ added in v0.5.2
GenerateEd25519Key generates a random Ed25519 libp2p private key.
func GenerateEd25519KeyFromString ¶ added in v1.0.0
Types ¶
type Client ¶ added in v0.4.9
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AccountBalance ¶ added in v0.8.8
AccountBalance requests blox at Config.BloxAddr to get the balance of the account. the addr must be a valid multiaddr that includes peer ID.
func (*Client) AccountCreate ¶ added in v0.8.8
AccountCreate requests blox at Config.BloxAddr to create a account.
func (*Client) AccountExists ¶ added in v0.8.8
AccountExists requests blox at Config.BloxAddr to check if the account exists or not. the addr must be a valid multiaddr that includes peer ID.
func (*Client) AccountFund ¶ added in v0.8.8
AccountFund requests blox at Config.BloxAddr to fund the account. the addr must be a valid multiaddr that includes peer ID. TODO: This still needs rethink as someone should not be able to put another person PeerID in request
func (*Client) BloxFreeSpace ¶ added in v0.8.8
BloxFreeSpace requests the blox avail/used free space information.
func (*Client) ConnectToBlox ¶ added in v0.8.0
ConnectToBlox attempts to connect to blox via the configured address. This function can be used to check if blox is currently accessible.
func (*Client) DeleteFulaConfig ¶ added in v1.14.0
DeleteFulaConfig deletes config.yaml file
func (*Client) Flush ¶ added in v0.8.1
Flush guarantees that all values stored locally are synced to the baking local storage.
func (*Client) Get ¶ added in v0.4.9
Get gets the value corresponding to the given key from the local ipld.LinkSystem The key must be a valid ipld.Link and the value returned is encoded ipld.Node. If data is not found locally, an attempt is made to automatically fetch the data from blox at Config.BloxAddr address.
func (*Client) Has ¶ added in v0.4.9
Has checks whether the value corresponding to the given key is present in the local datastore. The key must be a valid ipld.Link.
func (*Client) ListFailedPushes ¶ added in v0.5.9
func (c *Client) ListFailedPushes() (*LinkIterator, error)
func (*Client) ListFailedPushesAsString ¶ added in v1.0.0
func (c *Client) ListFailedPushesAsString() (*StringIterator, error)
func (*Client) ManifestAvailable ¶ added in v0.8.8
ManifestAvailable requests blox at Config.BloxAddr to list manifests the addr must be a valid multiaddr that includes peer ID.
func (*Client) ManifestRemove ¶ added in v0.8.8
ManifestRemove requests blox at Config.BloxAddr to remove a manifest the addr must be a valid multiaddr that includes peer ID.
func (*Client) ManifestRemoveStored ¶ added in v0.8.8
func (c *Client) ManifestRemoveStored(seed string, uploader string, poolID int, cid string) ([]byte, error)
The storer can stop storing a given manifest the addr must be a valid multiaddr that includes peer ID.
func (*Client) ManifestRemoveStorer ¶ added in v0.8.8
func (c *Client) ManifestRemoveStorer(seed string, storage string, poolID int, cid string) ([]byte, error)
The uploader or admin can remove an account that is storing a given manifest. the addr must be a valid multiaddr that includes peer ID.
func (*Client) ManifestStore ¶ added in v0.8.8
func (c *Client) ManifestStore(seed string, poolID int, uploader string, cid string) ([]byte, error)
ManifestStore requests blox at Config.BloxAddr to store a manifest(store request) the addr must be a valid multiaddr that includes peer ID.
func (*Client) ManifestUpload ¶ added in v0.8.8
func (c *Client) ManifestUpload(seed string, poolID int, ReplicationFactor int, uri string) ([]byte, error)
ManifestUpload requests blox at Config.BloxAddr to add a manifest(upload request) the addr must be a valid multiaddr that includes peer ID.
func (*Client) PoolCancelJoin ¶ added in v0.8.8
PoolJoin requests blox at Config.BloxAddr to cancel a join request for a pool with the id. the addr must be a valid multiaddr that includes peer ID. Note that this call is only allowed on a user's own blox TODO: This still needs rethink as someone should not be able to put another person PeerID in request
func (*Client) PoolCreate ¶ added in v0.8.8
PoolCreate requests blox at Config.BloxAddr to creates a pool with the name. the addr must be a valid multiaddr that includes peer ID. Note that this call is only allowed on a user's own blox TODO: This still needs rethink as someone should not be able to put another person PeerID in request
func (*Client) PoolJoin ¶ added in v0.8.8
PoolJoin requests blox at Config.BloxAddr to join a pool with the id. the addr must be a valid multiaddr that includes peer ID. Note that this call is only allowed on a user's own blox TODO: This still needs rethink as someone should not be able to put another person PeerID in request
func (*Client) PoolLeave ¶ added in v0.8.8
PoolLeave requests blox at Config.BloxAddr to leave a pool with the id. the addr must be a valid multiaddr that includes peer ID. Note that this call is only allowed on a user's own blox TODO: This still needs rethink as someone should not be able to put another person PeerID in request
func (*Client) PoolList ¶ added in v0.8.8
PoolList requests blox at Config.BloxAddr to list the pools. the addr must be a valid multiaddr that includes peer ID.
func (*Client) PoolRequests ¶ added in v0.8.8
PoolListRequests requests blox at Config.BloxAddr to list the join request for a pool with the id. the addr must be a valid multiaddr that includes peer ID.
func (*Client) PoolUserList ¶ added in v0.8.8
PoolUserList requests blox at Config.BloxAddr to list the input pool users. the addr must be a valid multiaddr that includes peer ID.
func (*Client) PoolVote ¶ added in v0.8.8
PoolVote requests blox at Config.BloxAddr to vote for a join request. the addr must be a valid multiaddr that includes peer ID. Note that this call is only allowed on a user's own blox TODO: This still needs rethink as someone should not be able to put another person PeerID in request
func (*Client) Pull ¶ added in v0.4.9
Pull downloads the data corresponding to the given key from blox at Config.BloxAddr. The key must be a valid ipld.Link.
func (*Client) Push ¶ added in v0.4.9
Push requests blox at Config.BloxAddr to download the given key from this node. The key must be a valid ipld.Link, and the addr must be a valid multiaddr that includes peer ID. The value corresponding to the given key must be stored in the local datastore prior to calling this function. See: Client.Put.
func (*Client) Put ¶ added in v0.4.9
Put stores the given value onto the ipld.LinkSystem and returns its corresponding link. The value is decoded using the decoder that corresponds to the given codec. Therefore, the given value must be a valid ipld.Node. Upon successful local storage of the given value, it is automatically pushed to the blox at Config.BloxAddr address.
func (*Client) RetryFailedPushes ¶ added in v0.8.1
RetryFailedPushes retries pushing all links that failed to push. The retry is disrupted as soon as a failure occurs. See ListFailedPushes.
func (*Client) Seeded ¶ added in v0.8.8
Seeded requests blox at Config.BloxAddr to create a seeded account. The seed must start with "/", and the addr must be a valid multiaddr that includes peer ID.
func (*Client) SetAuth ¶ added in v0.8.3
SetAuth sets authorization on the given peer ID for the given subject.
func (*Client) Shutdown ¶ added in v0.4.9
Shutdown closes all resources used by Client. After calling this function Client must be discarded.
func (*Client) WifiRemoveall ¶ added in v1.0.0
WifiRemoveall requests the blox to remove all saved wifis
type Config ¶ added in v0.4.9
type Config struct { Identity []byte StorePath string // Exchange specifies the DAG exchange protocol for Fula mobile client. If left unspecified, // The default FxExchange protocol is used which will attempt to make remote connections // when links are stored and retrieved. // // For testing purposes, the value may be set to `noop`, in which case, no remote connections // will be made and the requested exchange is simply logged. When the value is set to `noop` // the BloxAddr may also be left empty. Exchange string BloxAddr string // StaticRelays specifies a list of static relays used by libp2p auto-relay. // Defaults to fx.land managed relay if unspecified. StaticRelays []string // ForceReachabilityPrivate configures weather the libp2p should always think that it is behind // NAT. ForceReachabilityPrivate bool // SyncWrites assures that writes to the local datastore are flushed to the backing store as // soon as they are written. By default, writes are not synchronized to disk until either the // client is shut down or Client.Flush is explicitly called. SyncWrites bool // AllowTransientConnection allows transient connectivity via relay when direct connection is // not possible. Defaults to enabled if unspecified. AllowTransientConnection bool }
type LinkIterator ¶ added in v0.8.0
type LinkIterator struct {
// contains filtered or unexported fields
}
func (*LinkIterator) HasNext ¶ added in v0.8.0
func (i *LinkIterator) HasNext() bool
func (*LinkIterator) Next ¶ added in v0.8.0
func (i *LinkIterator) Next() ([]byte, error)
type StringIterator ¶ added in v1.0.0
type StringIterator struct {
// contains filtered or unexported fields
}
func (*StringIterator) HasNext ¶ added in v1.0.0
func (i *StringIterator) HasNext() bool
func (*StringIterator) Next ¶ added in v1.0.0
func (i *StringIterator) Next() (string, error)