Documentation ¶
Index ¶
- Constants
- Variables
- type ChanState
- type DAL
- func (d *DAL) DeleteChannelMessage(cid ctype.CidType, seqnum uint64) error
- func (d *DAL) DeleteChannelSeqNums(cid ctype.CidType) error
- func (d *DAL) DeleteChannelState(cid ctype.CidType) error
- func (d *DAL) DeleteConditionalPay(payID ctype.PayIDType) error
- func (d *DAL) DeleteCooperativeWithdrawJob(withdrawHash string) error
- func (d *DAL) DeleteDepositJob(jobID string) error
- func (d *DAL) DeleteDepositTxHashToJobID(txHash string) error
- func (d *DAL) DeleteEdge(token ctype.Addr, cid ctype.CidType) error
- func (d *DAL) DeleteEventMonitorBit(eventName string) error
- func (d *DAL) DeleteLogEventWatch(name string) error
- func (d *DAL) DeleteOnChainBalance(cid ctype.CidType) error
- func (d *DAL) DeletePayEgressState(payID ctype.PayIDType) error
- func (d *DAL) DeletePayIngressState(payID ctype.PayIDType) error
- func (d *DAL) DeletePeer(cid ctype.CidType) error
- func (d *DAL) DeletePeerActiveChannels(peer string) error
- func (d *DAL) DeleteRoute(dest, tokenAddr string) error
- func (d *DAL) DeleteSecretRegistry(hash string) error
- func (d *DAL) DeleteServingOsp(clientAddr ctype.Addr, tokenAddr ctype.Addr, ospAddr ctype.Addr) error
- func (d *DAL) DeleteSimplexState(cid ctype.CidType, owner string) error
- func (d *DAL) GetAllChannelMessageSeqnums(cid ctype.CidType) ([]uint64, error)
- func (d *DAL) GetAllChannelStateKeys() ([]ctype.CidType, error)
- func (d *DAL) GetAllConditionalPays() ([]*entity.ConditionalPay, error)
- func (d *DAL) GetAllCooperativeWithdrawJobKeys() ([]string, error)
- func (d *DAL) GetAllDepositJobKeys() ([]string, error)
- func (d *DAL) GetAllEdgeTokens() (map[ctype.Addr]bool, error)
- func (d *DAL) GetAllLogEventWatchKeys() ([]string, error)
- func (d *DAL) GetAllMarkedOsp() (map[ctype.Addr]bool, error)
- func (d *DAL) GetAllOnChainBalanceKeys() ([]ctype.CidType, error)
- func (d *DAL) GetAllPaymentStateKeys() ([]ctype.PayIDType, []ctype.PayIDType, error)
- func (d *DAL) GetAllPeerLookUpTableKeys() ([]ctype.CidType, error)
- func (d *DAL) GetAllRoutes() (map[ctype.Addr]map[ctype.Addr]ctype.CidType, error)
- func (d *DAL) GetAllRoutingTableKeys() ([]string, error)
- func (d *DAL) GetAllRoutingTableKeysToDest(dest string) ([]string, error)
- func (d *DAL) GetAllSecretRegistryKeys() ([]string, error)
- func (d *DAL) GetAllServingOsps() (map[ctype.Addr]map[ctype.Addr]servingOspMap, error)
- func (d *DAL) GetChannelMessage(cid ctype.CidType, seqnum uint64) (*rpc.CelerMsg, error)
- func (d *DAL) GetChannelSeqNums(cid ctype.CidType) (*common.ChannelSeqNums, error)
- func (d *DAL) GetChannelState(cid ctype.CidType) (string, int64, error)
- func (d *DAL) GetCidByPeerAndToken(peer []byte, token *entity.TokenInfo) ctype.CidType
- func (d *DAL) GetCidByPeerAndTokenWithErr(peer []byte, token *entity.TokenInfo) (ctype.CidType, bool, error)
- func (d *DAL) GetConditionalPay(payID ctype.PayIDType) (*entity.ConditionalPay, []byte, error)
- func (d *DAL) GetCooperativeWithdrawJob(withdrawHash string) (*jobs.CooperativeWithdrawJob, error)
- func (d *DAL) GetDepositJob(jobID string) (*jobs.DepositJob, error)
- func (d *DAL) GetDepositTxHashToJobID(txHash string) (string, error)
- func (d *DAL) GetEdges(token ctype.Addr) (map[ctype.CidType]*graph.Edge, error)
- func (d *DAL) GetLastOpenChanReqBlkNum(peer []byte, token *entity.TokenInfo) (int64, error)
- func (d *DAL) GetLogEventWatch(name string) (*structs.LogEventID, error)
- func (d *DAL) GetOnChainBalance(cid ctype.CidType) (*structs.OnChainBalance, error)
- func (d *DAL) GetPayEgressState(payID ctype.PayIDType) (ctype.CidType, string, int64, error)
- func (d *DAL) GetPayIngressState(payID ctype.PayIDType) (ctype.CidType, string, int64, error)
- func (d *DAL) GetPayNote(payID ctype.PayIDType) (*any.Any, error)
- func (d *DAL) GetPeer(cid ctype.CidType) (string, error)
- func (d *DAL) GetPeerActiveChannels(peer string) (map[ctype.CidType]bool, error)
- func (d *DAL) GetRoute(dest, tokenAddr string) (ctype.CidType, error)
- func (d *DAL) GetSecretRegistry(hash string) (string, error)
- func (d *DAL) GetServingOsps(clientAddr ctype.Addr, tokenAddr ctype.Addr) (servingOspMap, error)
- func (d *DAL) GetSimplexPaymentChannel(cid ctype.CidType, owner string) (*entity.SimplexPaymentChannel, *rpc.SignedSimplexState, error)
- func (d *DAL) GetTokenContractAddr(cid ctype.CidType) (string, error)
- func (d *DAL) HasChannelMessage(cid ctype.CidType, seqnum uint64) (bool, error)
- func (d *DAL) HasChannelSeqNums(cid ctype.CidType) (bool, error)
- func (d *DAL) HasChannelState(cid ctype.CidType) (bool, error)
- func (d *DAL) HasCooperativeWithdrawJob(withdrawHash string) (bool, error)
- func (d *DAL) HasDepositJob(jobID string) (bool, error)
- func (d *DAL) HasDepositTxHashToJobID(txHash string) (bool, error)
- func (d *DAL) HasEventMonitorBit(eventName string) (bool, error)
- func (d *DAL) HasLogEventWatch(name string) (bool, error)
- func (d *DAL) HasOnChainBalance(cid ctype.CidType) (bool, error)
- func (d *DAL) HasPayEgressState(payID ctype.PayIDType) (bool, error)
- func (d *DAL) HasPayIngressState(payID ctype.PayIDType) (bool, error)
- func (d *DAL) HasPeer(cid ctype.CidType) (bool, error)
- func (d *DAL) HasPeerActiveChannels(peer string) (bool, error)
- func (d *DAL) HasRoute(dest, tokenAddr string) (bool, error)
- func (d *DAL) HasSecretRegistry(hash string) (bool, error)
- func (d *DAL) MarkOsp(osp ctype.Addr)
- func (d *DAL) OpenTransaction() (*DALTx, error)
- func (d *DAL) PutChannelMessage(cid ctype.CidType, seqnum uint64, msg *rpc.CelerMsg) error
- func (d *DAL) PutChannelSeqNums(cid ctype.CidType, seqnums *common.ChannelSeqNums) error
- func (d *DAL) PutChannelState(cid ctype.CidType, state string) error
- func (d *DAL) PutCidForPeerAndToken(peer []byte, token *entity.TokenInfo, cid ctype.CidType) error
- func (d *DAL) PutConditionalPay(payBytes []byte) error
- func (d *DAL) PutCooperativeWithdrawJob(withdrawHash string, job *jobs.CooperativeWithdrawJob) error
- func (d *DAL) PutDepositJob(jobID string, job *jobs.DepositJob) error
- func (d *DAL) PutDepositTxHashToJobID(txHash string, jobID string) error
- func (d *DAL) PutEdge(token ctype.Addr, cid ctype.CidType, edge *graph.Edge) error
- func (d *DAL) PutEventMonitorBit(eventName string) error
- func (d *DAL) PutLastOpenChanReqBlkNum(peer []byte, token *entity.TokenInfo, blkNum int64) error
- func (d *DAL) PutLogEventWatch(name string, id *structs.LogEventID) error
- func (d *DAL) PutOnChainBalance(cid ctype.CidType, balance *structs.OnChainBalance) error
- func (d *DAL) PutPayEgressState(payID ctype.PayIDType, cid ctype.CidType, status string) error
- func (d *DAL) PutPayIngressState(payID ctype.PayIDType, cid ctype.CidType, status string) error
- func (d *DAL) PutPayNote(condPay *entity.ConditionalPay, note *any.Any) error
- func (d *DAL) PutPeer(cid ctype.CidType, peer string) error
- func (d *DAL) PutPeerActiveChannels(peer string, cids map[ctype.CidType]bool) error
- func (d *DAL) PutRoute(dest, tokenAddr string, nextHop ctype.CidType) error
- func (d *DAL) PutSecretRegistry(hash, preimage string) error
- func (d *DAL) PutServingOsp(clientAddr ctype.Addr, tokenAddr ctype.Addr, ospAddr ctype.Addr) error
- func (d *DAL) PutSimplexState(cid ctype.CidType, owner string, simplexState *rpc.SignedSimplexState) error
- func (d *DAL) PutTokenContractAddr(cid ctype.CidType, addr string) error
- func (d *DAL) ScanAllCidsByPeer(peer []byte) []ctype.CidType
- func (d *DAL) Transactional(callback TxFunc, args ...interface{}) error
- func (d *DAL) UnmarkOsp(osp ctype.Addr)
- type DALTx
- func (tx *DALTx) Commit() error
- func (tx *DALTx) ConvertError(err error) error
- func (dtx *DALTx) DeleteChannelMessage(cid ctype.CidType, seqnum uint64) error
- func (dtx *DALTx) DeleteChannelSeqNums(cid ctype.CidType) error
- func (dtx *DALTx) DeleteChannelState(cid ctype.CidType) error
- func (dtx *DALTx) DeleteConditionalPay(payID ctype.PayIDType) error
- func (dtx *DALTx) DeleteCooperativeWithdrawJob(withdrawHash string) error
- func (dtx *DALTx) DeleteDepositJob(jobID string) error
- func (dtx *DALTx) DeleteDepositTxHashToJobID(txHash string) error
- func (dtx *DALTx) DeleteEventMonitorBit(eventName string) error
- func (dtx *DALTx) DeleteLogEventWatch(name string) error
- func (dtx *DALTx) DeleteOnChainBalance(cid ctype.CidType) error
- func (dtx *DALTx) DeleteOpenChannelTs(peerAddr ctype.Addr, tokenAddr ctype.Addr) error
- func (dtx *DALTx) DeletePayEgressState(payID ctype.PayIDType) error
- func (dtx *DALTx) DeletePayIngressState(payID ctype.PayIDType) error
- func (dtx *DALTx) DeletePeer(cid ctype.CidType) error
- func (dtx *DALTx) DeletePeerActiveChannels(peer string) error
- func (dtx *DALTx) DeleteRoute(dest, tokenAddr string) error
- func (dtx *DALTx) DeleteSecretRegistry(hash string) error
- func (dtx *DALTx) DeleteSimplexState(cid ctype.CidType, owner string) error
- func (tx *DALTx) Discard()
- func (dtx *DALTx) GetAllChannelMessageSeqnums(cid ctype.CidType) ([]uint64, error)
- func (dtx *DALTx) GetAllChannelStateKeys() ([]ctype.CidType, error)
- func (dtx *DALTx) GetAllConditionalPays() ([]*entity.ConditionalPay, error)
- func (dtx *DALTx) GetAllCooperativeWithdrawJobKeys() ([]string, error)
- func (dtx *DALTx) GetAllDepositJobKeys() ([]string, error)
- func (dtx *DALTx) GetAllLogEventWatchKeys() ([]string, error)
- func (dtx *DALTx) GetAllOnChainBalanceKeys() ([]ctype.CidType, error)
- func (dtx *DALTx) GetAllPaymentStateKeys() ([]ctype.PayIDType, []ctype.PayIDType, error)
- func (dtx *DALTx) GetAllPeerLookUpTableKeys() ([]ctype.CidType, error)
- func (dtx *DALTx) GetAllRoutingTableKeys() ([]string, error)
- func (dtx *DALTx) GetAllRoutingTableKeysToDest(dest string) ([]string, error)
- func (dtx *DALTx) GetAllSecretRegistryKeys() ([]string, error)
- func (dtx *DALTx) GetChannelMessage(cid ctype.CidType, seqnum uint64) (*rpc.CelerMsg, error)
- func (dtx *DALTx) GetChannelSeqNums(cid ctype.CidType) (*common.ChannelSeqNums, error)
- func (dtx *DALTx) GetChannelState(cid ctype.CidType) (string, int64, error)
- func (dtx *DALTx) GetCidByPeerAndToken(peer []byte, token *entity.TokenInfo) ctype.CidType
- func (dtx *DALTx) GetConditionalPay(payID ctype.PayIDType) (*entity.ConditionalPay, []byte, error)
- func (dtx *DALTx) GetCooperativeWithdrawJob(withdrawHash string) (*jobs.CooperativeWithdrawJob, error)
- func (dtx *DALTx) GetDepositJob(jobID string) (*jobs.DepositJob, error)
- func (dtx *DALTx) GetDepositTxHashToJobID(txHash string) (string, error)
- func (dtx *DALTx) GetLastOpenChanReqBlkNum(peer []byte, token *entity.TokenInfo) (int64, error)
- func (dtx *DALTx) GetLogEventWatch(name string) (*structs.LogEventID, error)
- func (dtx *DALTx) GetOnChainBalance(cid ctype.CidType) (*structs.OnChainBalance, error)
- func (dtx *DALTx) GetOpenChannelTs(peerAddr ctype.Addr, tokenAddr ctype.Addr) (*openchannelts.OpenChannelTs, error)
- func (dtx *DALTx) GetPayEgressState(payID ctype.PayIDType) (ctype.CidType, string, int64, error)
- func (dtx *DALTx) GetPayIngressState(payID ctype.PayIDType) (ctype.CidType, string, int64, error)
- func (dtx *DALTx) GetPayNote(payID ctype.PayIDType) (*any.Any, error)
- func (dtx *DALTx) GetPeer(cid ctype.CidType) (string, error)
- func (dtx *DALTx) GetPeerActiveChannels(peer string) (map[ctype.CidType]bool, error)
- func (dtx *DALTx) GetRoute(dest, tokenAddr string) (ctype.CidType, error)
- func (dtx *DALTx) GetSecretRegistry(hash string) (string, error)
- func (dtx *DALTx) GetSimplexPaymentChannel(cid ctype.CidType, owner string) (*entity.SimplexPaymentChannel, *rpc.SignedSimplexState, error)
- func (dtx *DALTx) GetTokenContractAddr(cid ctype.CidType) (string, error)
- func (dtx *DALTx) HasChannelMessage(cid ctype.CidType, seqnum uint64) (bool, error)
- func (dtx *DALTx) HasChannelSeqNums(cid ctype.CidType) (bool, error)
- func (dtx *DALTx) HasChannelState(cid ctype.CidType) (bool, error)
- func (dtx *DALTx) HasCooperativeWithdrawJob(withdrawHash string) (bool, error)
- func (dtx *DALTx) HasDepositJob(jobID string) (bool, error)
- func (dtx *DALTx) HasDepositTxHashToJobID(txHash string) (bool, error)
- func (dtx *DALTx) HasEventMonitorBit(eventName string) (bool, error)
- func (dtx *DALTx) HasLogEventWatch(name string) (bool, error)
- func (dtx *DALTx) HasOnChainBalance(cid ctype.CidType) (bool, error)
- func (dtx *DALTx) HasOpenChannelTs(peerAddr ctype.Addr, tokenAddr ctype.Addr) (bool, error)
- func (dtx *DALTx) HasPayEgressState(payID ctype.PayIDType) (bool, error)
- func (dtx *DALTx) HasPayIngressState(payID ctype.PayIDType) (bool, error)
- func (dtx *DALTx) HasPeer(cid ctype.CidType) (bool, error)
- func (dtx *DALTx) HasPeerActiveChannels(peer string) (bool, error)
- func (dtx *DALTx) HasRoute(dest, tokenAddr string) (bool, error)
- func (dtx *DALTx) HasSecretRegistry(hash string) (bool, error)
- func (dtx *DALTx) PutChannelMessage(cid ctype.CidType, seqnum uint64, msg *rpc.CelerMsg) error
- func (dtx *DALTx) PutChannelSeqNums(cid ctype.CidType, seqnums *common.ChannelSeqNums) error
- func (dtx *DALTx) PutChannelState(cid ctype.CidType, state string) error
- func (dtx *DALTx) PutCidForPeerAndToken(peer []byte, token *entity.TokenInfo, cid ctype.CidType) error
- func (dtx *DALTx) PutConditionalPay(payBytes []byte) error
- func (dtx *DALTx) PutCooperativeWithdrawJob(withdrawHash string, job *jobs.CooperativeWithdrawJob) error
- func (dtx *DALTx) PutDepositJob(jobID string, job *jobs.DepositJob) error
- func (dtx *DALTx) PutDepositTxHashToJobID(txHash string, jobID string) error
- func (dtx *DALTx) PutEventMonitorBit(eventName string) error
- func (dtx *DALTx) PutLastOpenChanReqBlkNum(peer []byte, token *entity.TokenInfo, blkNum int64) error
- func (dtx *DALTx) PutLogEventWatch(name string, id *structs.LogEventID) error
- func (dtx *DALTx) PutOnChainBalance(cid ctype.CidType, balance *structs.OnChainBalance) error
- func (dtx *DALTx) PutOpenChannelTs(peerAddr ctype.Addr, tokenAddr ctype.Addr, ...) error
- func (dtx *DALTx) PutPayEgressState(payID ctype.PayIDType, cid ctype.CidType, status string) error
- func (dtx *DALTx) PutPayIngressState(payID ctype.PayIDType, cid ctype.CidType, status string) error
- func (dtx *DALTx) PutPayNote(condPay *entity.ConditionalPay, note *any.Any) error
- func (dtx *DALTx) PutPeer(cid ctype.CidType, peer string) error
- func (dtx *DALTx) PutPeerActiveChannels(peer string, cids map[ctype.CidType]bool) error
- func (dtx *DALTx) PutRoute(dest, tokenAddr string, nextHop ctype.CidType) error
- func (dtx *DALTx) PutSecretRegistry(hash, preimage string) error
- func (dtx *DALTx) PutSimplexState(cid ctype.CidType, owner string, simplexState *rpc.SignedSimplexState) error
- func (dtx *DALTx) PutTokenContractAddr(cid ctype.CidType, addr string) error
- func (dtx *DALTx) ScanAllCidsByPeer(peer []byte) []ctype.CidType
- type KVStore
- type KVStoreLocal
- func (s *KVStoreLocal) Close()
- func (s *KVStoreLocal) Delete(table, key string) error
- func (s *KVStoreLocal) Get(table, key string, value interface{}) error
- func (s *KVStoreLocal) GetKeysByPrefix(table, prefix string) ([]string, error)
- func (s *KVStoreLocal) Has(table, key string) (bool, error)
- func (s *KVStoreLocal) OpenTransaction() (Transaction, error)
- func (s *KVStoreLocal) Put(table, key string, value interface{}) error
- type OnChainBalance
- type PayState
- type PendingWithdrawal
- type Storage
- type Transaction
- type TransactionLocal
- func (tx *TransactionLocal) Commit() error
- func (tx *TransactionLocal) ConvertError(err error) error
- func (tx *TransactionLocal) Delete(table, key string) error
- func (tx *TransactionLocal) Discard()
- func (tx *TransactionLocal) Get(table, key string, value interface{}) error
- func (tx *TransactionLocal) GetKeysByPrefix(table, prefix string) ([]string, error)
- func (tx *TransactionLocal) Has(table, key string) (bool, error)
- func (tx *TransactionLocal) Put(table, key string, value interface{}) error
- type TxFunc
Constants ¶
const (
NoTxID = uint32(0) // reserved for non-transactional operations
)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type DAL ¶
type DAL struct {
// contains filtered or unexported fields
}
func (*DAL) DeleteChannelMessage ¶
func (*DAL) DeleteCooperativeWithdrawJob ¶
func (*DAL) DeleteDepositJob ¶
func (*DAL) DeleteDepositTxHashToJobID ¶
func (*DAL) DeleteEventMonitorBit ¶
func (*DAL) DeleteLogEventWatch ¶
func (*DAL) DeletePayIngressState ¶
func (*DAL) DeletePeerActiveChannels ¶
func (*DAL) DeleteRoute ¶
func (*DAL) DeleteSecretRegistry ¶
func (*DAL) DeleteServingOsp ¶
func (*DAL) DeleteSimplexState ¶
func (*DAL) GetAllChannelMessageSeqnums ¶
func (*DAL) GetAllChannelStateKeys ¶
func (*DAL) GetAllConditionalPays ¶
func (d *DAL) GetAllConditionalPays() ([]*entity.ConditionalPay, error)
func (*DAL) GetAllCooperativeWithdrawJobKeys ¶
func (*DAL) GetAllDepositJobKeys ¶
func (*DAL) GetAllLogEventWatchKeys ¶
func (*DAL) GetAllOnChainBalanceKeys ¶
func (*DAL) GetAllPaymentStateKeys ¶
func (*DAL) GetAllPeerLookUpTableKeys ¶
func (*DAL) GetAllRoutes ¶
func (*DAL) GetAllRoutingTableKeys ¶
func (*DAL) GetAllRoutingTableKeysToDest ¶
func (*DAL) GetAllSecretRegistryKeys ¶
func (*DAL) GetAllServingOsps ¶
GetAllServingOsps returns (tokenAddr,client)->map[ospaddr]bool
func (*DAL) GetChannelMessage ¶
func (*DAL) GetChannelSeqNums ¶
func (*DAL) GetChannelState ¶
GetChannelState returns channel status, last update timestamp, and err msg
func (*DAL) GetCidByPeerAndToken ¶
Ideally we should enforce peer type as well, use []byte is easy for value from proto msg
func (*DAL) GetCidByPeerAndTokenWithErr ¶
func (*DAL) GetConditionalPay ¶
func (*DAL) GetCooperativeWithdrawJob ¶
func (d *DAL) GetCooperativeWithdrawJob(withdrawHash string) (*jobs.CooperativeWithdrawJob, error)
func (*DAL) GetDepositJob ¶
func (d *DAL) GetDepositJob(jobID string) (*jobs.DepositJob, error)
func (*DAL) GetDepositTxHashToJobID ¶
func (*DAL) GetLastOpenChanReqBlkNum ¶
func (*DAL) GetLogEventWatch ¶
func (d *DAL) GetLogEventWatch(name string) (*structs.LogEventID, error)
func (*DAL) GetOnChainBalance ¶
func (*DAL) GetPayEgressState ¶
GetPayEgressState returns pay egress cid, status, timestamp, err for a given payID
func (*DAL) GetPayIngressState ¶
GetPayIngressState returns pay ingress cid, status, timestamp, err for a given payID
func (*DAL) GetPeerActiveChannels ¶
func (*DAL) GetServingOsps ¶
func (*DAL) GetSimplexPaymentChannel ¶
func (d *DAL) GetSimplexPaymentChannel(cid ctype.CidType, owner string) (*entity.SimplexPaymentChannel, *rpc.SignedSimplexState, error)
func (*DAL) GetTokenContractAddr ¶
func (*DAL) HasChannelMessage ¶
func (*DAL) HasCooperativeWithdrawJob ¶
func (*DAL) HasDepositTxHashToJobID ¶
func (*DAL) HasPayEgressState ¶
func (*DAL) HasPayIngressState ¶
func (*DAL) OpenTransaction ¶
func (*DAL) PutChannelMessage ¶
func (*DAL) PutChannelSeqNums ¶
func (*DAL) PutCidForPeerAndToken ¶
func (*DAL) PutConditionalPay ¶
save payBytes, autogen key from hash, skip if already exists
func (*DAL) PutCooperativeWithdrawJob ¶
func (d *DAL) PutCooperativeWithdrawJob( withdrawHash string, job *jobs.CooperativeWithdrawJob) error
func (*DAL) PutDepositJob ¶
func (d *DAL) PutDepositJob(jobID string, job *jobs.DepositJob) error
func (*DAL) PutDepositTxHashToJobID ¶
func (*DAL) PutEventMonitorBit ¶
func (*DAL) PutLastOpenChanReqBlkNum ¶
func (*DAL) PutLogEventWatch ¶
func (d *DAL) PutLogEventWatch(name string, id *structs.LogEventID) error
func (*DAL) PutOnChainBalance ¶
func (*DAL) PutPayEgressState ¶
PutPayEgressState write pay egress cid, status for a given payID
func (*DAL) PutPayIngressState ¶
PutPayIngressState write pay ingress cid, status for a given payID
func (*DAL) PutPayNote ¶
func (*DAL) PutPeerActiveChannels ¶
func (*DAL) PutSecretRegistry ¶
func (*DAL) PutServingOsp ¶
func (*DAL) PutSimplexState ¶
func (*DAL) PutTokenContractAddr ¶
func (*DAL) ScanAllCidsByPeer ¶
ScanAllCidsByPeer does key scan and is expensive! only hello, sync_db and messenger/queue should call this to proper handle old db schema transition to new one that has peerActiveChannels table new code should only use peerActiveChannels
func (*DAL) Transactional ¶
type DALTx ¶
type DALTx struct {
// contains filtered or unexported fields
}
func (*DALTx) ConvertError ¶
func (*DALTx) DeleteChannelMessage ¶
func (*DALTx) DeleteChannelSeqNums ¶
func (*DALTx) DeleteConditionalPay ¶
func (*DALTx) DeleteCooperativeWithdrawJob ¶
func (*DALTx) DeleteDepositJob ¶
func (*DALTx) DeleteDepositTxHashToJobID ¶
func (*DALTx) DeleteEventMonitorBit ¶
func (*DALTx) DeleteLogEventWatch ¶
func (*DALTx) DeleteOnChainBalance ¶
func (*DALTx) DeleteOpenChannelTs ¶
func (*DALTx) DeletePayEgressState ¶
func (*DALTx) DeletePayIngressState ¶
func (*DALTx) DeletePeerActiveChannels ¶
func (*DALTx) DeleteRoute ¶
func (*DALTx) DeleteSecretRegistry ¶
func (*DALTx) DeleteSimplexState ¶
func (*DALTx) GetAllChannelMessageSeqnums ¶
func (*DALTx) GetAllChannelStateKeys ¶
func (*DALTx) GetAllConditionalPays ¶
func (dtx *DALTx) GetAllConditionalPays() ([]*entity.ConditionalPay, error)
func (*DALTx) GetAllCooperativeWithdrawJobKeys ¶
func (*DALTx) GetAllDepositJobKeys ¶
func (*DALTx) GetAllLogEventWatchKeys ¶
func (*DALTx) GetAllOnChainBalanceKeys ¶
func (*DALTx) GetAllPaymentStateKeys ¶
func (*DALTx) GetAllPeerLookUpTableKeys ¶
func (*DALTx) GetAllRoutingTableKeys ¶
func (*DALTx) GetAllRoutingTableKeysToDest ¶
func (*DALTx) GetAllSecretRegistryKeys ¶
func (*DALTx) GetChannelMessage ¶
func (*DALTx) GetChannelSeqNums ¶
func (*DALTx) GetChannelState ¶
GetChannelState returns channel status, last update timestamp, and err msg
func (*DALTx) GetCidByPeerAndToken ¶
func (*DALTx) GetConditionalPay ¶
func (*DALTx) GetCooperativeWithdrawJob ¶
func (dtx *DALTx) GetCooperativeWithdrawJob( withdrawHash string) (*jobs.CooperativeWithdrawJob, error)
func (*DALTx) GetDepositJob ¶
func (dtx *DALTx) GetDepositJob(jobID string) (*jobs.DepositJob, error)
func (*DALTx) GetDepositTxHashToJobID ¶
func (*DALTx) GetLastOpenChanReqBlkNum ¶
func (*DALTx) GetLogEventWatch ¶
func (dtx *DALTx) GetLogEventWatch(name string) (*structs.LogEventID, error)
func (*DALTx) GetOnChainBalance ¶
func (*DALTx) GetOpenChannelTs ¶
func (dtx *DALTx) GetOpenChannelTs(peerAddr ctype.Addr, tokenAddr ctype.Addr) (*openchannelts.OpenChannelTs, error)
func (*DALTx) GetPayEgressState ¶
GetPayEgressState returns pay egress cid, status, timestamp, err for a given payID
func (*DALTx) GetPayIngressState ¶
GetPayIngressState returns pay ingress cid, status, timestamp, err for a given payID
func (*DALTx) GetPeerActiveChannels ¶
func (*DALTx) GetSimplexPaymentChannel ¶
func (dtx *DALTx) GetSimplexPaymentChannel(cid ctype.CidType, owner string) (*entity.SimplexPaymentChannel, *rpc.SignedSimplexState, error)
func (*DALTx) GetTokenContractAddr ¶
func (*DALTx) HasChannelMessage ¶
func (*DALTx) HasChannelSeqNums ¶
func (*DALTx) HasCooperativeWithdrawJob ¶
func (*DALTx) HasDepositTxHashToJobID ¶
func (*DALTx) HasEventMonitorBit ¶
func (*DALTx) HasOnChainBalance ¶
func (*DALTx) HasOpenChannelTs ¶
func (*DALTx) HasPayEgressState ¶
func (*DALTx) HasPayIngressState ¶
func (*DALTx) HasPeerActiveChannels ¶
func (*DALTx) PutChannelMessage ¶
func (*DALTx) PutChannelSeqNums ¶
func (*DALTx) PutChannelState ¶
func (*DALTx) PutCidForPeerAndToken ¶
func (*DALTx) PutConditionalPay ¶
func (*DALTx) PutCooperativeWithdrawJob ¶
func (dtx *DALTx) PutCooperativeWithdrawJob( withdrawHash string, job *jobs.CooperativeWithdrawJob) error
func (*DALTx) PutDepositJob ¶
func (dtx *DALTx) PutDepositJob(jobID string, job *jobs.DepositJob) error
func (*DALTx) PutDepositTxHashToJobID ¶
func (*DALTx) PutEventMonitorBit ¶
func (*DALTx) PutLastOpenChanReqBlkNum ¶
func (*DALTx) PutLogEventWatch ¶
func (dtx *DALTx) PutLogEventWatch(name string, id *structs.LogEventID) error
func (*DALTx) PutOnChainBalance ¶
func (*DALTx) PutOpenChannelTs ¶
func (dtx *DALTx) PutOpenChannelTs(peerAddr ctype.Addr, tokenAddr ctype.Addr, openChannelTs *openchannelts.OpenChannelTs) error
func (*DALTx) PutPayEgressState ¶
PutPayEgressState write pay egress cid, status for a given payID
func (*DALTx) PutPayIngressState ¶
PutPayIngressState write pay ingress cid, status for a given payID
func (*DALTx) PutPayNote ¶
func (*DALTx) PutPeerActiveChannels ¶
func (*DALTx) PutSecretRegistry ¶
func (*DALTx) PutSimplexState ¶
func (*DALTx) PutTokenContractAddr ¶
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) }
KVStore is the interface implemented by the local store (LevelDB wrapper) and by the remote store (gRPC calls to a store server).
type KVStoreLocal ¶
type KVStoreLocal struct {
// contains filtered or unexported fields
}
func NewKVStoreLocal ¶
func NewKVStoreLocal(rootDir string, readOnly bool) (*KVStoreLocal, error)
Create a new local K/V store at the given root directory.
func (*KVStoreLocal) Delete ¶
func (s *KVStoreLocal) Delete(table, key string) error
Delete the entry for a key within a table's namespace.
func (*KVStoreLocal) Get ¶
func (s *KVStoreLocal) Get(table, key string, value interface{}) error
Extract the value of the given key within a table's namespace into the given variable.
func (*KVStoreLocal) GetKeysByPrefix ¶
func (s *KVStoreLocal) GetKeysByPrefix(table, prefix string) ([]string, error)
Return all keys for a given table and key prefix. The key prefix can be the empty string, which returns all keys within the table.
func (*KVStoreLocal) Has ¶
func (s *KVStoreLocal) Has(table, key string) (bool, error)
Check if an entry exists for the given key within a table's namespace.
func (*KVStoreLocal) OpenTransaction ¶
func (s *KVStoreLocal) OpenTransaction() (Transaction, error)
Start a store transaction.
func (*KVStoreLocal) Put ¶
func (s *KVStoreLocal) Put(table, key string, value interface{}) error
Store a key/value pair within a table's namespace.
type OnChainBalance ¶
type OnChainBalance struct { MyDeposit []byte MyWithdrawal []byte PeerDeposit []byte PeerWithdrawal []byte PendingWithdrawal *PendingWithdrawal }
DAL for on chain balances
type PendingWithdrawal ¶
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) }
Transaction is the interface implemented by the local and remote stores.
type TransactionLocal ¶
type TransactionLocal struct {
// contains filtered or unexported fields
}
func (*TransactionLocal) ConvertError ¶
func (tx *TransactionLocal) ConvertError(err error) error
func (*TransactionLocal) Delete ¶
func (tx *TransactionLocal) Delete(table, key string) error
In a transaction, delete the entry for a key within a table's namespace.
func (*TransactionLocal) Get ¶
func (tx *TransactionLocal) Get(table, key string, value interface{}) error
In a transaction, extract the value of the given key within a table's namespace into the given variable.
func (*TransactionLocal) GetKeysByPrefix ¶
func (tx *TransactionLocal) GetKeysByPrefix(table, prefix string) ([]string, error)
In a transaction, return all keys for a given table and key prefix. The key prefix can be the empty string, which returns all keys within the table.
func (*TransactionLocal) Has ¶
func (tx *TransactionLocal) Has(table, key string) (bool, error)
In a transaction, check if an entry exists for the given key within a table's namespace.
func (*TransactionLocal) Put ¶
func (tx *TransactionLocal) Put(table, key string, value interface{}) error
In a transaction, store a key/value pair within a table's namespace.