Documentation ¶
Index ¶
- func SetEventReceiverGroupEnabled(tx *gorm.DB, id graphql.ID, enabled bool) error
- type Database
- type Event
- type EventReceiver
- func CreateEventReceiver(tx *gorm.DB, eventReceiver EventReceiver) (*EventReceiver, error)
- func EventReceiverFromJSON(reader io.Reader) (*EventReceiver, error)
- func FindEventReceiver(tx *gorm.DB, er map[string]any) ([]EventReceiver, error)
- func FindEventReceiverByID(tx *gorm.DB, id graphql.ID) ([]EventReceiver, error)
- type EventReceiverGroup
- func CreateEventReceiverGroup(tx *gorm.DB, eventReceiverGroup EventReceiverGroup) (*EventReceiverGroup, error)
- func EventReceiverGroupFromJSON(reader io.Reader) (*EventReceiverGroup, error)
- func FindEventReceiverGroup(tx *gorm.DB, erg map[string]any) ([]EventReceiverGroup, error)
- func FindEventReceiverGroupByID(tx *gorm.DB, id graphql.ID) ([]EventReceiverGroup, error)
- func FindTriggeredEventReceiverGroups(tx *gorm.DB, event Event) ([]EventReceiverGroup, error)
- type EventReceiverGroupToEventReceiver
- type TriggeredEventReceiverGroups
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Database ¶
func (*Database) SyncSchema ¶
type Event ¶
type Event struct { ID graphql.ID `json:"id" gorm:"type:varchar(255);primary_key;not null"` Name string `json:"name" gorm:"type:varchar(255);not null"` Version string `json:"version" gorm:"type:varchar(255);not null"` Release string `json:"release" gorm:"type:varchar(255);not null"` PlatformID string `json:"platform_id" gorm:"type:varchar(255);not null"` Package string `json:"package" gorm:"type:varchar(255);not null"` Description string `json:"description" gorm:"type:varchar(255);not null"` Payload types.JSON `json:"payload" gorm:"not null"` Success bool `json:"success" gorm:"not null"` CreatedAt types.Time `json:"created_at" gorm:"type:timestamptz; not null; default:CURRENT_TIMESTAMP"` EventReceiverID graphql.ID `json:"event_receiver_id" gorm:"type:varchar(255);not null"` EventReceiver EventReceiver }
Event type represents an event with various properties and a relationship to an event receiver.
func CreateEvent ¶
CreateEvent creates and event record in the database. Throws an error if the event receiver does not exist or if the event payload does not match the receiver schema.
func EventFromJSON ¶
EventFromJSON reads JSON data from a reader and returns an Event object.
type EventReceiver ¶
type EventReceiver struct { ID graphql.ID `json:"id" gorm:"type:varchar(255);primary_key;not null"` Name string `json:"name" gorm:"type:varchar(255);not null"` Type string `json:"type" gorm:"type:varchar(255);not null"` Version string `json:"version" gorm:"type:varchar(255);not null"` Description string `json:"description" gorm:"type:varchar(255);not null"` Schema types.JSON `json:"schema" gorm:"not null"` Fingerprint string `json:"fingerprint" gorm:"type:varchar(255);not null"` CreatedAt types.Time `json:"created_at" gorm:"type:timestamptz;not null;default:CURRENT_TIMESTAMP"` }
EventReceiver type represents an event receiver with various properties such as ID, name, type, version, etc...
func CreateEventReceiver ¶
func CreateEventReceiver(tx *gorm.DB, eventReceiver EventReceiver) (*EventReceiver, error)
func EventReceiverFromJSON ¶
func EventReceiverFromJSON(reader io.Reader) (*EventReceiver, error)
EventReceiverFromJSON reads JSON data from a reader and returns an EventReceiver object.
func FindEventReceiver ¶
FindEventReceiver tries to find an event receiver by matching fields
func FindEventReceiverByID ¶
func FindEventReceiverByID(tx *gorm.DB, id graphql.ID) ([]EventReceiver, error)
FindEventReceiverByID tries to find an event receiver by ID.
func (*EventReceiver) ToJSON ¶
func (e *EventReceiver) ToJSON() (string, error)
ToJSON() converts an instance of a JSON string representation.
func (*EventReceiver) ToYAML ¶
func (e *EventReceiver) ToYAML() (string, error)
ToYAML() converts struct to a YAML string representation.
type EventReceiverGroup ¶
type EventReceiverGroup struct { ID graphql.ID `json:"id" gorm:"type:varchar(255);primary_key;not null"` Name string `json:"name" gorm:"type:varchar(255);not null"` Type string `json:"type" gorm:"type:varchar(255);not null"` Version string `json:"version" gorm:"type:varchar(255);not null"` Description string `json:"description" gorm:"type:varchar(255);not null"` Enabled bool `json:"enabled" gorm:"not null"` EventReceiverIDs []graphql.ID `json:"event_receiver_ids" gorm:"-"` CreatedAt types.Time `json:"created_at" gorm:"type:timestamptz; not null; default:CURRENT_TIMESTAMP"` UpdatedAt types.Time `json:"updated_at" gorm:"type:timestamptz; not null; default:CURRENT_TIMESTAMP"` }
EventReceiverGroup represents a group of event receivers with various properties.
func CreateEventReceiverGroup ¶
func CreateEventReceiverGroup(tx *gorm.DB, eventReceiverGroup EventReceiverGroup) (*EventReceiverGroup, error)
func EventReceiverGroupFromJSON ¶
func EventReceiverGroupFromJSON(reader io.Reader) (*EventReceiverGroup, error)
EventReceiverGroupFromJSON reads JSON data from a reader and returns an EventReceiverGroup object.
func FindEventReceiverGroup ¶
func FindEventReceiverGroupByID ¶
func FindEventReceiverGroupByID(tx *gorm.DB, id graphql.ID) ([]EventReceiverGroup, error)
func FindTriggeredEventReceiverGroups ¶
func FindTriggeredEventReceiverGroups(tx *gorm.DB, event Event) ([]EventReceiverGroup, error)
func (*EventReceiverGroup) ToJSON ¶
func (e *EventReceiverGroup) ToJSON() (string, error)
ToJSON() converts struct to a JSON string representation.
func (*EventReceiverGroup) ToYAML ¶
func (e *EventReceiverGroup) ToYAML() (string, error)
ToYAML() converts struct to a YAML string representation.
type EventReceiverGroupToEventReceiver ¶
type EventReceiverGroupToEventReceiver struct { ID int `json:"id" gorm:"primaryKey;autoIncrement"` EventReceiverID graphql.ID `json:"event_receiver_id" gorm:"type:varchar(255);not null"` EventReceiver EventReceiver EventReceiverGroup EventReceiverGroup EventReceiverGroupID graphql.ID `json:"event_receiver_group_id" gorm:"type:varchar(255);not null"` }
EventReceiverGroupToEventReceiver represents the relationship between an
type TriggeredEventReceiverGroups ¶
type TriggeredEventReceiverGroups struct { EventReceiverGroup // Database returns json array instead of a string EventReceiverIDs types.JSON `json:"event_receiver_ids"` }
Data represents the EventReceiverGroup data that comes back from the mega query. It is necessary to allow us to automatically insert event_receiver_ids by overriding the json tag