eventlog

package
v1.0.0-rc.10 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 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

View Source
const DefaultDrainTimeout = 5 * time.Second
View Source
const HopEnvVar = "CONTENOX_EVENT_HOP"

Variables

This section is empty.

Functions

func InheritHop

func InheritHop(ctx context.Context) context.Context

func IsPattern

func IsPattern(p string) bool

func MatchesType

func MatchesType(pattern, typeName string) bool

func SpawnEnv

func SpawnEnv(ctx context.Context) map[string]string

Types

type DualPublisher

type DualPublisher struct {
	// contains filtered or unexported fields
}

func NewDualPublisher

func NewDualPublisher(log runtimetypes.EventStore, next Publisher, source, workspaceID string, tracker libtracker.ActivityTracker, opts ...DualPublisherOption) *DualPublisher

func (*DualPublisher) Publish

func (p *DualPublisher) Publish(ctx context.Context, subject string, data []byte) error

type DualPublisherOption

type DualPublisherOption func(*DualPublisher)

func WithPublisherTrigger

func WithPublisherTrigger(t Trigger) DualPublisherOption

func WithSubjectField

func WithSubjectField(field string) DualPublisherOption

type NoopTrigger

type NoopTrigger struct{}

func (NoopTrigger) HandleEvent

func (NoopTrigger) HandleEvent(context.Context, ...*runtimetypes.Event)

type Publisher

type Publisher interface {
	Publish(ctx context.Context, subject string, data []byte) error
}

type Service

type Service interface {
	Append(ctx context.Context, event *runtimetypes.Event) error
	AppendBatch(ctx context.Context, events []*runtimetypes.Event) error
	ListEventsSince(ctx context.Context, workspaceID string, afterNID int64, limit int) ([]runtimetypes.Event, error)
	ListRecentEvents(ctx context.Context, workspaceID string, beforeNID int64, limit int, filter ...runtimetypes.EventQuery) ([]runtimetypes.Event, error)
	GetEventsByType(ctx context.Context, workspaceID, eventType string, from, to time.Time, limit int) ([]runtimetypes.Event, error)
	GetEventsBySource(ctx context.Context, workspaceID, eventType string, from, to time.Time, eventSource string, limit int) ([]runtimetypes.Event, error)
	GetEventsBySubject(ctx context.Context, workspaceID, eventType string, from, to time.Time, subject string, limit int) ([]runtimetypes.Event, error)
	GetEventTypesInRange(ctx context.Context, workspaceID string, from, to time.Time, limit int) ([]string, error)
	DeleteEventsByTypeInRange(ctx context.Context, workspaceID, eventType string, from, to time.Time) error

	PrunePartitionsBefore(ctx context.Context, t time.Time) ([]string, error)

	Subscribe(ctx context.Context, eventType string, ch chan<- []byte) (libbus.Subscription, error)
}

func NewService

func NewService(db libdb.DBManager, bus libbus.Messenger, tracker libtracker.ActivityTracker, opts ...ServiceOption) Service

type ServiceOption

type ServiceOption func(*service)

func WithTrigger

func WithTrigger(t Trigger) ServiceOption

type Trigger

type Trigger interface {
	HandleEvent(ctx context.Context, events ...*runtimetypes.Event)
}

type TriggerHolder

type TriggerHolder struct {
	// contains filtered or unexported fields
}

func NewTriggerHolder

func NewTriggerHolder() *TriggerHolder

func (*TriggerHolder) Drain

func (h *TriggerHolder) Drain(timeout time.Duration) bool

func (*TriggerHolder) HandleEvent

func (h *TriggerHolder) HandleEvent(ctx context.Context, events ...*runtimetypes.Event)

func (*TriggerHolder) Set

func (h *TriggerHolder) Set(t Trigger)

Jump to

Keyboard shortcuts

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