Documentation ¶
Index ¶
- Constants
- Variables
- func CopyN(w io.Writer, r io.Reader, h io.Writer, size uint64, buffer []byte) error
- func NewDefaultLogger() *defaultLogger
- func NewLogUploader(ctx context.Context, endpoint string) (*logUploader, error)
- func NewRawSegment() *rawSegment
- type BackOffFunc
- type Config
- type Content
- type DefaultWorker
- type IndexEntry
- func (ie IndexEntry) Checksum() uint32
- func (ie IndexEntry) EventID() uuid.UUID
- func (ie IndexEntry) LSN() uint64
- func (ie IndexEntry) Offset() uint64
- func (ie *IndexEntry) ReadFrom(r io.Reader) (int, error)
- func (ie *IndexEntry) SetChecksum(checksum uint32)
- func (ie *IndexEntry) SetEventID(eventID uuid.UUID)
- func (ie *IndexEntry) SetLSN(lsn uint64)
- func (ie *IndexEntry) SetOffset(offset uint64)
- func (ie *IndexEntry) SetSize(size uint64)
- func (ie *IndexEntry) SetTimestamp(value uint64)
- func (ie IndexEntry) Size() uint64
- func (ie IndexEntry) Timestamp() uint64
- func (ie IndexEntry) WriteTo(w io.Writer) (int, error)
- type LogCloser
- type Logger
- type Message
- type Metadata
- type NullLogCloser
- type OptionFunc
- func DefaultEnvironment() OptionFunc
- func WithBackOff(fn BackOffFunc) OptionFunc
- func WithCloser(closer io.Closer) OptionFunc
- func WithConsumeTimeout(s string) (OptionFunc, error)
- func WithLogger(l Logger) (OptionFunc, error)
- func WithMaxIntake(num string) OptionFunc
- func WithName(s string) OptionFunc
- func WithRavenURL(urlStr string) (OptionFunc, error)
- func WithSubscription(s string) OptionFunc
- func WithTopicIn(s string) OptionFunc
- func WithTopicOut(s string) OptionFunc
- type Producer
- type Reference
- type Segment
- type SegmentCloser
- type SegmentHeaderer
- type SegmentReader
- type SegmentWriter
- type Subscriber
- type Worker
Constants ¶
const ITEM_CAPACITY = 10000
const ITEM_SIZE = 2048
Variables ¶
var DefaultLogger = NewDefaultLogger()
var (
ErrChecksumFailed = errors.New("Checksum failed")
)
Functions ¶
func NewDefaultLogger ¶ added in v0.2.3
func NewDefaultLogger() *defaultLogger
NewDefaultLogger creates a JSON logger which outputs to an http endpoint. provide an empty string as endpoint to log to stdout.
func NewLogUploader ¶ added in v0.2.3
func NewRawSegment ¶ added in v0.2.7
func NewRawSegment() *rawSegment
Types ¶
type BackOffFunc ¶ added in v0.2.2
type BackOffFunc func() backoff.BackOff
type Content ¶ added in v0.2.2
type Content []byte
func JsonContent ¶ added in v0.2.2
func JsonContent(v interface{}) Content
func StringContent ¶ added in v0.2.2
type DefaultWorker ¶ added in v0.2.2
type DefaultWorker struct {
Config
}
func (*DefaultWorker) Close ¶ added in v0.2.3
func (w *DefaultWorker) Close() error
type IndexEntry ¶ added in v0.2.7
type IndexEntry [64]byte
we could use protobuf here, but we don't want to unmarshal, reflect bytes
func (IndexEntry) Checksum ¶ added in v0.2.7
func (ie IndexEntry) Checksum() uint32
func (IndexEntry) EventID ¶ added in v0.2.7
func (ie IndexEntry) EventID() uuid.UUID
func (IndexEntry) LSN ¶ added in v0.2.7
func (ie IndexEntry) LSN() uint64
func (IndexEntry) Offset ¶ added in v0.2.7
func (ie IndexEntry) Offset() uint64
func (*IndexEntry) ReadFrom ¶ added in v0.2.7
func (ie *IndexEntry) ReadFrom(r io.Reader) (int, error)
func (*IndexEntry) SetChecksum ¶ added in v0.2.7
func (ie *IndexEntry) SetChecksum(checksum uint32)
func (*IndexEntry) SetEventID ¶ added in v0.2.7
func (ie *IndexEntry) SetEventID(eventID uuid.UUID)
func (*IndexEntry) SetLSN ¶ added in v0.2.7
func (ie *IndexEntry) SetLSN(lsn uint64)
func (*IndexEntry) SetOffset ¶ added in v0.2.7
func (ie *IndexEntry) SetOffset(offset uint64)
func (*IndexEntry) SetSize ¶ added in v0.2.7
func (ie *IndexEntry) SetSize(size uint64)
func (*IndexEntry) SetTimestamp ¶ added in v0.2.7
func (ie *IndexEntry) SetTimestamp(value uint64)
func (IndexEntry) Timestamp ¶ added in v0.2.7
func (ie IndexEntry) Timestamp() uint64
type Message ¶
func NewMessage ¶ added in v0.2.2
func NewMessage() Message
NewMessage will return a new empty Message struct
message := NewMessage()
func (Message) MarshalJSON ¶ added in v0.2.2
func (*Message) UnmarshalJSON ¶ added in v0.2.2
type NullLogCloser ¶ added in v0.2.3
type NullLogCloser struct { }
func (NullLogCloser) Close ¶ added in v0.2.3
func (NullLogCloser) Close() error
type OptionFunc ¶ added in v0.2.2
func DefaultEnvironment ¶ added in v0.2.2
func DefaultEnvironment() OptionFunc
DefaultEnvironment returns the optionFunc that expects 'RAVEN_URL', 'FLOW_ID' and 'WORKER_ID' as environmental variables 'CONSUME_TIMEOUT' will override the default if set. DefaultLogger is set as the logger.
func WithBackOff ¶ added in v0.2.2
func WithBackOff(fn BackOffFunc) OptionFunc
func WithCloser ¶ added in v0.2.3
func WithCloser(closer io.Closer) OptionFunc
WithCloser adds an 'io.Closer' to the list.
func WithConsumeTimeout ¶ added in v0.2.3
func WithConsumeTimeout(s string) (OptionFunc, error)
WithConsumeTimeout time frame to wait for a new message. not setting this equals wait forever.
func WithLogger ¶ added in v0.2.2
func WithLogger(l Logger) (OptionFunc, error)
func WithMaxIntake ¶ added in v0.2.3
func WithMaxIntake(num string) OptionFunc
WithMaxIntake ingest messages until maxIntake is reached.
func WithName ¶ added in v0.2.7
func WithName(s string) OptionFunc
func WithRavenURL ¶ added in v0.2.2
func WithRavenURL(urlStr string) (OptionFunc, error)
func WithSubscription ¶ added in v0.2.7
func WithSubscription(s string) OptionFunc
func WithTopicIn ¶ added in v0.2.7
func WithTopicIn(s string) OptionFunc
func WithTopicOut ¶ added in v0.2.7
func WithTopicOut(s string) OptionFunc
type Producer ¶ added in v0.2.7
func NewProducer ¶ added in v0.2.7
func NewProducer(opts ...OptionFunc) (Producer, error)
type Segment ¶ added in v0.2.7
type Segment interface { SegmentReader SegmentWriter SegmentCloser }
type SegmentCloser ¶ added in v0.2.7
type SegmentCloser interface {
Close()
}
type SegmentHeaderer ¶ added in v0.2.7
type SegmentHeaderer interface { Header() IndexEntry SetHeader(IndexEntry) }
are there other options? don't really like this
type SegmentReader ¶ added in v0.2.7
type SegmentWriter ¶ added in v0.2.7
type Subscriber ¶ added in v0.2.7
type Subscriber interface { Consume(context.Context, Segment) error Ack(Segment) error Close() error }
todo: reconnect on fail, continue deliver on non acked. have something like a adjust or delta for acks? as it will build a new conenction or should it sync within the connection, current segmentid?
func NewSubscriber ¶ added in v0.2.7
func NewSubscriber(opts ...OptionFunc) (Subscriber, error)