types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertPermissions

func ConvertPermissions(permissions subspacestypes.Permissions) pq.StringArray

ConvertPermissions converts the given permissions into a pq.StringArray so that it can be properly inserted into the database

func ConvertProfileRow

func ConvertProfileRow(row ProfileRow) (*profilestypes.Profile, error)

ConvertProfileRow converts the given row into a profile

func RemoveEmpty

func RemoveEmpty(s []string) []string

RemoveEmpty removes all empty strings from the given slice

func ToNullString

func ToNullString(value string) sql.NullString

ToNullString converts the given value to a nullable string

func ToNullTime

func ToNullTime(value *time.Time) sql.NullTime

ToNullTime converts the given value to a nullable time

Types

type BlockageRow

type BlockageRow struct {
	Blocker  string `db:"blocker_address"`
	Blocked  string `db:"blocked_address"`
	Reason   string `db:"reason"`
	Subspace uint64 `db:"subspace_id"`
	Height   int64  `db:"height"`
}

BlockageRow represents a single database row containing the data of a user blockage

func NewBlockageRow

func NewBlockageRow(blocker string, blocked string, reason string, subspace uint64, height int64) BlockageRow

func (BlockageRow) Equal

func (row BlockageRow) Equal(other BlockageRow) bool

type DbCoin

type DbCoin struct {
	Denom  string
	Amount string
}

DbCoin represents the information stored inside the database about a single coin

func NewDbCoin

func NewDbCoin(coin sdk.Coin) DbCoin

NewDbCoin builds a DbCoin starting from an SDK Coin

func (DbCoin) Equal

func (coin DbCoin) Equal(d DbCoin) bool

Equal tells whether coin and d represent the same coin with the same amount

func (*DbCoin) Scan

func (coin *DbCoin) Scan(src interface{}) error

Scan implements sql.Scanner

func (DbCoin) ToCoin

func (coin DbCoin) ToCoin() sdk.Coin

ToCoin converts this DbCoin to sdk.Coin

func (*DbCoin) Value

func (coin *DbCoin) Value() (driver.Value, error)

Value implements driver.Valuer

type DbCoins

type DbCoins []*DbCoin

DbCoins represents an array of coins

func NewDbCoins

func NewDbCoins(coins sdk.Coins) DbCoins

NewDbCoins build a new DbCoins object starting from an array of coins

func (DbCoins) Equal

func (coins DbCoins) Equal(d *DbCoins) bool

Equal tells whether c and d contain the same items in the same order

func (*DbCoins) Scan

func (coins *DbCoins) Scan(src interface{}) error

Scan implements sql.Scanner

func (DbCoins) ToCoins

func (coins DbCoins) ToCoins() sdk.Coins

ToCoins converts this DbCoins to sdk.Coins

type ProfileRow

type ProfileRow struct {
	Address      string    `db:"address"`
	DTag         string    `db:"dtag"`
	Nickname     string    `db:"nickname"`
	Bio          string    `db:"bio"`
	ProfilePic   string    `db:"profile_pic"`
	CoverPic     string    `db:"cover_pic"`
	CreationTime time.Time `db:"creation_time"`
	Height       int64     `db:"height"`
}

ProfileRow represents a single PostgreSQL row containing the data of a profile

type RelationshipRow

type RelationshipRow struct {
	RowID        uint64 `db:"row_id"`
	Creator      string `db:"creator_address"`
	Counterparty string `db:"counterparty_address"`
	Subspace     uint64 `db:"subspace_id"`
	Height       int64  `db:"height"`
}

RelationshipRow represents a database row containing the data of a relationship between two users

func NewRelationshipRow

func NewRelationshipRow(sender string, receiver string, subspace uint64, height int64) RelationshipRow

func (RelationshipRow) Equal

func (row RelationshipRow) Equal(other RelationshipRow) bool

Jump to

Keyboard shortcuts

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