Documentation
¶
Index ¶
- Constants
- func InheritHop(ctx context.Context) context.Context
- func IsPattern(p string) bool
- func MatchesType(pattern, typeName string) bool
- func SpawnEnv(ctx context.Context) map[string]string
- type DualPublisher
- type DualPublisherOption
- type NoopTrigger
- type Publisher
- type Service
- type ServiceOption
- type Trigger
- type TriggerHolder
Constants ¶
View Source
const DefaultDrainTimeout = 5 * time.Second
View Source
const HopEnvVar = "CONTENOX_EVENT_HOP"
Variables ¶
This section is empty.
Functions ¶
func MatchesType ¶
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
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 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) HandleEvent ¶
func (h *TriggerHolder) HandleEvent(ctx context.Context, events ...*runtimetypes.Event)
func (*TriggerHolder) Set ¶
func (h *TriggerHolder) Set(t Trigger)
Click to show internal directories.
Click to hide internal directories.