events

package
v0.6.77 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

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

Code generated by github.com/deepmap/oapi-codegen version v1.13.4 DO NOT EDIT.

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 uuid.UUID `db:"acted_upon" json:"acted_upon"`

	// 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:"created_at"`

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

	// Description A summary/receipt of event that occured.
	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:"operation_id"`

	// 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:"system_id"`

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

Event Defines model for event_trackers

func (*Event) BeforeCreate added in v0.6.63

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

func (*Event) BeforeUpdate added in v0.6.65

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 uuid.UUID) *EventBuilder

func (*EventBuilder) Build

func (e *EventBuilder) Build() *Event

func (*EventBuilder) FromSystem

func (e *EventBuilder) FromSystem(id uuid.UUID) *EventBuilder

func (*EventBuilder) FromUser

func (e *EventBuilder) FromUser(id uuid.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 added in v0.6.63

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 added in v0.6.64

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:"sort_on"`
}

EventsFilter defines model for events_filter.

type ID

type ID = uuid.UUID

ID defines model for id.

type OperationID

type OperationID = uuid.UUID

OperationID defines model for operation_id.

type SystemID

type SystemID = uuid.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 = uuid.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