beacon

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditLogEvent

type AuditLogEvent struct {
	UserId      repos.ID          `json:"userId" bson:"userId"`
	Email       string            `json:"email" bson:"email"`
	Action      string            `json:"action" bson:"action"`
	Description string            `json:"description" bson:"description"`
	Tags        map[string]string `json:"tags" bson:"tags"`
	Target      EventTarget       `json:"target" bson:"target"`
	When        time.Time         `json:"when" bson:"when"`
}

AuditLogEvent represents who did what and when

type Beacon

type Beacon interface {
	TriggerEvent(ctx context.Context, accountId repos.ID, event *AuditLogEvent) error
	TriggerWithUserCtx(ctx context.Context, accountId repos.ID, act EventAction) error
}

func NewBeacon

func NewBeacon(producer messaging.Producer, topic string) Beacon

type EventAction

type EventAction struct {
	Action       constants.Action       `json:"action" bson:"action"`
	Status       Status                 `json:"status" bson:"status"`
	ResourceType constants.ResourceType `json:"resourceType" bson:"resourceType"`
	ResourceId   repos.ID               `json:"resourceId" bson:"resourceId"`
	Tags         map[string]string      `json:"tags" bson:"tags"`
}

type EventTarget

type EventTarget struct {
	ResourceType constants.ResourceType `json:"resourceType" bson:"resourceType"`
	ResourceId   repos.ID               `json:"resourceId" bson:"resourceId"`
}

type Status

type Status struct {
	Value   string `json:"value" bson:"value"`
	Message string `json:"message" bson:"message"`
}

func StatusError

func StatusError(err error) Status

func StatusOK

func StatusOK() Status

Jump to

Keyboard shortcuts

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