query

package
v1.2.6 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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorNotFound = gorm.ErrRecordNotFound

Functions

func EventExist

func EventExist(ePath *entities.EventPath) bool

func GenerateImportScript added in v1.2.0

func GenerateImportScript[T any](db *gorm.DB, model T, where any, fileName string, cfg *configs.MainConfiguration) (string, error)

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 GetManyWithLimit added in v1.2.0

func GetManyWithLimit[T any, U any](item T, data *U, order *map[string]Order, limit int, offset int) error

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 GetOneState added in v1.2.0

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

func GetOneWithOr added in v1.2.0

func GetOneWithOr[T any, U any](where T, or T, data U) error

func GetStateFromPath added in v1.2.0

func GetStateFromPath(ePath *entities.EntityPath) (any, error)

func GetSubscriptionStateBySuscriber added in v1.2.0

func GetSubscriptionStateBySuscriber(subnet string, topic string, subscribers []entities.DIDString, DB *gorm.DB) (*[]models.SubscriptionState, error)

Save Subnet state only when it doesnt exist

func GetTableName

func GetTableName(table any) string

func GetTopic added in v1.2.0

func GetTopic(where models.TopicState) (*models.TopicState, error)

func GetTopicByHash added in v1.2.0

func GetTopicByHash(hash string) (*models.TopicState, error)

func GetTopicById added in v1.2.0

func GetTopicById(id string) (*models.TopicState, error)

func GetTopicEvents added in v1.2.0

func GetTopicEvents() (*[]models.TopicEvent, error)

func GetTopics added in v1.2.0

func GetTopics(subTopic entities.Topic) (*[]models.TopicState, error)

func GetTx

func GetTx() *gorm.DB

func GetWithIN

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

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, *gorm.DB)

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, createData *Model, updateData *Model, 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 SaveToFile added in v1.2.0

func SaveToFile(filename, data string) 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