filter

package
v1.0.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 3 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContactFilter added in v0.28.0

type ContactFilter struct {
	ModelFilter `json:",inline"`
	ID          *string `json:"id"`
	FullName    *string `json:"fullName"`
	Paymail     *string `json:"paymail"`
	PubKey      *string `json:"pubKey"`
	Status      *string `json:"status,omitempty" enums:"unconfirmed,awaiting,confirmed,rejected"`
}

ContactFilter is a struct for handling request parameters for contact search requests

func (*ContactFilter) ToDbConditions added in v0.28.0

func (d *ContactFilter) ToDbConditions() map[string]interface{}

ToDbConditions converts filter fields to the datastore conditions using gorm naming strategy

type DestinationFilter

type DestinationFilter struct {
	ModelFilter   `json:",inline"`
	LockingScript *string `json:"locking_script,omitempty" example:"76a9147b05764a97f3b4b981471492aa703b188e45979b88ac"`
	Address       *string `json:"address,omitempty" example:"1CDUf7CKu8ocTTkhcYUbq75t14Ft168K65"`
	DraftID       *string `json:"draft_id,omitempty" example:"b356f7fa00cd3f20cce6c21d704cd13e871d28d714a5ebd0532f5a0e0cde63f7"`
}

DestinationFilter is a struct for handling request parameters for destination search requests

func (*DestinationFilter) ToDbConditions

func (d *DestinationFilter) ToDbConditions() map[string]interface{}

ToDbConditions converts filter fields to the datastore conditions using gorm naming strategy

type ModelFilter

type ModelFilter struct {
	IncludeDeleted *bool      `json:"include_deleted,omitempty" example:"true"`
	CreatedRange   *TimeRange `json:"created_range,omitempty" swaggertype:"object,string"`
	UpdatedRange   *TimeRange `json:"updated_range,omitempty" swaggertype:"object,string"`
}

ModelFilter is a common model filter that contains common fields for all model filters.

func (*ModelFilter) ToDbConditions

func (mf *ModelFilter) ToDbConditions() map[string]interface{}

ToDbConditions converts filter fields to the datastore conditions using gorm naming strategy

type TimeRange

type TimeRange struct {
	// From specifies the start time of the range. It's optional and can be nil.
	From *time.Time `json:"from,omitempty" example:"2024-02-26T11:01:28Z"`
	// To specifies the end time of the range. It's optional and can be nil.
	To *time.Time `json:"to,omitempty" example:"2024-02-26T11:01:28Z"`
}

TimeRange defines a range between two points in time.

func (*TimeRange) ToDbConditions

func (tr *TimeRange) ToDbConditions() map[string]interface{}

ToDbConditions converts the TimeRange to a set of database query conditions. Returns nil if both From and To are nil or zero, indicating no conditions.

type TransactionFilter

type TransactionFilter struct {
	ModelFilter     `json:",inline"`
	Hex             *string `json:"hex,omitempty"`
	BlockHash       *string `json:"block_hash,omitempty"`
	BlockHeight     *uint64 `json:"block_height,omitempty"`
	Fee             *uint64 `json:"fee,omitempty"`
	NumberOfInputs  *uint32 `json:"number_of_inputs,omitempty"`
	NumberOfOutputs *uint32 `json:"number_of_outputs,omitempty"`
	DraftID         *string `json:"draft_id,omitempty"`
	TotalValue      *uint64 `json:"total_value,omitempty"`
	Status          *string `` /* 204-byte string literal not displayed */
}

TransactionFilter is a struct for handling request parameters for destination search requests

func (*TransactionFilter) ToDbConditions

func (d *TransactionFilter) ToDbConditions() map[string]interface{}

ToDbConditions converts filter fields to the datastore conditions using gorm naming strategy

Jump to

Keyboard shortcuts

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