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: ? 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

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