models

package
v1.2.12 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: LGPL-2.1 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func GetModelFromModelType added in v1.2.0

func GetModelFromModelType(modelType entities.EntityModel) any

Types

type AuthorizationEvent

type AuthorizationEvent struct {
	// Event `msgpack:",noinline"`
	entities.Event `msgpack:",noinline"`
	//IsValid   bool `gorm:"default:false" json:"isVal"`
	// EventType int16 `json:"t"`
	// Payload entities.ClientPayload  `json:"pld" gorm:"serializer:json" msgpack:",noinline"`
	BaseModel `msgpack:",noinline"`
}

func (AuthorizationEvent) TableName added in v1.2.0

func (AuthorizationEvent) TableName() string

type AuthorizationState

type AuthorizationState struct {
	entities.Authorization `msgpack:",noinline"`
	BaseModel
}

func (*AuthorizationState) BeforeCreate

func (d *AuthorizationState) BeforeCreate(tx *gorm.DB) (err error)

func (AuthorizationState) MsgPack added in v1.2.0

func (auth AuthorizationState) MsgPack() []byte

func (AuthorizationState) TableName added in v1.2.0

func (AuthorizationState) TableName() string

type BaseModel

type BaseModel struct {
	// ID string `gorm:"primaryKey" json:"id,omitempty"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

type BlockStat

type BlockStat struct {
	entities.Stats
	BaseModel
}

func (*BlockStat) BeforeCreate

func (t *BlockStat) BeforeCreate(tx *gorm.DB) (err error)

type Config

type Config struct {
	gorm.Model
	Key   string `gorm:"key;unique"`
	Value string `gorm:"value"`
}

type DeleteEvent

type DeleteEvent struct {
	entities.Event `msgpack:",noinline"`
	//IsValid   bool `gorm:"default:false" json:"isVal"`
	EventType int16 `json:"t"`
}

type EventCounter added in v1.2.0

type EventCounter struct {
	Id        uint `json:"id" gorm:"unique;primaryKey;autoIncrement"`
	Count     *uint64
	Cycle     *uint64                  `gorm:"uniqueIndex:idx_uniq_cyc_sub_val;"`
	Subnet    string                   `gorm:"uniqueIndex:idx_uniq_cyc_sub_val;"`
	Validator entities.PublicKeyString `gorm:"uniqueIndex:idx_uniq_cyc_sub_val;"`
	Claimed   *bool                    `gorm:"default:false;"`
}

type EventInterface

type EventInterface interface {
}

type MessageEvent

type MessageEvent struct {
	entities.Event
	BaseModel
}

type MessageState

type MessageState struct {
	entities.Message
	BaseModel
}

func (*MessageState) BeforeCreate

func (d *MessageState) BeforeCreate(tx *gorm.DB) (err error)

func (MessageState) MsgPack added in v1.2.0

func (d MessageState) MsgPack() []byte

type MigrationState

type MigrationState struct {
	Key string `gorm:"unique"`
	BaseModel
}

type SubnetEvent

type SubnetEvent struct {
	entities.Event
	BaseModel
}

type SubnetState

type SubnetState struct {
	entities.Subnet
	BaseModel
}

func (*SubnetState) BeforeCreate

func (d *SubnetState) BeforeCreate(tx *gorm.DB) (err error)

func (SubnetState) MsgPack added in v1.2.0

func (d SubnetState) MsgPack() []byte

type SubscriptionEvent

type SubscriptionEvent struct {
	BaseModel `msgpack:",noinline"`
	// Event `msgpack:",noinline"`
	entities.Event `msgpack:",noinline"`
	Status         string `gorm:"index" json:"st"`
}

type SubscriptionState

type SubscriptionState struct {
	BaseModel             `msgpack:",noinline"`
	entities.Subscription `msgpack:",noinline"`
}

func (*SubscriptionState) BeforeCreate

func (d *SubscriptionState) BeforeCreate(tx *gorm.DB) (err error)

func (SubscriptionState) MsgPack added in v1.2.0

func (d SubscriptionState) MsgPack() []byte

type TopicEvent

type TopicEvent struct {
	entities.Event
	BaseModel
}

type TopicState

type TopicState struct {
	entities.Topic
	BaseModel
}

func (*TopicState) BeforeCreate

func (d *TopicState) BeforeCreate(tx *gorm.DB) (err error)

func (TopicState) MsgPack added in v1.2.0

func (d TopicState) MsgPack() []byte

type WalletEvent

type WalletEvent struct {
	entities.Event
	BaseModel
}

type WalletState

type WalletState struct {
	entities.Wallet
	BaseModel
}

func (*WalletState) BeforeCreate

func (d *WalletState) BeforeCreate(tx *gorm.DB) (err error)

func (WalletState) MsgPack added in v1.2.0

func (d WalletState) MsgPack() []byte

Jump to

Keyboard shortcuts

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