Documentation
¶
Index ¶
- Constants
- Variables
- func IsDbError(err error) bool
- type DAL
- func (d *DAL) CountCidsByTokenAndState(token *entity.TokenInfo, state int) (int, error)
- func (d *DAL) CountInactiveCidsByTokenAndState(token *entity.TokenInfo, state int, stateTs time.Time) (int, error)
- func (d *DAL) CountPayments() (int, error)
- func (d *DAL) DeleteBridgeRouting(destNetId uint64) error
- func (d *DAL) DeleteChan(cid ctype.CidType) error
- func (d *DAL) DeleteChanMessage(cid ctype.CidType, seqnum uint64) error
- func (d *DAL) DeleteChanMigration(cid ctype.CidType) error
- func (d *DAL) DeleteCooperativeWithdrawJob(withdrawHash string) error
- func (d *DAL) DeleteCrossNetPay(payID ctype.PayIDType) error
- func (d *DAL) DeleteDelegatedPay(payID ctype.PayIDType) error
- func (d *DAL) DeleteDeposit(uuid string) error
- func (d *DAL) DeleteDestToken(dest ctype.Addr, token *entity.TokenInfo) error
- func (d *DAL) DeleteEdge(cid ctype.CidType) error
- func (d *DAL) DeleteLeaseOwner(id, owner string) error
- func (d *DAL) DeleteNetBridge(bridgeAddr ctype.Addr) error
- func (d *DAL) DeleteNetToken(netId uint64, netToken *entity.TokenInfo) error
- func (d *DAL) DeletePayPath(payID ctype.PayIDType) error
- func (d *DAL) DeletePayment(payID ctype.PayIDType) error
- func (d *DAL) DeleteQueryTime(query string) error
- func (d *DAL) DeleteRouting(dest ctype.Addr, token *entity.TokenInfo) error
- func (d *DAL) DeleteSecret(hash string) error
- func (d *DAL) DeleteSecretByPayID(payID ctype.PayIDType) error
- func (d *DAL) GetAllBridgeRouting() (map[uint64]ctype.Addr, error)
- func (d *DAL) GetAllChanLedgers() ([]ctype.Addr, error)
- func (d *DAL) GetAllChanMessages(cid ctype.CidType) ([]*rpc.CelerMsg, error)
- func (d *DAL) GetAllChansByTokenAndState(token *entity.TokenInfo, state int) ([]ctype.CidType, []ctype.Addr, []*entity.TokenInfo, []*time.Time, []*time.Time, ...)
- func (d *DAL) GetAllCooperativeWithdrawJobKeys() ([]string, error)
- func (d *DAL) GetAllDepositJobsByCid(cid ctype.CidType) ([]*structs.DepositJob, error)
- func (d *DAL) GetAllDepositJobsByState(state int) ([]*structs.DepositJob, error)
- func (d *DAL) GetAllDestTokenOsps() (map[ctype.Addr]map[ctype.Addr]map[ctype.Addr]bool, error)
- func (d *DAL) GetAllEdges() ([]*structs.Edge, error)
- func (d *DAL) GetAllNetBridges() (map[ctype.Addr]uint64, error)
- func (d *DAL) GetAllNetTokents() (map[ctype.Addr]map[uint64]ctype.Addr, error)
- func (d *DAL) GetAllPayIDs() ([]ctype.PayIDType, error)
- func (d *DAL) GetAllPaymentInfoByCid(cid ctype.CidType) ([]ctype.PayIDType, []*entity.ConditionalPay, []*anypb.Any, []ctype.CidType, ...)
- func (d *DAL) GetAllPeerServers() ([]string, error)
- func (d *DAL) GetAllRoutingCids() (map[ctype.Addr]map[ctype.Addr]ctype.CidType, error)
- func (d *DAL) GetAllRunningDepositJobs() ([]*structs.DepositJob, error)
- func (d *DAL) GetAllSubmittedDepositTxHashes() ([]string, error)
- func (d *DAL) GetBridgeRouting(destNetId uint64) (ctype.Addr, uint64, bool, error)
- func (d *DAL) GetChanForDeposit(cid ctype.CidType) (int, *entity.TokenInfo, ctype.Addr, ctype.Addr, bool, error)
- func (d *DAL) GetChanForMigration(cid ctype.CidType) (int, ctype.Addr, bool, error)
- func (d *DAL) GetChanLedger(cid ctype.CidType) (ctype.Addr, bool, error)
- func (d *DAL) GetChanMessage(cid ctype.CidType, seqnum uint64) (*rpc.CelerMsg, bool, error)
- func (d *DAL) GetChanMigration(cid ctype.CidType, toLedger ctype.Addr) (uint64, int, []byte, bool, error)
- func (d *DAL) GetChanMigrationReqByLedgerAndStateWithLimit(toLedger ctype.Addr, state, limit int) (map[ctype.CidType][]byte, map[ctype.CidType]uint64, error)
- func (d *DAL) GetChanOpenResp(cid ctype.CidType) (*rpc.OpenChannelResponse, bool, error)
- func (d *DAL) GetChanPeer(cid ctype.CidType) (ctype.Addr, bool, error)
- func (d *DAL) GetChanSeqNums(cid ctype.CidType) (uint64, uint64, uint64, uint64, bool, error)
- func (d *DAL) GetChanState(cid ctype.CidType) (int, bool, error)
- func (d *DAL) GetChanStateToken(cid ctype.CidType) (int, *entity.TokenInfo, bool, error)
- func (d *DAL) GetChanViewInfoByID(cid ctype.CidType) (int, *time.Time, *time.Time, *entity.PaymentChannelInitializer, ...)
- func (d *DAL) GetChannelsForAuthAck(peerAddr ctype.Addr) ([]*chanForAuthAck, error)
- func (d *DAL) GetChannelsForAuthReq(peerAddr ctype.Addr) ([]*rpc.ChannelSummary, error)
- func (d *DAL) GetCidByPeerToken(peer ctype.Addr, token *entity.TokenInfo) (ctype.CidType, bool, error)
- func (d *DAL) GetCidStateByPeerToken(peer ctype.Addr, token *entity.TokenInfo) (ctype.CidType, int, bool, error)
- func (d *DAL) GetCidTokensByPeer(peerAddr ctype.Addr) ([]ctype.CidType, []ctype.Addr, error)
- func (d *DAL) GetCidsByTokenAndState(token *entity.TokenInfo, state int) ([]ctype.CidType, error)
- func (d *DAL) GetClosedChan(cid ctype.CidType) (ctype.Addr, *entity.TokenInfo, *time.Time, *time.Time, bool, error)
- func (d *DAL) GetCooperativeWithdrawJob(withdrawHash string) (*structs.CooperativeWithdrawJob, error)
- func (d *DAL) GetCrossNetInfoByOrignalPayID(originalPayID ctype.PayIDType) (ctype.PayIDType, int, ctype.Addr, bool, error)
- func (d *DAL) GetCrossNetInfoByPayID(payID ctype.PayIDType) (ctype.PayIDType, int, ctype.Addr, bool, error)
- func (d *DAL) GetDelegatedPayStatus(payID ctype.PayIDType) (int, bool, error)
- func (d *DAL) GetDelegatedPaysOnStatus(dest ctype.Addr, status int) (map[ctype.PayIDType]*entity.ConditionalPay, error)
- func (d *DAL) GetDeposit(uuid string) (ctype.CidType, bool, *big.Int, bool, time.Time, int, string, string, bool, ...)
- func (d *DAL) GetDepositByTxHash(txhash string) (string, ctype.CidType, bool, *big.Int, bool, time.Time, int, string, bool, ...)
- func (d *DAL) GetDepositJob(uuid string) (*structs.DepositJob, bool, error)
- func (d *DAL) GetDepositJobByTxHash(txhash string) (*structs.DepositJob, bool, error)
- func (d *DAL) GetDepositState(uuid string) (int, string, bool, error)
- func (d *DAL) GetDestTokenOpenTs(dest ctype.Addr, token *entity.TokenInfo) (uint64, bool, error)
- func (d *DAL) GetDestTokenOsps(dest ctype.Addr, token *entity.TokenInfo) ([]ctype.Addr, error)
- func (d *DAL) GetDuplexChannel(cid ctype.CidType) (*entity.SimplexPaymentChannel, *rpc.SignedSimplexState, ...)
- func (d *DAL) GetInactiveChansByTokenAndState(token *entity.TokenInfo, state int, stateTs time.Time) ([]ctype.CidType, []ctype.Addr, []*entity.TokenInfo, []*time.Time, []*time.Time, ...)
- func (d *DAL) GetInactiveCidsByTokenAndState(token *entity.TokenInfo, state int, stateTs time.Time) ([]ctype.CidType, error)
- func (d *DAL) GetLeaseOwner(id string) (string, bool, error)
- func (d *DAL) GetLocalToken(netId uint64, netToken *entity.TokenInfo) (*entity.TokenInfo, bool, error)
- func (d *DAL) GetMonitorAddrsByEventAndRestart(eventName string, restart bool) ([]ctype.Addr, error)
- func (d *DAL) GetMonitorBlock(event string) (uint64, int64, bool, error)
- func (d *DAL) GetMonitorRestart(event string) (bool, bool, error)
- func (d *DAL) GetNetBridge(bridgeAddr ctype.Addr) (uint64, bool, error)
- func (d *DAL) GetNetId() (uint64, error)
- func (d *DAL) GetOnChainBalance(cid ctype.CidType) (*structs.OnChainBalance, bool, error)
- func (d *DAL) GetPayAndEgressState(payID ctype.PayIDType) (*entity.ConditionalPay, []byte, int, bool, error)
- func (d *DAL) GetPayDelegator(payID ctype.PayIDType) (ctype.Addr, bool, error)
- func (d *DAL) GetPayEgress(payID ctype.PayIDType) (ctype.CidType, int, bool, error)
- func (d *DAL) GetPayEgressChannel(payID ctype.PayIDType) (ctype.CidType, bool, error)
- func (d *DAL) GetPayForRecvSettleProof(payID ctype.PayIDType) (*entity.ConditionalPay, ctype.Addr, bool, error)
- func (d *DAL) GetPayHistory(peer ctype.Addr, beforeTs time.Time, smallestPayID ctype.PayIDType, ...) ([]ctype.PayIDType, []*entity.ConditionalPay, []int64, []int64, error)
- func (d *DAL) GetPayIngress(payID ctype.PayIDType) (ctype.CidType, int, bool, error)
- func (d *DAL) GetPayIngressChannel(payID ctype.PayIDType) (ctype.CidType, bool, error)
- func (d *DAL) GetPayIngressPeer(payID ctype.PayIDType) (ctype.Addr, bool, error)
- func (d *DAL) GetPayNote(payID ctype.PayIDType) (*anypb.Any, bool, error)
- func (d *DAL) GetPayPath(payID ctype.PayIDType) (*rpc.PayPath, error)
- func (d *DAL) GetPayStates(payID ctype.PayIDType) (int, int, bool, error)
- func (d *DAL) GetPayment(payID ctype.PayIDType) (*entity.ConditionalPay, []byte, bool, error)
- func (d *DAL) GetPaymentInfo(payID ctype.PayIDType) (*entity.ConditionalPay, *anypb.Any, ctype.CidType, int, ctype.CidType, int, ...)
- func (d *DAL) GetPaysForAuthAck(payIDs []ctype.PayIDType, isOut bool) ([]*rpc.PayInAuthAck, error)
- func (d *DAL) GetPeerCids(peer ctype.Addr) ([]ctype.CidType, bool, error)
- func (d *DAL) GetPeerDelegateProof(peer ctype.Addr) (*rpc.DelegationProof, bool, error)
- func (d *DAL) GetPeerServer(peer ctype.Addr) (string, bool, error)
- func (d *DAL) GetPeerSimplex(cid ctype.CidType) (*entity.SimplexPaymentChannel, *rpc.SignedSimplexState, bool, error)
- func (d *DAL) GetQueryTime(query string) (uint64, error)
- func (d *DAL) GetRoutingCid(dest ctype.Addr, token *entity.TokenInfo) (ctype.CidType, bool, error)
- func (d *DAL) GetSecret(hash string) (string, bool, error)
- func (d *DAL) GetSelfSimplex(cid ctype.CidType) (*entity.SimplexPaymentChannel, *rpc.SignedSimplexState, bool, error)
- func (d *DAL) GetTcbDeposit(addr ctype.Addr, token *entity.TokenInfo) (*big.Int, bool, error)
- func (d *DAL) HasCooperativeWithdrawJob(withdrawHash string) (bool, error)
- func (d *DAL) HasDepositTxHash(txhash string) (bool, error)
- func (d *DAL) HasNetId() (bool, error)
- func (d *DAL) InsertChan(cid ctype.CidType, peer ctype.Addr, token *entity.TokenInfo, ledger ctype.Addr, ...) error
- func (d *DAL) InsertChanMessage(cid ctype.CidType, seqnum uint64, msg *rpc.CelerMsg) error
- func (d *DAL) InsertChanWithTs(cid ctype.CidType, peer ctype.Addr, token *entity.TokenInfo, ledger ctype.Addr, ...) error
- func (d *DAL) InsertClosedChan(cid ctype.CidType, peer ctype.Addr, token *entity.TokenInfo, openTs time.Time, ...) error
- func (d *DAL) InsertCrossNetPay(payID, originalPayID ctype.PayIDType, originalPay []byte, state int, ...) error
- func (d *DAL) InsertDelegatedPay(payID ctype.PayIDType, dest ctype.Addr, status int) error
- func (d *DAL) InsertDeposit(uuid string, cid ctype.CidType, topeer bool, amount *big.Int, refill bool, ...) error
- func (d *DAL) InsertDestToken(dest ctype.Addr, token *entity.TokenInfo, osps []ctype.Addr, openTs uint64) error
- func (d *DAL) InsertEdge(token *entity.TokenInfo, cid ctype.CidType, addr1, addr2 ctype.Addr) error
- func (d *DAL) InsertMonitor(event string, blockNum uint64, blockIdx int64, restart bool) error
- func (d *DAL) InsertPayDelegator(payID ctype.PayIDType, dest, delegator ctype.Addr) error
- func (d *DAL) InsertPayment(payID ctype.PayIDType, payBytes []byte, pay *entity.ConditionalPay, ...) error
- func (d *DAL) InsertPaymentWithTs(payID ctype.PayIDType, payBytes []byte, pay *entity.ConditionalPay, ...) error
- func (d *DAL) InsertPeer(peer ctype.Addr, server string, cids []ctype.CidType) error
- func (d *DAL) InsertSecret(hash, preImage string, payID ctype.PayIDType) error
- func (d *DAL) InsertTcb(addr ctype.Addr, token *entity.TokenInfo, deposit *big.Int) error
- func (d *DAL) OpenTransaction() (*DALTx, error)
- func (d *DAL) PutCooperativeWithdrawJob(withdrawHash string, job *structs.CooperativeWithdrawJob) error
- func (d *DAL) PutNetId(id uint64) error
- func (d *DAL) PutPayPath(payID ctype.PayIDType, path *rpc.PayPath) error
- func (d *DAL) PutQueryTime(query string, ts uint64) error
- func (d *DAL) Transactional(callback TxFunc, args ...interface{}) error
- func (d *DAL) UpdateChanLedger(cid ctype.CidType, ledger ctype.Addr) error
- func (d *DAL) UpdateChanMigrationState(cid ctype.CidType, toLedger ctype.Addr, state int) error
- func (d *DAL) UpdateChanOpenResp(cid ctype.CidType, openResp *rpc.OpenChannelResponse) error
- func (d *DAL) UpdateChanSeqNums(cid ctype.CidType, baseSeqNum uint64, lastUsedSeqNum uint64, ...) error
- func (d *DAL) UpdateChanState(cid ctype.CidType, state int) error
- func (d *DAL) UpdateDelegatedPayStatus(payID ctype.PayIDType, status int) error
- func (d *DAL) UpdateDepositErrMsg(uuid, errmsg string) error
- func (d *DAL) UpdateDepositErrMsgByTxHash(txhash, errmsg string) error
- func (d *DAL) UpdateDepositStateAndTxHash(uuid string, state int, txhash string) error
- func (d *DAL) UpdateDepositStatesByTxHashAndCid(txhash string, cid ctype.CidType, state int) error
- func (d *DAL) UpdateDepositsErrMsg(uuids []string, errmsg string) error
- func (d *DAL) UpdateDepositsStateAndTxHash(uuids []string, state int, txhash string) error
- func (d *DAL) UpdateDestTokenOsps(dest ctype.Addr, token *entity.TokenInfo, osps []ctype.Addr) error
- func (d *DAL) UpdateLeaseTimestamp(id, owner string) error
- func (d *DAL) UpdateMonitorBlock(event string, blockNum uint64, blockIdx int64) error
- func (d *DAL) UpdateOnChainBalance(cid ctype.CidType, balance *structs.OnChainBalance) error
- func (d *DAL) UpdatePeerCid(peer ctype.Addr, cid ctype.CidType, add bool) error
- func (d *DAL) UpdatePeerCids(peer ctype.Addr, cids []ctype.CidType) error
- func (d *DAL) UpdatePeerDelegateProof(peer ctype.Addr, proof *rpc.DelegationProof) error
- func (d *DAL) UpdateTcbDeposit(addr ctype.Addr, token *entity.TokenInfo, deposit *big.Int) error
- func (d *DAL) UpsertBridgeRouting(destNetId uint64, bridgeAddr ctype.Addr) error
- func (d *DAL) UpsertChanMigration(cid ctype.CidType, toLedger ctype.Addr, deadline uint64, state int, ...) error
- func (d *DAL) UpsertDestTokenOpenTs(dest ctype.Addr, token *entity.TokenInfo, openTs uint64) error
- func (d *DAL) UpsertMonitorBlock(event string, blockNum uint64, blockIdx int64, restart bool) error
- func (d *DAL) UpsertMonitorRestart(event string, restart bool) error
- func (d *DAL) UpsertNetBridge(bridgeAddr ctype.Addr, bridgeNetId uint64) error
- func (d *DAL) UpsertNetToken(netId uint64, netToken *entity.TokenInfo, localToken *entity.TokenInfo) error
- func (d *DAL) UpsertPeerServer(peer ctype.Addr, server string) error
- func (d *DAL) UpsertRouting(dest ctype.Addr, token *entity.TokenInfo, cid ctype.CidType) error
- type DALTx
- func (tx *DALTx) Commit() error
- func (tx *DALTx) ConvertError(err error) error
- func (dtx *DALTx) DeleteChan(cid ctype.CidType) error
- func (dtx *DALTx) DeleteChanMessage(cid ctype.CidType, seqnum uint64) error
- func (dtx *DALTx) DeleteChanMigration(cid ctype.CidType) error
- func (dtx *DALTx) DeleteCooperativeWithdrawJob(withdrawHash string) error
- func (dtx *DALTx) DeleteDelegatedPay(payID ctype.PayIDType) error
- func (dtx *DALTx) DeleteLease(id string) error
- func (dtx *DALTx) DeleteOpenChannelTs(peerAddr, tokenAddr ctype.Addr) error
- func (dtx *DALTx) DeletePayment(payID ctype.PayIDType) error
- func (dtx *DALTx) DeleteQueryTime(query string) error
- func (dtx *DALTx) DeleteRouting(dest ctype.Addr, token *entity.TokenInfo) error
- func (dtx *DALTx) DeleteSecretByPayID(payID ctype.PayIDType) error
- func (tx *DALTx) Discard()
- func (dtx *DALTx) GetAllCooperativeWithdrawJobKeys() ([]string, error)
- func (dtx *DALTx) GetChanForBalance(cid ctype.CidType) (ctype.Addr, *structs.OnChainBalance, uint64, uint64, ...)
- func (dtx *DALTx) GetChanForClose(cid ctype.CidType) (ctype.Addr, *entity.TokenInfo, time.Time, bool, error)
- func (dtx *DALTx) GetChanForIntendSettle(cid ctype.CidType) (ctype.Addr, int, *entity.SimplexPaymentChannel, *entity.SimplexPaymentChannel, ...)
- func (dtx *DALTx) GetChanForMigration(cid ctype.CidType) (int, ctype.Addr, bool, error)
- func (dtx *DALTx) GetChanForRecvPayRequest(cid ctype.CidType) (ctype.Addr, int, *structs.OnChainBalance, uint64, uint64, ...)
- func (dtx *DALTx) GetChanForRecvResponse(cid ctype.CidType) (ctype.Addr, int, uint64, uint64, uint64, uint64, bool, error)
- func (dtx *DALTx) GetChanForSendCondPayRequest(cid ctype.CidType) (ctype.Addr, int, *structs.OnChainBalance, uint64, uint64, uint64, ...)
- func (dtx *DALTx) GetChanForSendPaySettleRequest(cid ctype.CidType) (ctype.Addr, int, uint64, uint64, uint64, *entity.SimplexPaymentChannel, bool, ...)
- func (dtx *DALTx) GetChanLedger(cid ctype.CidType) (ctype.Addr, bool, error)
- func (dtx *DALTx) GetChanMessage(cid ctype.CidType, seqnum uint64) (*rpc.CelerMsg, bool, error)
- func (dtx *DALTx) GetChanMigration(cid ctype.CidType, toLedger ctype.Addr) (uint64, int, []byte, bool, error)
- func (dtx *DALTx) GetChanPeer(cid ctype.CidType) (ctype.Addr, bool, error)
- func (dtx *DALTx) GetChanPeerState(cid ctype.CidType) (ctype.Addr, int, bool, error)
- func (dtx *DALTx) GetChanSeqNums(cid ctype.CidType) (uint64, uint64, uint64, uint64, bool, error)
- func (dtx *DALTx) GetChanState(cid ctype.CidType) (int, bool, error)
- func (dtx *DALTx) GetChanStateAndPeerSimplex(cid ctype.CidType) (int, *entity.SimplexPaymentChannel, bool, error)
- func (dtx *DALTx) GetCooperativeWithdrawJob(withdrawHash string) (*structs.CooperativeWithdrawJob, error)
- func (dtx *DALTx) GetDelegatedPayStatus(payID ctype.PayIDType) (int, bool, error)
- func (dtx *DALTx) GetLease(id string) (string, time.Time, bool, error)
- func (dtx *DALTx) GetMonitorBlock(event string) (uint64, int64, bool, error)
- func (dtx *DALTx) GetMonitorRestart(event string) (bool, bool, error)
- func (dtx *DALTx) GetOnChainBalance(cid ctype.CidType) (*structs.OnChainBalance, bool, error)
- func (dtx *DALTx) GetOpenChannelTs(peerAddr, tokenAddr ctype.Addr) (*openchannelts.OpenChannelTs, error)
- func (dtx *DALTx) GetPayAndEgressState(payID ctype.PayIDType) (*entity.ConditionalPay, []byte, int, bool, error)
- func (dtx *DALTx) GetPayDelegator(payID ctype.PayIDType) (ctype.Addr, bool, error)
- func (dtx *DALTx) GetPayEgress(payID ctype.PayIDType) (ctype.CidType, int, bool, error)
- func (dtx *DALTx) GetPayForRecvSecret(payID ctype.PayIDType) (*entity.ConditionalPay, *anypb.Any, int, bool, error)
- func (dtx *DALTx) GetPayForRecvSettleReq(payID ctype.PayIDType) (*entity.ConditionalPay, *anypb.Any, ctype.CidType, int, int, bool, error)
- func (dtx *DALTx) GetPayIngress(payID ctype.PayIDType) (ctype.CidType, int, bool, error)
- func (dtx *DALTx) GetPayIngressChannel(payID ctype.PayIDType) (ctype.CidType, bool, error)
- func (dtx *DALTx) GetPayNote(payID ctype.PayIDType) (*anypb.Any, bool, error)
- func (dtx *DALTx) GetPayment(payID ctype.PayIDType) (*entity.ConditionalPay, []byte, bool, error)
- func (dtx *DALTx) GetPeerCids(peer ctype.Addr) ([]ctype.CidType, bool, error)
- func (dtx *DALTx) GetPeerServer(peer ctype.Addr) (string, bool, error)
- func (dtx *DALTx) GetPeerSimplex(cid ctype.CidType) (*entity.SimplexPaymentChannel, *rpc.SignedSimplexState, bool, error)
- func (dtx *DALTx) GetQueryTime(query string) (uint64, error)
- func (dtx *DALTx) GetSecret(hash string) (string, bool, error)
- func (dtx *DALTx) GetTcbDeposit(addr ctype.Addr, token *entity.TokenInfo) (*big.Int, bool, error)
- func (dtx *DALTx) HasCooperativeWithdrawJob(withdrawHash string) (bool, error)
- func (dtx *DALTx) HasDepositRefillPending(cid ctype.CidType) (bool, error)
- func (dtx *DALTx) HasOpenChannelTs(peerAddr, tokenAddr ctype.Addr) (bool, error)
- func (dtx *DALTx) InsertChan(cid ctype.CidType, peer ctype.Addr, token *entity.TokenInfo, ledger ctype.Addr, ...) error
- func (dtx *DALTx) InsertChanMessage(cid ctype.CidType, seqnum uint64, msg *rpc.CelerMsg) error
- func (dtx *DALTx) InsertClosedChan(cid ctype.CidType, peer ctype.Addr, token *entity.TokenInfo, openTs time.Time, ...) error
- func (dtx *DALTx) InsertDelegatedPay(payID ctype.PayIDType, dest ctype.Addr, status int) error
- func (dtx *DALTx) InsertDeposit(uuid string, cid ctype.CidType, topeer bool, amount *big.Int, refill bool, ...) error
- func (dtx *DALTx) InsertLease(id, owner string) error
- func (dtx *DALTx) InsertMonitor(event string, blockNum uint64, blockIdx int64, restart bool) error
- func (dtx *DALTx) InsertPayment(payID ctype.PayIDType, payBytes []byte, pay *entity.ConditionalPay, ...) error
- func (dtx *DALTx) InsertPeer(peer ctype.Addr, server string, cids []ctype.CidType) error
- func (dtx *DALTx) InsertSecret(hash, preImage string, payID ctype.PayIDType) error
- func (dtx *DALTx) InsertTcb(addr ctype.Addr, token *entity.TokenInfo, deposit *big.Int) error
- func (dtx *DALTx) PutCooperativeWithdrawJob(withdrawHash string, job *structs.CooperativeWithdrawJob) error
- func (dtx *DALTx) PutOpenChannelTs(peerAddr, tokenAddr ctype.Addr, openChannelTs *openchannelts.OpenChannelTs) error
- func (dtx *DALTx) PutQueryTime(query string, ts uint64) error
- func (dtx *DALTx) UpdateChanForRecvRequest(cid ctype.CidType, peerSimplex *rpc.SignedSimplexState) error
- func (dtx *DALTx) UpdateChanForRecvResponse(cid ctype.CidType, baseSeqNum uint64, lastUsedSeqNum uint64, ...) error
- func (dtx *DALTx) UpdateChanForSendRequest(cid ctype.CidType, baseSeqNum uint64, lastUsedSeqNum uint64) error
- func (dtx *DALTx) UpdateChanLedger(cid ctype.CidType, ledger ctype.Addr) error
- func (dtx *DALTx) UpdateChanMigrationState(cid ctype.CidType, toLedger ctype.Addr, state int) error
- func (dtx *DALTx) UpdateChanSeqNums(cid ctype.CidType, baseSeqNum uint64, lastUsedSeqNum uint64, ...) error
- func (dtx *DALTx) UpdateChanState(cid ctype.CidType, state int) error
- func (dtx *DALTx) UpdateDelegatedPayStatus(payID ctype.PayIDType, status int) error
- func (dtx *DALTx) UpdateDepositStatesByTxHashAndCid(txhash string, cid ctype.CidType, state int) error
- func (dtx *DALTx) UpdateLeaseOwner(id, owner string) error
- func (dtx *DALTx) UpdateLeaseTimestamp(id, owner string) error
- func (dtx *DALTx) UpdateMonitorBlock(event string, blockNum uint64, blockIdx int64) error
- func (dtx *DALTx) UpdateOnChainBalance(cid ctype.CidType, balance *structs.OnChainBalance) error
- func (dtx *DALTx) UpdatePayEgress(payID ctype.PayIDType, cid ctype.CidType, state int) error
- func (dtx *DALTx) UpdatePayEgressState(payID ctype.PayIDType, state int) error
- func (dtx *DALTx) UpdatePayIngressState(payID ctype.PayIDType, state int) error
- func (dtx *DALTx) UpdatePeerCid(peer ctype.Addr, cid ctype.CidType, add bool) error
- func (dtx *DALTx) UpdatePeerCids(peer ctype.Addr, cids []ctype.CidType) error
- func (dtx *DALTx) UpdateSendingDelegatedPay(payID, payIDout ctype.PayIDType) error
- func (dtx *DALTx) UpdateTcbDeposit(addr ctype.Addr, token *entity.TokenInfo, deposit *big.Int) error
- func (dtx *DALTx) UpsertChanMigration(cid ctype.CidType, toLedger ctype.Addr, deadline uint64, state int, ...) error
- func (dtx *DALTx) UpsertMonitorBlock(event string, blockNum uint64, blockIdx int64, restart bool) error
- func (dtx *DALTx) UpsertMonitorRestart(event string, restart bool) error
- type KVStore
- type KVStoreSQL
- func (s *KVStoreSQL) Close()
- func (s *KVStoreSQL) Delete(table, key string) error
- func (s *KVStoreSQL) Exec(query string, args ...interface{}) (sql.Result, error)
- func (s *KVStoreSQL) Get(table, key string, value interface{}) error
- func (s *KVStoreSQL) GetKeysByPrefix(table, prefix string) ([]string, error)
- func (s *KVStoreSQL) Has(table, key string) (bool, error)
- func (s *KVStoreSQL) OpenTransaction() (Transaction, error)
- func (s *KVStoreSQL) Put(table, key string, value interface{}) error
- func (s *KVStoreSQL) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (s *KVStoreSQL) QueryRow(query string, args ...interface{}) *sql.Row
- type OnChainBalance
- type PendingWithdrawal
- type SqlStorage
- type Storage
- type Transaction
- type TransactionSQL
- func (tx *TransactionSQL) Commit() error
- func (tx *TransactionSQL) ConvertError(err error) error
- func (tx *TransactionSQL) Delete(table, key string) error
- func (tx *TransactionSQL) Discard()
- func (tx *TransactionSQL) Exec(query string, args ...interface{}) (sql.Result, error)
- func (tx *TransactionSQL) Get(table, key string, value interface{}) error
- func (tx *TransactionSQL) GetKeysByPrefix(table, prefix string) ([]string, error)
- func (tx *TransactionSQL) Has(table, key string) (bool, error)
- func (tx *TransactionSQL) Put(table, key string, value interface{}) error
- func (tx *TransactionSQL) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (tx *TransactionSQL) QueryRow(query string, args ...interface{}) *sql.Row
- type TxFunc
Constants ¶
const (
NoTxID = uint32(0) // reserved for non-transactional operations
)
Variables ¶
var ( ErrNoRows = errors.New("No rows matched in the database") ErrTxConflict = errors.New("Transaction conflict") ErrTxInvalid = errors.New("Invalid transaction") )
var ( ErrNilValue = errors.New("Value cannot be nil") ErrSQLiteRequiresCgo = errors.New("sqlite3 requires cgo; rebuild with CGO_ENABLED=1 or use -storesql") )
Functions ¶
Types ¶
type DAL ¶
type DAL struct {
// contains filtered or unexported fields
}
func (*DAL) CountCidsByTokenAndState ¶
func (*DAL) CountInactiveCidsByTokenAndState ¶
func (*DAL) CountPayments ¶
func (*DAL) DeleteBridgeRouting ¶
func (*DAL) DeleteChanMessage ¶
func (*DAL) DeleteCooperativeWithdrawJob ¶
func (*DAL) DeleteDeposit ¶
func (*DAL) DeleteDestToken ¶
func (*DAL) DeleteLeaseOwner ¶
func (*DAL) DeleteNetToken ¶
func (*DAL) DeleteQueryTime ¶
func (*DAL) DeleteRouting ¶
func (*DAL) DeleteSecret ¶
func (*DAL) GetAllBridgeRouting ¶
func (*DAL) GetAllChanMessages ¶
func (*DAL) GetAllChansByTokenAndState ¶
func (*DAL) GetAllCooperativeWithdrawJobKeys ¶
func (*DAL) GetAllDepositJobsByCid ¶
func (*DAL) GetAllDepositJobsByState ¶
func (d *DAL) GetAllDepositJobsByState(state int) ([]*structs.DepositJob, error)
func (*DAL) GetAllDestTokenOsps ¶
func (*DAL) GetAllNetTokents ¶
func (*DAL) GetAllPaymentInfoByCid ¶
func (*DAL) GetAllPeerServers ¶
func (*DAL) GetAllRoutingCids ¶
func (*DAL) GetAllRunningDepositJobs ¶
func (d *DAL) GetAllRunningDepositJobs() ([]*structs.DepositJob, error)
func (*DAL) GetAllSubmittedDepositTxHashes ¶
func (*DAL) GetBridgeRouting ¶
func (*DAL) GetChanForDeposit ¶
func (*DAL) GetChanForMigration ¶
func (*DAL) GetChanLedger ¶
func (*DAL) GetChanMessage ¶
func (*DAL) GetChanMigration ¶
func (*DAL) GetChanMigrationReqByLedgerAndStateWithLimit ¶
func (*DAL) GetChanOpenResp ¶
func (*DAL) GetChanSeqNums ¶
func (*DAL) GetChanStateToken ¶
func (*DAL) GetChanViewInfoByID ¶
func (d *DAL) GetChanViewInfoByID(cid ctype.CidType) (int, *time.Time, *time.Time, *entity.PaymentChannelInitializer, *structs.OnChainBalance, *entity.SimplexPaymentChannel, *entity.SimplexPaymentChannel, bool, error)
func (*DAL) GetChannelsForAuthAck ¶
func (*DAL) GetChannelsForAuthReq ¶
func (*DAL) GetCidByPeerToken ¶
func (*DAL) GetCidStateByPeerToken ¶
func (*DAL) GetCidTokensByPeer ¶
func (*DAL) GetCidsByTokenAndState ¶
func (*DAL) GetClosedChan ¶
func (*DAL) GetCooperativeWithdrawJob ¶
func (d *DAL) GetCooperativeWithdrawJob(withdrawHash string) (*structs.CooperativeWithdrawJob, error)
func (*DAL) GetCrossNetInfoByOrignalPayID ¶
func (*DAL) GetCrossNetInfoByPayID ¶
func (*DAL) GetDelegatedPayStatus ¶
func (*DAL) GetDelegatedPaysOnStatus ¶
func (*DAL) GetDeposit ¶
func (*DAL) GetDepositByTxHash ¶
func (*DAL) GetDepositJob ¶
func (*DAL) GetDepositJobByTxHash ¶
func (*DAL) GetDestTokenOpenTs ¶ added in v1.2.0
func (*DAL) GetDestTokenOsps ¶
func (*DAL) GetDuplexChannel ¶
func (d *DAL) GetDuplexChannel(cid ctype.CidType) (*entity.SimplexPaymentChannel, *rpc.SignedSimplexState, *entity.SimplexPaymentChannel, *rpc.SignedSimplexState, bool, error)
func (*DAL) GetInactiveChansByTokenAndState ¶
func (*DAL) GetInactiveCidsByTokenAndState ¶
func (*DAL) GetLocalToken ¶
func (*DAL) GetMonitorAddrsByEventAndRestart ¶
func (*DAL) GetMonitorBlock ¶
func (*DAL) GetOnChainBalance ¶
func (*DAL) GetPayAndEgressState ¶
func (d *DAL) GetPayAndEgressState(payID ctype.PayIDType) (*entity.ConditionalPay, []byte, int, bool, error)
GetPayAndEgressState returns (pay, pay_bytes, egress_state, found, error)
func (*DAL) GetPayDelegator ¶
func (*DAL) GetPayEgress ¶
func (*DAL) GetPayEgressChannel ¶
func (*DAL) GetPayForRecvSettleProof ¶
func (*DAL) GetPayHistory ¶
func (d *DAL) GetPayHistory( peer ctype.Addr, beforeTs time.Time, smallestPayID ctype.PayIDType, maxResultSize int32) ([]ctype.PayIDType, []*entity.ConditionalPay, []int64, []int64, error)
GetPayHistory returns payIDs, pay entities, pay in_states and creation time where peer is either src or dest of the pay. Pays are sorted in reverse-chronological order. smallestPayID: if query result contains multiple entries with creation timestamp equals to beforeTs, the pays returned from this func will only include ones that has higher payID than smallestPayID. Same dimensions of the four guaranteed.
func (*DAL) GetPayIngress ¶
func (*DAL) GetPayIngressChannel ¶
func (*DAL) GetPayIngressPeer ¶
func (*DAL) GetPayStates ¶
func (*DAL) GetPayment ¶
func (*DAL) GetPaymentInfo ¶
func (*DAL) GetPaysForAuthAck ¶
func (*DAL) GetPeerDelegateProof ¶
func (*DAL) GetPeerSimplex ¶
func (d *DAL) GetPeerSimplex(cid ctype.CidType) (*entity.SimplexPaymentChannel, *rpc.SignedSimplexState, bool, error)
func (*DAL) GetRoutingCid ¶
func (*DAL) GetSelfSimplex ¶
func (d *DAL) GetSelfSimplex(cid ctype.CidType) (*entity.SimplexPaymentChannel, *rpc.SignedSimplexState, bool, error)
func (*DAL) GetTcbDeposit ¶
func (*DAL) HasCooperativeWithdrawJob ¶
func (*DAL) InsertChan ¶
func (d *DAL) InsertChan(cid ctype.CidType, peer ctype.Addr, token *entity.TokenInfo, ledger ctype.Addr, state int, openResp *rpc.OpenChannelResponse, onchainBalance *structs.OnChainBalance, baseSeqNum uint64, lastUsedSeqNum uint64, lastAckedSeqNum uint64, lastNackedSeqNum uint64, selfSimplex *rpc.SignedSimplexState, peerSimplex *rpc.SignedSimplexState) error
func (*DAL) InsertChanMessage ¶
The "messages" table.
func (*DAL) InsertChanWithTs ¶
func (d *DAL) InsertChanWithTs(cid ctype.CidType, peer ctype.Addr, token *entity.TokenInfo, ledger ctype.Addr, state int, stateTs, openTs time.Time, openResp *rpc.OpenChannelResponse, onchainBalance *structs.OnChainBalance, baseSeqNum uint64, lastUsedSeqNum uint64, lastAckedSeqNum uint64, lastNackedSeqNum uint64, selfSimplex *rpc.SignedSimplexState, peerSimplex *rpc.SignedSimplexState) error
The "channels" table.
func (*DAL) InsertClosedChan ¶
func (d *DAL) InsertClosedChan(cid ctype.CidType, peer ctype.Addr, token *entity.TokenInfo, openTs time.Time, closeTs time.Time) error
The "closedchannels" table.
func (*DAL) InsertCrossNetPay ¶
func (d *DAL) InsertCrossNetPay(payID, originalPayID ctype.PayIDType, originalPay []byte, state int, srcNetId, DstNetId uint64, bridgeAddr ctype.Addr, bridgeNetId uint64) error
The "crossnetpays" table.
func (*DAL) InsertDelegatedPay ¶
The "paydelegation" table.
func (*DAL) InsertDeposit ¶
func (d *DAL) InsertDeposit(uuid string, cid ctype.CidType, topeer bool, amount *big.Int, refill bool, deadline time.Time, state int, txhash string, errmsg string) error
The "deposit" table
func (*DAL) InsertDestToken ¶
func (d *DAL) InsertDestToken(dest ctype.Addr, token *entity.TokenInfo, osps []ctype.Addr, openTs uint64) error
The "desttokens" table.
func (*DAL) InsertEdge ¶
The "edges" table.
func (*DAL) InsertMonitor ¶
The "monitor" table.
func (*DAL) InsertPayDelegator ¶
func (*DAL) InsertPayment ¶
func (*DAL) InsertPaymentWithTs ¶
func (d *DAL) InsertPaymentWithTs(payID ctype.PayIDType, payBytes []byte, pay *entity.ConditionalPay, note *anypb.Any, inCid ctype.CidType, inState int, outCid ctype.CidType, outState int, createTs time.Time) error
The "payments" table.
func (*DAL) InsertPeer ¶
The "peers" table.
func (*DAL) InsertSecret ¶
The "secrets" table.
func (*DAL) OpenTransaction ¶
func (*DAL) PutCooperativeWithdrawJob ¶
func (d *DAL) PutCooperativeWithdrawJob( withdrawHash string, job *structs.CooperativeWithdrawJob) error
func (*DAL) Transactional ¶
func (*DAL) UpdateChanLedger ¶
func (*DAL) UpdateChanMigrationState ¶
func (*DAL) UpdateChanOpenResp ¶
func (*DAL) UpdateChanSeqNums ¶
func (*DAL) UpdateDelegatedPayStatus ¶
func (*DAL) UpdateDepositErrMsg ¶
func (*DAL) UpdateDepositErrMsgByTxHash ¶
func (*DAL) UpdateDepositStateAndTxHash ¶
func (*DAL) UpdateDepositStatesByTxHashAndCid ¶
func (*DAL) UpdateDepositsErrMsg ¶
func (*DAL) UpdateDepositsStateAndTxHash ¶
func (*DAL) UpdateDestTokenOsps ¶
func (*DAL) UpdateLeaseTimestamp ¶
func (*DAL) UpdateMonitorBlock ¶
func (*DAL) UpdateOnChainBalance ¶
func (*DAL) UpdatePeerCid ¶
func (*DAL) UpdatePeerCids ¶
func (*DAL) UpdatePeerDelegateProof ¶
func (*DAL) UpdateTcbDeposit ¶
func (*DAL) UpsertBridgeRouting ¶
The "bridgerouting" table
func (*DAL) UpsertChanMigration ¶
func (d *DAL) UpsertChanMigration(cid ctype.CidType, toLedger ctype.Addr, deadline uint64, state int, onchainReq *chain.ChannelMigrationRequest) error
The "migration" table
func (*DAL) UpsertDestTokenOpenTs ¶ added in v1.2.0
func (*DAL) UpsertMonitorBlock ¶
func (*DAL) UpsertMonitorRestart ¶
func (*DAL) UpsertNetBridge ¶
The "netbridge" table
type DALTx ¶
type DALTx struct {
// contains filtered or unexported fields
}
func (*DALTx) ConvertError ¶
func (*DALTx) DeleteChanMessage ¶
func (*DALTx) DeleteCooperativeWithdrawJob ¶
func (*DALTx) DeleteDelegatedPay ¶
func (*DALTx) DeleteLease ¶
func (*DALTx) DeleteOpenChannelTs ¶
func (*DALTx) DeleteQueryTime ¶
func (*DALTx) DeleteRouting ¶
func (*DALTx) DeleteSecretByPayID ¶
func (*DALTx) GetAllCooperativeWithdrawJobKeys ¶
func (*DALTx) GetChanForBalance ¶
func (dtx *DALTx) GetChanForBalance(cid ctype.CidType) (ctype.Addr, *structs.OnChainBalance, uint64, uint64, *entity.SimplexPaymentChannel, *entity.SimplexPaymentChannel, bool, error)
func (*DALTx) GetChanForClose ¶
func (*DALTx) GetChanForIntendSettle ¶
func (*DALTx) GetChanForMigration ¶
func (*DALTx) GetChanForRecvPayRequest ¶
func (*DALTx) GetChanForRecvResponse ¶
func (*DALTx) GetChanForSendCondPayRequest ¶
func (*DALTx) GetChanForSendPaySettleRequest ¶
func (*DALTx) GetChanLedger ¶
func (*DALTx) GetChanMessage ¶
func (*DALTx) GetChanMigration ¶
func (*DALTx) GetChanPeer ¶
func (*DALTx) GetChanPeerState ¶
func (*DALTx) GetChanSeqNums ¶
func (*DALTx) GetChanStateAndPeerSimplex ¶
func (*DALTx) GetCooperativeWithdrawJob ¶
func (dtx *DALTx) GetCooperativeWithdrawJob( withdrawHash string) (*structs.CooperativeWithdrawJob, error)
func (*DALTx) GetDelegatedPayStatus ¶
func (*DALTx) GetMonitorBlock ¶
func (*DALTx) GetMonitorRestart ¶
func (*DALTx) GetOnChainBalance ¶
func (*DALTx) GetOpenChannelTs ¶
func (dtx *DALTx) GetOpenChannelTs(peerAddr, tokenAddr ctype.Addr) (*openchannelts.OpenChannelTs, error)
func (*DALTx) GetPayAndEgressState ¶
func (*DALTx) GetPayDelegator ¶
func (*DALTx) GetPayEgress ¶
func (*DALTx) GetPayForRecvSecret ¶
func (*DALTx) GetPayForRecvSettleReq ¶
func (*DALTx) GetPayIngress ¶
func (*DALTx) GetPayIngressChannel ¶
func (*DALTx) GetPayNote ¶
func (*DALTx) GetPayment ¶
func (*DALTx) GetPeerCids ¶
func (*DALTx) GetPeerServer ¶
func (*DALTx) GetPeerSimplex ¶
func (dtx *DALTx) GetPeerSimplex(cid ctype.CidType) (*entity.SimplexPaymentChannel, *rpc.SignedSimplexState, bool, error)
func (*DALTx) GetTcbDeposit ¶
func (*DALTx) HasCooperativeWithdrawJob ¶
func (*DALTx) HasDepositRefillPending ¶
func (*DALTx) HasOpenChannelTs ¶
func (*DALTx) InsertChan ¶
func (dtx *DALTx) InsertChan(cid ctype.CidType, peer ctype.Addr, token *entity.TokenInfo, ledger ctype.Addr, state int, openResp *rpc.OpenChannelResponse, onchainBalance *structs.OnChainBalance, baseSeqNum uint64, lastUsedSeqNum uint64, lastAckedSeqNum uint64, lastNackedSeqNum uint64, selfSimplex *rpc.SignedSimplexState, peerSimplex *rpc.SignedSimplexState) error
func (*DALTx) InsertChanMessage ¶
func (*DALTx) InsertClosedChan ¶
func (*DALTx) InsertDelegatedPay ¶
func (*DALTx) InsertDeposit ¶
func (*DALTx) InsertLease ¶
func (*DALTx) InsertMonitor ¶
func (*DALTx) InsertPayment ¶
func (*DALTx) InsertPeer ¶
func (*DALTx) InsertSecret ¶
func (*DALTx) PutCooperativeWithdrawJob ¶
func (dtx *DALTx) PutCooperativeWithdrawJob( withdrawHash string, job *structs.CooperativeWithdrawJob) error
func (*DALTx) PutOpenChannelTs ¶
func (dtx *DALTx) PutOpenChannelTs(peerAddr, tokenAddr ctype.Addr, openChannelTs *openchannelts.OpenChannelTs) error
func (*DALTx) UpdateChanForRecvRequest ¶
func (*DALTx) UpdateChanForRecvResponse ¶
func (*DALTx) UpdateChanForSendRequest ¶
func (*DALTx) UpdateChanLedger ¶
func (*DALTx) UpdateChanMigrationState ¶
func (*DALTx) UpdateChanSeqNums ¶
func (*DALTx) UpdateChanState ¶
func (*DALTx) UpdateDelegatedPayStatus ¶
func (*DALTx) UpdateDepositStatesByTxHashAndCid ¶
func (*DALTx) UpdateLeaseOwner ¶
func (*DALTx) UpdateLeaseTimestamp ¶
func (*DALTx) UpdateMonitorBlock ¶
func (*DALTx) UpdateOnChainBalance ¶
func (*DALTx) UpdatePayEgress ¶
func (*DALTx) UpdatePayEgressState ¶
func (*DALTx) UpdatePayIngressState ¶
func (*DALTx) UpdatePeerCid ¶
func (*DALTx) UpdatePeerCids ¶
func (*DALTx) UpdateSendingDelegatedPay ¶
func (*DALTx) UpdateTcbDeposit ¶
func (*DALTx) UpsertChanMigration ¶
func (*DALTx) UpsertMonitorBlock ¶
type KVStore ¶
type KVStore interface {
Close()
OpenTransaction() (Transaction, error)
Put(table, key string, value interface{}) error
Get(table, key string, value interface{}) error
Delete(table, key string) error
Has(table, key string) (bool, error)
GetKeysByPrefix(table, prefix string) ([]string, error)
Exec(query string, args ...interface{}) (sql.Result, error)
Query(query string, args ...interface{}) (*sql.Rows, error)
QueryRow(query string, args ...interface{}) *sql.Row
}
KVStore is the interface implemented by the local store (LevelDB wrapper) and by the remote store (gRPC calls to a store server).
type KVStoreSQL ¶
type KVStoreSQL struct {
// contains filtered or unexported fields
}
func NewKVStoreSQL ¶
func NewKVStoreSQL(driver, info string) (*KVStoreSQL, error)
Create a new remote K/V store.
func (*KVStoreSQL) Delete ¶
func (s *KVStoreSQL) Delete(table, key string) error
func (*KVStoreSQL) Exec ¶
func (s *KVStoreSQL) Exec(query string, args ...interface{}) (sql.Result, error)
func (*KVStoreSQL) Get ¶
func (s *KVStoreSQL) Get(table, key string, value interface{}) error
func (*KVStoreSQL) GetKeysByPrefix ¶
func (s *KVStoreSQL) GetKeysByPrefix(table, prefix string) ([]string, error)
func (*KVStoreSQL) OpenTransaction ¶
func (s *KVStoreSQL) OpenTransaction() (Transaction, error)
func (*KVStoreSQL) Put ¶
func (s *KVStoreSQL) Put(table, key string, value interface{}) error
type OnChainBalance ¶
type OnChainBalance struct {
MyDeposit []byte
MyWithdrawal []byte
PeerDeposit []byte
PeerWithdrawal []byte
PendingWithdrawal *PendingWithdrawal
}
DAL for on chain balances
type PendingWithdrawal ¶
type SqlStorage ¶
type Transaction ¶
type Transaction interface {
Commit() error
Discard()
ConvertError(err error) error
Put(table, key string, value interface{}) error
Get(table, key string, value interface{}) error
Delete(table, key string) error
Has(table, key string) (bool, error)
GetKeysByPrefix(table, prefix string) ([]string, error)
Exec(query string, args ...interface{}) (sql.Result, error)
Query(query string, args ...interface{}) (*sql.Rows, error)
QueryRow(query string, args ...interface{}) *sql.Row
}
Transaction is the interface implemented by the local and remote stores.
type TransactionSQL ¶
type TransactionSQL struct {
// contains filtered or unexported fields
}
func (*TransactionSQL) Commit ¶
func (tx *TransactionSQL) Commit() error
func (*TransactionSQL) ConvertError ¶
func (tx *TransactionSQL) ConvertError(err error) error
func (*TransactionSQL) Delete ¶
func (tx *TransactionSQL) Delete(table, key string) error
func (*TransactionSQL) Discard ¶
func (tx *TransactionSQL) Discard()
func (*TransactionSQL) Exec ¶
func (tx *TransactionSQL) Exec(query string, args ...interface{}) (sql.Result, error)
func (*TransactionSQL) Get ¶
func (tx *TransactionSQL) Get(table, key string, value interface{}) error
func (*TransactionSQL) GetKeysByPrefix ¶
func (tx *TransactionSQL) GetKeysByPrefix(table, prefix string) ([]string, error)
func (*TransactionSQL) Put ¶
func (tx *TransactionSQL) Put(table, key string, value interface{}) error