events

package
v0.0.0-...-5106b98 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

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