eventdriver

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: GPL-3.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = config.GetConfig().Events
View Source
var Driver = new(Events)
View Source
var Tracer = otel.Tracer("eventsdriver")

Functions

This section is empty.

Types

type Event

type Event struct {
	ID            string            `gorm:"primaryKey" json:"id" example:"0d2dab7cdcb4cf1d"` // Pod ID
	CreatedAt     time.Time         `swaggerignore:"true" json:"createdAt,omitempty"`
	UpdatedAt     time.Time         `swaggerignore:"true" json:"updatedAt,omitempty"`
	TransactionID string            `gorm:"index" json:"transactionId" example:"0d2dab7cdcb4cf1d"`
	ParentID      string            `gorm:"index" swaggerignore:"true" json:"parentId"`
	ParentType    EventParentType   `gorm:"index" swaggerignore:"true" json:"parentType"`
	Tenant        string            `gorm:"index" swaggerignore:"true" json:"tenant"`
	Attributes    EventAttributes   `gorm:"embedded;embeddedPrefix:attributes_" json:"attributes"`
	Message       string            `json:"message"`
	Data          datatypes.JSONMap `swaggerignore:"true" json:"data"`
}

type EventAttributes

type EventAttributes struct {
	Source string    `gorm:"index" example:"sview-hook" json:"source"`
	Type   string    `gorm:"index" example:"gitlab-mr" json:"type"`
	Date   time.Time `gorm:"index" example:"2022-02-28 18:03:49.750647+00" json:"date"`
	Author string    `gorm:"index" example:"john.doe" json:"author"`
}

func (*EventAttributes) UnmarshalJSON

func (a *EventAttributes) UnmarshalJSON(data []byte) error

type EventParentType

type EventParentType string
const (
	EventParentApplication EventParentType = "application"
	EventParentParameter   EventParentType = "parameter"
	EventParentSystem      EventParentType = "system"
	EventParentSecurity    EventParentType = "security"
)

type Events

type Events struct {
}

func GetDriver

func GetDriver() *Events

func (*Events) AccessRequestApproved

func (e *Events) AccessRequestApproved(ctx context.Context, data models.AccessRequest) error

func (*Events) AccessRequestCreated

func (e *Events) AccessRequestCreated(ctx context.Context, data models.AccessRequest) error

func (*Events) AccessRequestDeleted

func (e *Events) AccessRequestDeleted(ctx context.Context, data models.AccessRequest) error

func (*Events) AccessRequestExpired

func (e *Events) AccessRequestExpired(ctx context.Context, data models.AccessRequest) error

func (*Events) NewDriver

func (e *Events) NewDriver() *Events

Setup Initialize Kafka client

func (*Events) PermissionDenied

func (e *Events) PermissionDenied(ctx context.Context, sub string, grp []string, obj string, act string) error

func (*Events) UserLoggedIn

func (e *Events) UserLoggedIn(ctx context.Context, claims models.ClaimsMap) error

Jump to

Keyboard shortcuts

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