Documentation
¶
Index ¶
- Constants
- Variables
- func BidKey(statePrefix []byte, id types.BidID) ([]byte, error)
- func BidKeyLegacy(id types.BidID) []byte
- func BidPrefixFromFilter(f mv1beta.BidFilters) ([]byte, error)
- func BidReverseKey(statePrefix []byte, id types.BidID) ([]byte, error)
- func BidReversePrefixFromFilter(f mv1beta.BidFilters) ([]byte, error)
- func BidStateReverseKey(state mv1beta.Bid_State, id types.BidID) ([]byte, error)
- func BidStateToPrefix(state mv1beta.Bid_State) []byte
- func BidsForOrderPrefix(statePrefix []byte, id types.OrderID) []byte
- func BidsForOrderPrefixLegacy(id types.OrderID) []byte
- func KeyToBidID(key BidPrimaryKey) mv1.BidID
- func KeyToLeaseID(key LeasePrimaryKey) mv1.LeaseID
- func KeyToOrderID(key OrderPrimaryKey) mv1.OrderID
- func LeaseKey(statePrefix []byte, id types.LeaseID) ([]byte, error)
- func LeaseKeyLegacy(id types.LeaseID) []byte
- func LeasePrefixFromFilter(f types.LeaseFilters) ([]byte, error)
- func LeaseReverseKey(statePrefix []byte, id types.LeaseID) ([]byte, error)
- func LeaseReversePrefixFromFilter(f types.LeaseFilters) ([]byte, error)
- func LeaseStateReverseKey(state types.Lease_State, id types.LeaseID) ([]byte, error)
- func LeaseStateToPrefix(state types.Lease_State) []byte
- func MustBidKey(statePrefix []byte, id types.BidID) []byte
- func MustBidReverseKey(statePrefix []byte, id types.BidID) []byte
- func MustBidStateRevereKey(state mv1beta.Bid_State, id types.BidID) []byte
- func MustLeaseKey(statePrefix []byte, id types.LeaseID) []byte
- func MustLeaseReverseKey(statePrefix []byte, id types.LeaseID) []byte
- func MustLeaseStateReverseKey(state types.Lease_State, id types.LeaseID) []byte
- func MustOrderKey(statePrefix []byte, id types.OrderID) []byte
- func OrderKey(statePrefix []byte, id types.OrderID) ([]byte, error)
- func OrderKeyLegacy(id types.OrderID) []byte
- func OrderPrefixFromFilter(f mv1beta.OrderFilters) ([]byte, error)
- func OrderStateToPrefix(state mv1beta.Order_State) []byte
- func OrdersForGroupPrefix(statePrefix []byte, id dtypes.GroupID) []byte
- func OrdersForGroupPrefixLegacy(id dtypes.GroupID) []byte
- func SecondaryKeysForLeaseLegacy(id types.LeaseID) [][]byte
- func SecondaryLeaseKeyByProviderLegacy(id types.LeaseID) []byte
- type BidPrimaryKey
- type GroupPartKey
- type LeasePrimaryKey
- type OrderPrimaryKey
- type ProviderPartKey
Constants ¶
const ( OrderStateOpenPrefixID = byte(0x01) OrderStateActivePrefixID = byte(0x02) OrderStateClosedPrefixID = byte(0x03) BidStateOpenPrefixID = byte(0x01) BidStateActivePrefixID = byte(0x02) BidStateLostPrefixID = byte(0x03) BidStateClosedPrefixID = byte(0x04) LeaseStateActivePrefixID = byte(0x01) LeaseStateInsufficientFundsPrefixID = byte(0x02) LeaseStateClosedPrefixID = byte(0x03) )
Variables ¶
var ( OrderPrefix = []byte{0x11, 0x00} OrderPrefixNew = []byte{0x11, 0x01} OrderIndexStatePrefix = []byte{0x11, 0x02} OrderIndexGroupStatePrefix = []byte{0x11, 0x03} OrderStateOpenPrefix = []byte{OrderStateOpenPrefixID} OrderStateActivePrefix = []byte{OrderStateActivePrefixID} OrderStateClosedPrefix = []byte{OrderStateClosedPrefixID} BidPrefix = []byte{0x12, 0x00} BidPrefixReverse = []byte{0x12, 0x01} BidPrefixNew = []byte{0x12, 0x02} BidIndexStatePrefix = []byte{0x12, 0x03} BidIndexProviderPrefix = []byte{0x12, 0x04} BidIndexOrderStatePrefix = []byte{0x12, 0x05} BidStateOpenPrefix = []byte{BidStateOpenPrefixID} BidStateActivePrefix = []byte{BidStateActivePrefixID} BidStateLostPrefix = []byte{BidStateLostPrefixID} BidStateClosedPrefix = []byte{BidStateClosedPrefixID} LeasePrefix = []byte{0x13, 0x00} LeasePrefixReverse = []byte{0x13, 0x01} LeasePrefixNew = []byte{0x13, 0x02} LeaseIndexStatePrefix = []byte{0x13, 0x03} LeaseIndexProviderPrefix = []byte{0x13, 0x04} LeaseStateActivePrefix = []byte{LeaseStateActivePrefixID} LeaseStateInsufficientFundsPrefix = []byte{LeaseStateInsufficientFundsPrefixID} LeaseStateClosedPrefix = []byte{LeaseStateClosedPrefixID} )
var BidPrimaryKeyCodec = collections.PairKeyCodec( collections.QuadKeyCodec( collections.StringKey, collections.Uint64Key, collections.Uint32Key, collections.Uint32Key, ), collections.PairKeyCodec( collections.StringKey, collections.Uint32Key, ), )
BidPrimaryKeyCodec is the key codec for BidPrimaryKey, composed from stdlib codecs
var LeasePrimaryKeyCodec = collections.PairKeyCodec( collections.QuadKeyCodec( collections.StringKey, collections.Uint64Key, collections.Uint32Key, collections.Uint32Key, ), collections.PairKeyCodec( collections.StringKey, collections.Uint32Key, ), )
LeasePrimaryKeyCodec is the key codec for LeasePrimaryKey, composed from stdlib codecs
var OrderPrimaryKeyCodec = collections.QuadKeyCodec( collections.StringKey, collections.Uint64Key, collections.Uint32Key, collections.Uint32Key, )
OrderPrimaryKeyCodec is the key codec for OrderPrimaryKey
Functions ¶
func BidKeyLegacy ¶
func BidPrefixFromFilter ¶
func BidPrefixFromFilter(f mv1beta.BidFilters) ([]byte, error)
func BidReversePrefixFromFilter ¶
func BidReversePrefixFromFilter(f mv1beta.BidFilters) ([]byte, error)
func BidStateReverseKey ¶
func BidStateToPrefix ¶
func KeyToBidID ¶ added in v1.2.0
func KeyToBidID(key BidPrimaryKey) mv1.BidID
KeyToBidID converts a BidPrimaryKey back to a mv1.BidID
func KeyToLeaseID ¶ added in v1.2.0
func KeyToLeaseID(key LeasePrimaryKey) mv1.LeaseID
KeyToLeaseID converts a LeasePrimaryKey back to a mv1.LeaseID
func KeyToOrderID ¶ added in v1.2.0
func KeyToOrderID(key OrderPrimaryKey) mv1.OrderID
KeyToOrderID converts an OrderPrimaryKey back to a mv1.OrderID
func LeaseKeyLegacy ¶
func LeasePrefixFromFilter ¶
func LeasePrefixFromFilter(f types.LeaseFilters) ([]byte, error)
func LeaseReversePrefixFromFilter ¶
func LeaseReversePrefixFromFilter(f types.LeaseFilters) ([]byte, error)
func LeaseStateReverseKey ¶
func LeaseStateToPrefix ¶
func LeaseStateToPrefix(state types.Lease_State) []byte
func MustBidStateRevereKey ¶
func MustLeaseStateReverseKey ¶
func MustLeaseStateReverseKey(state types.Lease_State, id types.LeaseID) []byte
func OrderKeyLegacy ¶
func OrderPrefixFromFilter ¶
func OrderPrefixFromFilter(f mv1beta.OrderFilters) ([]byte, error)
func OrderStateToPrefix ¶
func OrderStateToPrefix(state mv1beta.Order_State) []byte
Types ¶
type BidPrimaryKey ¶ added in v1.2.0
type BidPrimaryKey = collections.Pair[OrderPrimaryKey, ProviderPartKey]
BidPrimaryKey is the full composite primary key for a bid in the IndexedMap
func BidIDToKey ¶ added in v1.2.0
func BidIDToKey(id mv1.BidID) BidPrimaryKey
BidIDToKey converts a mv1.BidID to a BidPrimaryKey for use with the IndexedMap
type GroupPartKey ¶ added in v1.2.0
type GroupPartKey = collections.Triple[string, uint64, uint32]
GroupPartKey represents (owner, dseq, gseq) for group-based index lookups
type LeasePrimaryKey ¶ added in v1.2.0
type LeasePrimaryKey = collections.Pair[OrderPrimaryKey, ProviderPartKey]
LeasePrimaryKey is the full composite primary key for a lease in the IndexedMap
func LeaseIDToKey ¶ added in v1.2.0
func LeaseIDToKey(id mv1.LeaseID) LeasePrimaryKey
LeaseIDToKey converts a mv1.LeaseID to a LeasePrimaryKey for use with the IndexedMap
type OrderPrimaryKey ¶ added in v1.2.0
OrderPrimaryKey represents the order portion of a BidID: (owner, dseq, gseq, oseq)
func OrderIDToKey ¶ added in v1.2.0
func OrderIDToKey(id mv1.OrderID) OrderPrimaryKey
OrderIDToKey converts a mv1.OrderID to an OrderPrimaryKey for use with the IndexedMap
type ProviderPartKey ¶ added in v1.2.0
type ProviderPartKey = collections.Pair[string, uint32]
ProviderPartKey represents the provider portion of a BidID: (provider, bseq)