Documentation ¶
Index ¶
- Variables
- func RedisError(err error) string
- type ActorEvent
- type ClickhouseEventsLog
- func (r *ClickhouseEventsLog) Close() error
- func (r *ClickhouseEventsLog) GetEvents(eventType EventType, actorId string, level string, filter *EventsLogFilter, ...) ([]EventsLogRecord, error)
- func (r *ClickhouseEventsLog) PostAsync(event *ActorEvent)
- func (r *ClickhouseEventsLog) PostEvent(event *ActorEvent) (id EventsLogRecordId, err error)
- func (r *ClickhouseEventsLog) Start()
- type DummyEventsLogService
- func (d *DummyEventsLogService) Close() error
- func (d *DummyEventsLogService) GetEvents(eventType EventType, actorId string, level string, filter *EventsLogFilter, ...) ([]EventsLogRecord, error)
- func (d *DummyEventsLogService) PostAsync(_ *ActorEvent)
- func (d *DummyEventsLogService) PostEvent(_ *ActorEvent) (id EventsLogRecordId, err error)
- type EventStatus
- type EventType
- type EventsLogConfig
- type EventsLogFilter
- type EventsLogRecord
- type EventsLogRecordId
- type EventsLogService
- type Level
- type MultiEventsLogService
- func (m *MultiEventsLogService) Close() error
- func (m *MultiEventsLogService) GetEvents(eventType EventType, actorId string, level string, filter *EventsLogFilter, ...) ([]EventsLogRecord, error)
- func (m *MultiEventsLogService) PostAsync(event *ActorEvent)
- func (m *MultiEventsLogService) PostEvent(event *ActorEvent) (id EventsLogRecordId, err error)
- type RedisEventsLog
- func (r *RedisEventsLog) Close() error
- func (r *RedisEventsLog) GetEvents(eventType EventType, actorId string, level string, filter *EventsLogFilter, ...) ([]EventsLogRecord, error)
- func (r *RedisEventsLog) PostAsync(event *ActorEvent)
- func (r *RedisEventsLog) PostEvent(event *ActorEvent) (id EventsLogRecordId, err error)
- func (r *RedisEventsLog) Start()
Constants ¶
This section is empty.
Variables ¶
View Source
var (
EventsLogError = func(errorType string) prometheus.Counter {
return eventsLogError.WithLabelValues(errorType)
}
)
Functions ¶
func RedisError ¶
Types ¶
type ActorEvent ¶
type ClickhouseEventsLog ¶
type ClickhouseEventsLog struct { sync.Mutex appbase.Service // contains filtered or unexported fields }
func (*ClickhouseEventsLog) Close ¶
func (r *ClickhouseEventsLog) Close() error
func (*ClickhouseEventsLog) GetEvents ¶
func (r *ClickhouseEventsLog) GetEvents(eventType EventType, actorId string, level string, filter *EventsLogFilter, limit int) ([]EventsLogRecord, error)
func (*ClickhouseEventsLog) PostAsync ¶
func (r *ClickhouseEventsLog) PostAsync(event *ActorEvent)
func (*ClickhouseEventsLog) PostEvent ¶
func (r *ClickhouseEventsLog) PostEvent(event *ActorEvent) (id EventsLogRecordId, err error)
func (*ClickhouseEventsLog) Start ¶
func (r *ClickhouseEventsLog) Start()
type DummyEventsLogService ¶
type DummyEventsLogService struct{}
func (*DummyEventsLogService) Close ¶
func (d *DummyEventsLogService) Close() error
func (*DummyEventsLogService) GetEvents ¶
func (d *DummyEventsLogService) GetEvents(eventType EventType, actorId string, level string, filter *EventsLogFilter, limit int) ([]EventsLogRecord, error)
func (*DummyEventsLogService) PostAsync ¶
func (d *DummyEventsLogService) PostAsync(_ *ActorEvent)
func (*DummyEventsLogService) PostEvent ¶
func (d *DummyEventsLogService) PostEvent(_ *ActorEvent) (id EventsLogRecordId, err error)
type EventStatus ¶
type EventStatus string
type EventsLogConfig ¶
type EventsLogConfig struct { ClickhouseHost string `mapstructure:"CLICKHOUSE_HOST"` ClickhouseDatabase string `mapstructure:"CLICKHOUSE_DATABASE"` ClickhouseUsername string `mapstructure:"CLICKHOUSE_USERNAME"` ClickhousePassword string `mapstructure:"CLICKHOUSE_PASSWORD"` ClickhouseSSL bool `mapstructure:"CLICKHOUSE_SSL"` }
func (*EventsLogConfig) PostInit ¶
func (e *EventsLogConfig) PostInit(settings *appbase.AppSettings) error
type EventsLogFilter ¶
type EventsLogFilter struct { Start time.Time End time.Time BeforeId EventsLogRecordId Filter func(event any) bool }
func (*EventsLogFilter) GetStartAndEndIds ¶
func (f *EventsLogFilter) GetStartAndEndIds() (start, end string, err error)
GetStartAndEndIds returns end and start ids for the stream
type EventsLogRecord ¶
type EventsLogRecord struct { Id EventsLogRecordId `json:"id"` Date time.Time `json:"date"` Content any `json:"content"` }
type EventsLogRecordId ¶
type EventsLogRecordId string
type EventsLogService ¶
type EventsLogService interface { io.Closer // PostEvent posts event to the events log // actorId – id of entity of event origin. E.g. for 'incoming' event - id of site, for 'processed' event - id of destination PostEvent(event *ActorEvent) (id EventsLogRecordId, err error) PostAsync(event *ActorEvent) GetEvents(eventType EventType, actorId string, level string, filter *EventsLogFilter, limit int) ([]EventsLogRecord, error) }
func NewClickhouseEventsLog ¶
func NewClickhouseEventsLog(config EventsLogConfig) (EventsLogService, error)
func NewRedisEventsLog ¶
func NewRedisEventsLog(redisUrl, redisTLSCA string, maxLogSize int) (EventsLogService, error)
type MultiEventsLogService ¶
type MultiEventsLogService struct {
Services []EventsLogService
}
func (*MultiEventsLogService) Close ¶
func (m *MultiEventsLogService) Close() error
func (*MultiEventsLogService) GetEvents ¶
func (m *MultiEventsLogService) GetEvents(eventType EventType, actorId string, level string, filter *EventsLogFilter, limit int) ([]EventsLogRecord, error)
func (*MultiEventsLogService) PostAsync ¶
func (m *MultiEventsLogService) PostAsync(event *ActorEvent)
func (*MultiEventsLogService) PostEvent ¶
func (m *MultiEventsLogService) PostEvent(event *ActorEvent) (id EventsLogRecordId, err error)
type RedisEventsLog ¶
func (*RedisEventsLog) Close ¶
func (r *RedisEventsLog) Close() error
func (*RedisEventsLog) GetEvents ¶
func (r *RedisEventsLog) GetEvents(eventType EventType, actorId string, level string, filter *EventsLogFilter, limit int) ([]EventsLogRecord, error)
func (*RedisEventsLog) PostAsync ¶
func (r *RedisEventsLog) PostAsync(event *ActorEvent)
func (*RedisEventsLog) PostEvent ¶
func (r *RedisEventsLog) PostEvent(event *ActorEvent) (id EventsLogRecordId, err error)
func (*RedisEventsLog) Start ¶
func (r *RedisEventsLog) Start()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.