model

package
v0.0.0-...-95d8435 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migration

func Migration(db *gorm.DB) error

Types

type CoinBalanceChangeEvent

type CoinBalanceChangeEvent struct {
	TransactionDigest string                      `json:"tx_digest" gorm:"primaryKey,priority:2"`
	EventSeq          int64                       `json:"event_seq"  gorm:"primaryKey,priority:1"`
	Timestamp         uint64                      `json:"timestamp"`
	PackageID         string                      `json:"package_id"`
	TransactionModule string                      `json:"transaction_module"`
	Sender            types.Address               `json:"sender"`
	ChangeType        types.CoinBalanceChangeType `json:"change_type"`
	Owner             types.ObjectOwner           `json:"owner" gorm:"serializer:json"`
	CoinType          string                      `json:"coin_type"`
	CoinObjectID      string                      `json:"coin_object_id"`
	Version           int64                       `json:"version"`
	Amount            *bigint.Bigint              `json:"amount"`
}

func (*CoinBalanceChangeEvent) TableName

func (*CoinBalanceChangeEvent) TableName() string

type DeleteObjectEvent

type DeleteObjectEvent struct {
	TransactionDigest string        `json:"tx_digest" gorm:"primaryKey,priority:2"`
	EventSeq          int64         `json:"event_seq"  gorm:"primaryKey,priority:1"`
	Timestamp         uint64        `json:"timestamp"`
	PackageID         string        `json:"package_id"`
	TransactionModule string        `json:"transaction_module"`
	Sender            types.Address `json:"sender"`
	ObjectID          string        `json:"object_id"`
	Version           int64         `json:"version"`
}

func (*DeleteObjectEvent) TableName

func (*DeleteObjectEvent) TableName() string

type Model

type Model interface {
	TableName() string
}

type MoveEvent

type MoveEvent struct {
	TransactionDigest string        `json:"tx_digest" gorm:"primaryKey,priority:2"`
	EventSeq          int64         `json:"event_seq"  gorm:"primaryKey,priority:1"`
	Timestamp         uint64        `json:"timestamp"`
	PackageID         string        `json:"package_id"`
	TransactionModule string        `json:"transaction_module"`
	Sender            types.Address `json:"sender"`
	Fields            interface{}   `json:"fields" gorm:"serializer:json"`
	Type              string        `json:"type"`
	BCS               string        `json:"bcs"`
}

func (*MoveEvent) TableName

func (*MoveEvent) TableName() string

type MutateObjectEvent

type MutateObjectEvent struct {
	TransactionDigest string        `json:"tx_digest" gorm:"primaryKey,priority:2"`
	EventSeq          int64         `json:"event_seq"  gorm:"primaryKey,priority:1"`
	Timestamp         uint64        `json:"timestamp"`
	PackageID         string        `json:"package_id"`
	TransactionModule string        `json:"transaction_module"`
	Sender            types.Address `json:"sender"`
	ObjectType        string        `json:"object_type"`
	ObjectID          string        `json:"object_id"`
	Version           int64         `json:"version"`
}

func (*MutateObjectEvent) TableName

func (*MutateObjectEvent) TableName() string

type NewObjectEvent

type NewObjectEvent struct {
	TransactionDigest string            `json:"tx_digest" gorm:"primaryKey,priority:2"`
	EventSeq          int64             `json:"event_seq"  gorm:"primaryKey,priority:1"`
	Timestamp         uint64            `json:"timestamp"`
	PackageID         string            `json:"package_id"`
	TransactionModule string            `json:"transaction_module"`
	Sender            types.Address     `json:"sender"`
	Recipient         types.ObjectOwner `json:"recipient" gorm:"serializer:json"`
	ObjectType        string            `json:"object_type"`
	ObjectID          string            `json:"object_id"`
	Version           int64             `json:"version"`
}

func (*NewObjectEvent) TableName

func (*NewObjectEvent) TableName() string

type PublishEvent

type PublishEvent struct {
	TransactionDigest string        `json:"tx_digest" gorm:"primaryKey,priority:2"`
	EventSeq          int64         `json:"event_seq"  gorm:"primaryKey,priority:1"`
	Timestamp         uint64        `json:"timestamp"`
	Sender            types.Address `json:"sender"`
	PackageID         string        `json:"package_id"`
	Version           int64         `json:"version"`
	Digest            string        `json:"digest"`
}

func (*PublishEvent) TableName

func (*PublishEvent) TableName() string

type Rule

type Rule struct {
	ID        uint            `json:"id" gorm:"index"`
	Address   types.Address   `json:"address" gorm:"primaryKey,priority:3,index"`
	Event     types.EventType `json:"event" gorm:"primaryKey,priority:2"`
	UserID    uint            `json:"user_id" gorm:"primaryKey,autoIncrement:false,priority:1,index"`
	User      User            `json:"-"`
	Condition string          `json:"condition"`
	CreatedAt time.Time       `json:"created_at"`
	UpdatedAt time.Time       `json:"updated_at"`
}

func (*Rule) AfterCreate

func (r *Rule) AfterCreate(tx *gorm.DB) (err error)

func (*Rule) AfterDelete

func (r *Rule) AfterDelete(tx *gorm.DB) (err error)

func (*Rule) BuildGRL

func (r *Rule) BuildGRL() ([]byte, error)

func (*Rule) TableName

func (*Rule) TableName() string

type TransferObjectEvent

type TransferObjectEvent struct {
	TransactionDigest string            `json:"tx_digest" gorm:"primaryKey,priority:2"`
	EventSeq          int64             `json:"event_seq"  gorm:"primaryKey,priority:1"`
	Timestamp         uint64            `json:"timestamp"`
	PackageID         string            `json:"package_id"`
	TransactionModule string            `json:"transaction_module"`
	Sender            types.Address     `json:"sender"`
	Recipient         types.ObjectOwner `json:"recipient" gorm:"serializer:json"`
	ObjectType        string            `json:"object_type"`
	ObjectID          string            `json:"object_id"`
	Version           int64             `json:"version"`
}

func (*TransferObjectEvent) TableName

func (*TransferObjectEvent) TableName() string

type User

type User struct {
	ID           uint            `json:"id" gorm:"primaryKey"`
	Name         string          `json:"name"`
	DiscordID    *string         `json:"discord_id" gorm:"index"`
	DiscordInfo  *discordgo.User `json:"discord_info" gorm:"serializer:json"`
	TelegramID   *int64          `json:"telegram_id" gorm:"index"`
	TelegramInfo *telebot.User   `json:"telegram_info" gorm:"serializer:json"`
	RuleCount    int             `json:"rule_count" gorm:"not null"`
	CreatedAt    time.Time       `json:"created_at"`
	UpdatedAt    time.Time       `json:"updated_at"`
}

func (*User) TableName

func (*User) TableName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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