Documentation ¶
Index ¶
- func ClientConfigMA() (ma.Multiaddr, string)
- func CreateLocalDevnet(t *testing.T, numMiners int) (*apistruct.FullNodeStruct, address.Address, []address.Address)
- func CreateLocalDevnetWithIPFS(t *testing.T, numMiners int, ipfsMaddr string, mountVolumes bool) (*apistruct.FullNodeStruct, address.Address, []address.Address)
- func GetLotusToken(lotusFolderPath string) (string, error)
- func LaunchDevnetDocker(t *testing.T, numMiners int, ipfsMaddr string, mountVolumes bool) *dockertest.Resource
- func LaunchIPFSDocker() (*dockertest.Resource, func())
- func NewSimpleTx(ds datastore.Datastore) datastore.Txn
- type SimpleTx
- func (bt *SimpleTx) Commit() error
- func (bt *SimpleTx) Delete(key datastore.Key) error
- func (bt *SimpleTx) Discard()
- func (bt *SimpleTx) Get(k datastore.Key) ([]byte, error)
- func (bt *SimpleTx) GetSize(k datastore.Key) (int, error)
- func (bt *SimpleTx) Has(k datastore.Key) (bool, error)
- func (bt *SimpleTx) Put(key datastore.Key, val []byte) error
- func (bt *SimpleTx) Query(q query.Query) (query.Results, error)
- type TxMapDatastore
- func (d *TxMapDatastore) Clone() (*TxMapDatastore, error)
- func (d *TxMapDatastore) Delete(key datastore.Key) error
- func (d *TxMapDatastore) Get(key datastore.Key) ([]byte, error)
- func (d *TxMapDatastore) NewTransaction(readOnly bool) (datastore.Txn, error)
- func (d *TxMapDatastore) Put(key datastore.Key, data []byte) error
- func (d *TxMapDatastore) Query(q query.Query) (query.Results, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientConfigMA ¶
ClientConfigMA returns the prepared multiaddress and Lotus token, to connect to a Lotus node.
func CreateLocalDevnet ¶
func CreateLocalDevnet(t *testing.T, numMiners int) (*apistruct.FullNodeStruct, address.Address, []address.Address)
CreateLocalDevnet returns an API client that targets a local devnet with numMiners number of miners. Refer to http://github.com/textileio/local-devnet for more information.
func CreateLocalDevnetWithIPFS ¶
func CreateLocalDevnetWithIPFS(t *testing.T, numMiners int, ipfsMaddr string, mountVolumes bool) (*apistruct.FullNodeStruct, address.Address, []address.Address)
CreateLocalDevnetWithIPFS creates a local devnet connected to an IPFS node.
func GetLotusToken ¶
GetLotusToken returns the lotus token from a Lotus repo path.
func LaunchDevnetDocker ¶
func LaunchDevnetDocker(t *testing.T, numMiners int, ipfsMaddr string, mountVolumes bool) *dockertest.Resource
LaunchDevnetDocker launches the devnet docker image.
func LaunchIPFSDocker ¶
func LaunchIPFSDocker() (*dockertest.Resource, func())
LaunchIPFSDocker runs a fresh go-ipfs docker image and returns the resource for container metadata.
func NewSimpleTx ¶
func NewSimpleTx(ds datastore.Datastore) datastore.Txn
NewSimpleTx creates a transaction.
Types ¶
type SimpleTx ¶
type SimpleTx struct {
// contains filtered or unexported fields
}
SimpleTx implements the transaction interface for datastores who do not have any sort of underlying transactional support.
func (*SimpleTx) Discard ¶
func (bt *SimpleTx) Discard()
Discard cancels the changes done in the transaction.
type TxMapDatastore ¶
type TxMapDatastore struct { *datastore.MapDatastore // contains filtered or unexported fields }
TxMapDatastore is a in-memory datastore that satisfies TxnDatastore.
func NewTxMapDatastore ¶
func NewTxMapDatastore() *TxMapDatastore
NewTxMapDatastore returns a new TxMapDatastore.
func (*TxMapDatastore) Clone ¶
func (d *TxMapDatastore) Clone() (*TxMapDatastore, error)
Clone returns a cloned datastore.
func (*TxMapDatastore) Delete ¶
func (d *TxMapDatastore) Delete(key datastore.Key) error
Delete deletes a key.
func (*TxMapDatastore) Get ¶
func (d *TxMapDatastore) Get(key datastore.Key) ([]byte, error)
Get returns the value for a key.
func (*TxMapDatastore) NewTransaction ¶
func (d *TxMapDatastore) NewTransaction(readOnly bool) (datastore.Txn, error)
NewTransaction creates a transaction A read-only transaction should be indicated with readOnly equal true.
func (*TxMapDatastore) Put ¶
func (d *TxMapDatastore) Put(key datastore.Key, data []byte) error
Put sets the value of a key.