query

package
v0.23.0-rc20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2023 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPath = errors.New("query: invalid path")
	ErrOwnerValue  = errors.New("query: invalid owner value")
	ErrStateValue  = errors.New("query: invalid state value")
)

Functions

func LeasePath

func LeasePath(id types.LeaseID) string

LeasePath return lease path of given lease id for queries

func OrderPath

func OrderPath(id types.OrderID) string

OrderPath return order path of given order id for queries

func ParseLeasePath

func ParseLeasePath(parts []string) (types.LeaseID, error)

parseLeasePath returns leaseID details with provided queries, and return error if occurred due to wrong query

Types

type Bid

type Bid types.Bid

Bid type

func (Bid) String

func (obj Bid) String() string

type BidFilters

type BidFilters struct {
	Owner sdk.AccAddress
	// State flag value given
	StateFlagVal string
	// Actual state value decoded from Bid_State_value
	State types.Bid_State
}

BidFilters defines flags for bid list filter

func (BidFilters) Accept

func (f BidFilters) Accept(obj types.Bid, isValidState bool) bool

Accept returns true if object matches filter requirements

type Bids

type Bids []Bid

Bids - Slice of Bid Struct

func (Bids) String

func (obj Bids) String() string

type Client

type Client interface {
	Orders(filters OrderFilters) (Orders, error)
	Order(id types.OrderID) (Order, error)
	Bids(filters BidFilters) (Bids, error)
	Bid(id types.BidID) (Bid, error)
	Leases(filters LeaseFilters) (Leases, error)
	Lease(id types.LeaseID) (Lease, error)
}

Client interface

type Lease

type Lease types.Lease

Lease type

func (Lease) String

func (obj Lease) String() string

type LeaseFilters

type LeaseFilters struct {
	Owner sdk.AccAddress
	// State flag value given
	StateFlagVal string
	// Actual state value decoded from Lease_State_value
	State types.Lease_State
}

LeaseFilters defines flags for lease list filter

func (LeaseFilters) Accept

func (f LeaseFilters) Accept(obj types.Lease, isValidState bool) bool

Accept returns true if object matches filter requirements

type Leases

type Leases []Lease

Leases - Slice of Lease Struct

func (Leases) String

func (obj Leases) String() string

type Order

type Order types.Order

Order type

func (Order) String

func (obj Order) String() string

type OrderFilters

type OrderFilters struct {
	Owner sdk.AccAddress
	// State flag value given
	StateFlagVal string
	// Actual state value decoded from Order_State_value
	State types.Order_State
}

OrderFilters defines flags for order list filter

func (OrderFilters) Accept

func (f OrderFilters) Accept(obj types.Order, isValidState bool) bool

Accept returns true if object matches filter requirements

type Orders

type Orders []Order

Orders - Slice of Order Struct

func (Orders) String

func (obj Orders) String() string

type RawClient

type RawClient interface {
	Orders(filters OrderFilters) ([]byte, error)
	Order(id types.OrderID) ([]byte, error)
	Bids(filters BidFilters) ([]byte, error)
	Bid(id types.BidID) ([]byte, error)
	Leases(filters LeaseFilters) ([]byte, error)
	Lease(id types.LeaseID) ([]byte, error)
}

RawClient interface

func NewRawClient

func NewRawClient(ctx sdkclient.Context, key string) RawClient

NewRawClient creates a raw client instance with provided context and key

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL