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
}
Click to show internal directories.
Click to hide internal directories.