events

package
v0.2.0-rc.25 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 10 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 (
	ErrNotFound             = xerror.NotFound(xerror.Event)
	ErrSlugTaken            = xerror.AlreadyExists(xerror.Event)
	ErrOrganizationNotFound = xerror.NotFound(xerror.Organization)
)

Functions

This section is empty.

Types

type CreateParams

type CreateParams struct {
	Slug          slug.Slug
	EventClass    model.EventClass
	ActorType     model.EventActorType
	ActorSlug     *slug.Slug
	EntityType    model.EventEntityType
	EntitySlug    *slug.Slug
	Action        model.EventAction
	OccurredAt    time.Time
	RequestID     *string
	SchemaVersion int32
	Metadata      json.RawMessage
}

type Event

type Event struct {
	Slug          slug.Slug
	EventClass    model.EventClass
	ActorType     model.EventActorType
	ActorSlug     *slug.Slug
	EntityType    model.EventEntityType
	EntitySlug    *slug.Slug
	Action        model.EventAction
	OccurredAt    time.Time
	RequestID     *string
	SchemaVersion int
	Metadata      json.RawMessage
	CreatedAt     time.Time
}

type ListFilters

type ListFilters struct {
	EventClass     *model.EventClass
	RequestID      *string
	OccurredFrom   *time.Time
	OccurredBefore *time.Time
	ActorType      *model.EventActorType
	ActorSlug      *slug.Slug
	EntityType     *model.EventEntityType
	EntitySlug     *slug.Slug
	Action         *model.EventAction
}

type Repository

type Repository interface {
	Create(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug slug.Slug,
		params *CreateParams,
	) (*Event, error)
	FindBySlug(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, eventSlug slug.Slug,
	) (*Event, error)
	ListByOrganization(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug slug.Slug,
		filters *ListFilters,
		req model.ListRequest,
	) ([]*Event, error)
	ListSourceRefsByOrganization(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug slug.Slug,
		filters SourceMetadataFilters,
		limit int,
	) ([]model.EventSourceRefOption, error)
	PruneOlderThan(
		ctx context.Context,
		tx postgres.DBTX,
		cutoff time.Time,
	) (int64, error)
}

func New

func New() Repository

type SourceMetadataFilters

type SourceMetadataFilters struct {
	SourceKind      *model.EventEntityType
	SourceAction    *model.EventAction
	ProjectSlug     *slug.Slug
	EnvironmentSlug *slug.Slug
}

Jump to

Keyboard shortcuts

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