query

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: LGPL-2.1 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EventExist

func EventExist(ePath *entities.EventPath) bool

func GetAccountSubscriptions

func GetAccountSubscriptions(account string)

func GetConfig

func GetConfig(key string) (*models.Config, error)

func GetDependentEvents

func GetDependentEvents(event entities.Event) (*[]entities.Event, error)

func GetEventFromPath

func GetEventFromPath(ePath *entities.EventPath) (*entities.Event, error)

func GetMany

func GetMany[T any, U any](item T, data *U, order *map[string]Order) error

func GetManyAuthorizationEvents

func GetManyAuthorizationEvents(event entities.Event) (*models.AuthorizationEvent, error)

func GetManyGroupBy

func GetManyGroupBy[T any, U any](item T, data *U, gb string) error

func GetManyTx

func GetManyTx[T any](item T) *gorm.DB

func GetOne

func GetOne[T any, U any](filter T, data *U) error

func GetOneAuthorizationEvent

func GetOneAuthorizationEvent(event entities.Event) (*models.AuthorizationEvent, error)

func GetOneAuthorizationState

func GetOneAuthorizationState(auth entities.Authorization) (*models.AuthorizationState, error)

func GetTableName

func GetTableName(table any) string

func GetTx

func GetTx() *gorm.DB

func GetWithIN

func GetWithIN[T any, U any, I any](item T, data *U, slice I) error

func IncrementBlockStat

func IncrementBlockStat(blockNumber uint64, eventType *constants.EventType) (model *models.BlockStat, created bool, err error)

EventCount uint64 `json:"ec"` MessageCount uint64 `json:"mc"` TopicCount uint64 `json:"tc"` AuthorizationCount uint64 `json:"ac"` Cycle uint64 `json:"cy"` Volume uint64 `json:"vol"`

func SaveAuthorizationEvent

func SaveAuthorizationEvent(event *entities.Event, update bool, DB *gorm.DB) (model *models.AuthorizationEvent, created bool, err error)

func SaveAuthorizationState

func SaveAuthorizationState(auth *entities.Authorization, DB *gorm.DB) (*models.AuthorizationState, error)

Save authorization only when it doesnt exist

func SaveAuthorizationStateAndEvent

func SaveAuthorizationStateAndEvent(authEvent *entities.Event, tx *gorm.DB) (*models.AuthorizationState, *models.AuthorizationEvent, error)

func SaveRecord

func SaveRecord[Model any](where Model, data Model, update bool, DB *gorm.DB) (model *Model, created bool, err error)

func SaveRecordWithMap

func SaveRecordWithMap[Model any](model *Model, where map[string]interface{}, data map[string]interface{}, update bool, DB *gorm.DB) (created bool, err error)

func SetConfig

func SetConfig(key string, value string) (*models.Config, error)

func UpdateAuthorizationEvent

func UpdateAuthorizationEvent(where entities.Event, updateFields entities.Event, DB *gorm.DB) (model *models.AuthorizationEvent, err error)

func UpdateSubnetState

func UpdateSubnetState(Subnet *entities.Subnet, DB *gorm.DB) (*models.SubnetState, error)

Save Subnet state only when it doesnt exist

func UpdateTopicState

func UpdateTopicState(topic *entities.Topic, DB *gorm.DB) (*models.TopicState, error)

Save topic state only when it doesnt exist

Types

type Order

type Order string
const (
	OrderDec Order = "desc"
	OrderAsc Order = "asc"
)

type Result

type Result struct {
	models.SubscriptionState
	Block uint
}

func GetSubscriptionsByBlock

func GetSubscriptionsByBlock(subState entities.Subscription, from uint, to uint, block bool) ([]Result, error)

Jump to

Keyboard shortcuts

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