Documentation ¶
Index ¶
- func ClientConfigMA(t *testing.T) (ma.Multiaddr, string)
- func CreateLocalDevnet(t TestingTWithCleanup, numMiners, speed int) (lotus.ClientBuilder, address.Address, []address.Address)
- func CreateLocalDevnetWithIPFS(t TestingTWithCleanup, numMiners, speed int, ipfsMaddr string, ...) (lotus.ClientBuilder, address.Address, []address.Address)
- func GetLotusToken(lotusFolderPath string) (string, error)
- func LaunchDevnetDocker(t TestingTWithCleanup, numMiners, speed int, ipfsMaddr string, ...) *dockertest.Resource
- func LaunchIPFSDocker(t require.TestingT) (*dockertest.Resource, func())
- func NewSimpleTx(ds datastore.Datastore) datastore.Txn
- func RunFlaky(t *testing.T, f func(ft *FlakyT))
- type FlakyT
- 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 TestingTWithCleanup
- 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 TestingTWithCleanup, numMiners, speed int) (lotus.ClientBuilder, 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 TestingTWithCleanup, numMiners, speed int, ipfsMaddr string, mountVolumes bool) (lotus.ClientBuilder, 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 TestingTWithCleanup, numMiners, speed int, ipfsMaddr string, mountVolumes bool) *dockertest.Resource
LaunchDevnetDocker launches the devnet docker image.
func LaunchIPFSDocker ¶
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 FlakyT ¶
type FlakyT struct {
// contains filtered or unexported fields
}
FlakyT provides retry mechanisms to test.
func (*FlakyT) Cleanup ¶
func (ft *FlakyT) Cleanup(cls func())
Cleanup registers a cleanup function.
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 TestingTWithCleanup ¶
TestingTWithCleanup is an augmented require.TestingT with a Cleanup function.
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.