Documentation ¶
Index ¶
Constants ¶
View Source
const ( MagicHI uint8 = 0xAA MagicLO uint8 = 0x55 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Event ¶
type Event struct { Type uint32 `json:"type"` Timestamp int64 `json:"ts"` Data []byte `json:"data"` LogID string `json:"log_id"` Offset int64 `json:"offset"` }
func (Event) IntoProto ¶
func (e Event) IntoProto() *proto.FetchEventsResponse
type EventManager ¶
type EventManager interface { EventPusher EventSubscriber control.ServiceController }
type EventPusher ¶
type EventSubscriber ¶
type EventSubscriber interface {
Subscribe(ctx context.Context, opts SubscriptionOpts) (*Subscription, error)
}
type StorageConfig ¶
type StorageConfig struct { // path to a log dir Dir string `json:"dir"` // number of files to maintain MaxFiles int `json:"max_files"` // for how long we want to write to a single logfile Period time.Duration `json:"period"` // how many bytes we want to write to a single logfile Size int64 `json:"size"` }
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
func (*Subscription) Close ¶
func (s *Subscription) Close() <-chan struct{}
Close the subscriber. Might be called multiple times.
func (*Subscription) Errors ¶
func (s *Subscription) Errors() <-chan error
func (*Subscription) Events ¶
func (s *Subscription) Events() <-chan Event
type SubscriptionOpts ¶
SubscriptionOpts describe where we want to start reading the log. Zero offset means the beginning of the file. Empty logID means the beginning of the whole journal.
Click to show internal directories.
Click to hide internal directories.