events

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package events provides primitives to interact with the openapi HTTP API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreatedAt

type CreatedAt = time.Time

CreatedAt Timestamp when the resource was created.

type DeletedAt

type DeletedAt = time.Time

DeletedAt Timestamp when the resource was deleted.

type Event

type Event struct {
	// ActedUpon UUID of the entity on which the event was performed.
	ActedUpon core.Uuid `db:"acted_upon" json:"actedUpon"`

	// Action Action taken on the resource.
	Action string `db:"action" json:"action"`

	// Category Resource name on which the operation is invoked.
	Category string `db:"category" json:"category"`

	// CreatedAt Timestamp when the resource was created.
	CreatedAt CreatedAt `db:"created_at" json:"createdAt"`

	// DeletedAt Timestamp when the resource was deleted.
	DeletedAt *DeletedAt `db:"deleted_at" json:"deletedAt,omitempty"`

	// Description A summary/receipt of event that occurred.
	Description string `db:"description" json:"description"`
	ID          ID     `db:"id" json:"id"`

	// Metadata Contains meaningful information, specific to the type of event.
	// Structure of metadata can be different for different events.
	Metadata    map[string]interface{} `db:"metadata" json:"metadata" gorm:"type:bytes;serializer:json"`
	OperationID OperationID            `db:"operation_id" json:"operationId"`

	// Severity A set of seven standard event levels.
	Severity EventSeverity `db:"severity" json:"severity"`

	// Status Status for the event.
	Status   EventStatus `db:"status" json:"status"`
	SystemID SystemID    `db:"system_id" json:"systemId"`

	// UpdatedAt Timestamp when the resource was updated.
	UpdatedAt UpdatedAt `db:"updated_at" json:"updatedAt"`
	UserID    *UserID   `db:"user_id" json:"userId,omitempty"`
}

Event Defines model for event_trackers

func DesignDownloadEvent added in v0.8.46

func DesignDownloadEvent(designID core.Uuid, designName string, userID core.Uuid, systemID core.Uuid) *Event

func DesignViewEvent added in v0.8.46

func DesignViewEvent(designID core.Uuid, designName string, userID core.Uuid, systemID core.Uuid) *Event

func (*Event) BeforeCreate

func (e *Event) BeforeCreate(tx *gorm.DB) (err error)

func (*Event) BeforeUpdate

func (e *Event) BeforeUpdate(tc *gorm.DB) (err error)

type EventBuilder

type EventBuilder struct {
	// contains filtered or unexported fields
}

func NewEvent

func NewEvent() *EventBuilder

func (*EventBuilder) ActedUpon

func (e *EventBuilder) ActedUpon(resource core.Uuid) *EventBuilder

func (*EventBuilder) Build

func (e *EventBuilder) Build() *Event

func (*EventBuilder) FromSystem

func (e *EventBuilder) FromSystem(id core.Uuid) *EventBuilder

func (*EventBuilder) FromUser

func (e *EventBuilder) FromUser(id core.Uuid) *EventBuilder

func (*EventBuilder) WithAction

func (e *EventBuilder) WithAction(eventAction string) *EventBuilder

func (*EventBuilder) WithCategory

func (e *EventBuilder) WithCategory(eventCategory string) *EventBuilder

func (*EventBuilder) WithDescription

func (e *EventBuilder) WithDescription(description string) *EventBuilder

func (*EventBuilder) WithMetadata

func (e *EventBuilder) WithMetadata(metadata map[string]interface{}) *EventBuilder

func (*EventBuilder) WithSeverity

func (e *EventBuilder) WithSeverity(severity EventSeverity) *EventBuilder

func (*EventBuilder) WithStatus

func (e *EventBuilder) WithStatus(status EventStatus) *EventBuilder

type EventSeverity

type EventSeverity string

EventSeverity A set of seven standard event levels.

const (
	Alert         EventSeverity = "alert"
	Critical      EventSeverity = "critical"
	Debug         EventSeverity = "debug"
	Emergency     EventSeverity = "emergency"
	Error         EventSeverity = "error"
	Informational EventSeverity = "informational"
	Warning       EventSeverity = "warning"
	Success       EventSeverity = "success"
)

Defines values for EventSeverity.

type EventStatus

type EventStatus string

EventStatus Status for the event.

const (
	Read   EventStatus = "read"
	Unread EventStatus = "unread"
)

Defines values for EventStatus.

type EventsFilter

type EventsFilter struct {
	Action   []string `json:"action"`
	Category []string `json:"category"`
	Limit    int      `json:"limit"`
	Offset   int      `json:"offset"`

	// Order order of sort asc/desc, default is asc
	Order    string      `json:"order"`
	Provider []string    `json:"provider"`
	Search   string      `json:"search"`
	Status   EventStatus `json:"status"`
	Severity []string    `json:"severity"`
	// SortOn Field on which records are sorted
	SortOn string `json:"sortOn"`

	// ActedUpon UUID of the entity on which the event was performed.
	ActedUpon []string `json:"actedUpon"`

	// UserID UUIDs of users to filter events by.
	UserID []string `json:"userId"`

	// SystemID UUIDs of systems to filter events by.
	SystemID []string `json:"systemId"`
}

EventsFilter defines model for events_filter.

type ID

type ID = core.Uuid

ID defines model for id.

type OperationID

type OperationID = core.Uuid

OperationID defines model for operation_id.

type SystemID

type SystemID = core.Uuid

SystemID defines model for system_id.

type Time

type Time = time.Time

Time defines model for time.

type UpdatedAt

type UpdatedAt = time.Time

UpdatedAt Timestamp when the resource was updated.

type UserID

type UserID = core.Uuid

UserID defines model for user_uuid.

Jump to

Keyboard shortcuts

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