entity

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotificationStatusPending = iota
	NotificationStatusDone
	NotificationStatusFail
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppID

type AppID int
const (
	AppIDCLI      AppID = 1
	AppIDDiscord  AppID = 2
	AppIDgRPC     AppID = 3
	AppIDHTTP     AppID = 4
	AppIDTelegram AppID = 5
)

func AllAppIDs

func AllAppIDs() []AppID

func (AppID) String

func (appID AppID) String() string

type AzbitPriceResponse

type AzbitPriceResponse struct {
	Timestamp                int     `json:"timestamp"`
	CurrencyPairCode         string  `json:"currencyPairCode"`
	Price                    float64 `json:"price"`
	Price24HAgo              float64 `json:"price24hAgo"`
	PriceChangePercentage24H float64 `json:"priceChangePercentage24h"`
	Volume24H                float64 `json:"volume24h"`
	BidPrice                 float64 `json:"bidPrice"`
	AskPrice                 float64 `json:"askPrice"`
	Low24H                   float64 `json:"low24h"`
	High24H                  float64 `json:"high24h"`
}

type Notification

type Notification struct {
	ID        uint                          `gorm:"primaryKey;unique"`
	Type      notification.NotificationType `gorm:"size:2"`
	Recipient string                        `gorm:"size:255"`
	Data      datatypes.JSON
	Status    NotificationStatus `gorm:"size:2"`

	gorm.Model
}

type NotificationStatus

type NotificationStatus int

type PhoenixFaucet

type PhoenixFaucet struct {
	ID              uint `gorm:"primaryKey;unique"`
	UserID          uint `gorm:"size:255"`
	Address         string
	Amount          amount.Amount `gorm:"column:amount"`
	TransactionHash string

	gorm.Model
}

func (*PhoenixFaucet) ElapsedTime

func (f *PhoenixFaucet) ElapsedTime() time.Duration

func (*PhoenixFaucet) TableName

func (*PhoenixFaucet) TableName() string

type Price

type Price struct {
	XeggexPacToUSDT XeggexPriceResponse
	AzbitPacToUSDT  AzbitPriceResponse
}

type Role

type Role int
const (
	Admin     Role = 0
	Moderator Role = 1
	BasicUser Role = 2
)

type User

type User struct {
	ID            uint `gorm:"primaryKey;unique"`
	ApplicationID AppID
	CallerID      string
	Role          Role

	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt sql.NullTime

	gorm.Model
}

type Validator

type Validator struct {
	ID    uint `gorm:"primaryKey;unique"`
	Name  string
	Email string `gorm:"size:255;unique;not null"`

	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt sql.NullTime

	gorm.Model
}

type Voucher

type Voucher struct {
	ID          uint          `gorm:"primaryKey;unique"`
	Creator     uint          `gorm:"size:255"`
	Code        string        `gorm:"size:8"`
	Amount      amount.Amount `gorm:"column:amount"`
	Desc        string
	Email       string
	Recipient   string
	ValidMonths uint8
	TxHash      string
	ClaimedBy   uint

	gorm.Model
}

func (*Voucher) IsClaimed

func (v *Voucher) IsClaimed() bool

func (Voucher) TableName

func (Voucher) TableName() string

type VoucherNotificationData

type VoucherNotificationData struct {
	Code      string  `json:"code"`
	Amount    float64 `json:"amount"`
	Recipient string  `json:"recipient"`
}

type XeggexPriceResponse

type XeggexPriceResponse struct {
	LastPrice      string  `json:"lastPrice"`
	YesterdayPrice string  `json:"yesterdayPrice"`
	HighPrice      string  `json:"highPrice"`
	LowPrice       string  `json:"lowPrice"`
	Volume         string  `json:"volume"`
	Decimal        int     `json:"priceDecimals"`
	BestAsk        string  `json:"bestAsk"`
	BestBid        string  `json:"bestBid"`
	SpreadPercent  string  `json:"spreadPercent"`
	ChangePercent  string  `json:"changePercent"`
	MarketCap      float64 `json:"marketcapNumber"`
}

type ZealyUser

type ZealyUser struct {
	Amount    amount.Amount `gorm:"column:amount"`
	DiscordID string        `gorm:"column:discord_id"`
	TxHash    string

	gorm.Model
}

func (*ZealyUser) IsClaimed

func (z *ZealyUser) IsClaimed() bool

Jump to

Keyboard shortcuts

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