Documentation ¶
Index ¶
- Variables
- func RequestHandler(path string, w http.ResponseWriter, r *http.Request) bool
- type Entry
- type EntryAdapter
- func (this *EntryAdapter) Equal(that interface{}) bool
- func (m *EntryAdapter) GetLine() string
- func (m *EntryAdapter) GetTimestamp() time.Time
- func (this *EntryAdapter) GoString() string
- func (m *EntryAdapter) Marshal() (dAtA []byte, err error)
- func (m *EntryAdapter) MarshalTo(dAtA []byte) (int, error)
- func (m *EntryAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m *EntryAdapter) Reset()
- func (m *EntryAdapter) Size() (n int)
- func (this *EntryAdapter) String() string
- func (m *EntryAdapter) Unmarshal(dAtA []byte) error
- type PushRequest
- func (this *PushRequest) Equal(that interface{}) bool
- func (this *PushRequest) GoString() string
- func (m *PushRequest) Marshal() (dAtA []byte, err error)
- func (m *PushRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *PushRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m *PushRequest) Reset()
- func (m *PushRequest) Size() (n int)
- func (this *PushRequest) String() string
- func (m *PushRequest) Unmarshal(dAtA []byte) error
- type PushResponse
- func (this *PushResponse) Equal(that interface{}) bool
- func (this *PushResponse) GoString() string
- func (m *PushResponse) Marshal() (dAtA []byte, err error)
- func (m *PushResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *PushResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m *PushResponse) Reset()
- func (m *PushResponse) Size() (n int)
- func (this *PushResponse) String() string
- func (m *PushResponse) Unmarshal(dAtA []byte) error
- type Stream
- type StreamAdapter
- func (this *StreamAdapter) Equal(that interface{}) bool
- func (m *StreamAdapter) GetEntries() []EntryAdapter
- func (m *StreamAdapter) GetHash() uint64
- func (m *StreamAdapter) GetLabels() string
- func (this *StreamAdapter) GoString() string
- func (m *StreamAdapter) Marshal() (dAtA []byte, err error)
- func (m *StreamAdapter) MarshalTo(dAtA []byte) (int, error)
- func (m *StreamAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m *StreamAdapter) Reset()
- func (m *StreamAdapter) Size() (n int)
- func (this *StreamAdapter) String() string
- func (m *StreamAdapter) Unmarshal(dAtA []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLengthPush = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowPush = fmt.Errorf("proto: integer overflow") )
Functions ¶
func RequestHandler ¶
RequestHandler processes Loki insert requests
See https://grafana.com/docs/loki/latest/api/#push-log-entries-to-loki
Types ¶
type Entry ¶
type Entry struct { Timestamp time.Time `protobuf:"bytes,1,opt,name=timestamp,proto3,stdtime" json:"ts"` Line string `protobuf:"bytes,2,opt,name=line,proto3" json:"line"` }
Entry is a log entry with a timestamp.
func (*Entry) MarshalToSizedBuffer ¶
MarshalToSizedBuffer marshals m to the sized buffer.
type EntryAdapter ¶
type EntryAdapter struct { Timestamp time.Time `protobuf:"bytes,1,opt,name=timestamp,proto3,stdtime" json:"ts"` Line string `protobuf:"bytes,2,opt,name=line,proto3" json:"line"` }
func (*EntryAdapter) Equal ¶
func (this *EntryAdapter) Equal(that interface{}) bool
func (*EntryAdapter) GetLine ¶
func (m *EntryAdapter) GetLine() string
func (*EntryAdapter) GetTimestamp ¶
func (m *EntryAdapter) GetTimestamp() time.Time
func (*EntryAdapter) GoString ¶
func (this *EntryAdapter) GoString() string
func (*EntryAdapter) Marshal ¶
func (m *EntryAdapter) Marshal() (dAtA []byte, err error)
func (*EntryAdapter) MarshalToSizedBuffer ¶
func (m *EntryAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*EntryAdapter) Reset ¶
func (m *EntryAdapter) Reset()
func (*EntryAdapter) Size ¶
func (m *EntryAdapter) Size() (n int)
func (*EntryAdapter) String ¶
func (this *EntryAdapter) String() string
func (*EntryAdapter) Unmarshal ¶
func (m *EntryAdapter) Unmarshal(dAtA []byte) error
type PushRequest ¶
type PushRequest struct {
Streams []Stream `protobuf:"bytes,1,rep,name=streams,proto3,customtype=Stream" json:"streams"`
}
func (*PushRequest) Equal ¶
func (this *PushRequest) Equal(that interface{}) bool
func (*PushRequest) GoString ¶
func (this *PushRequest) GoString() string
func (*PushRequest) Marshal ¶
func (m *PushRequest) Marshal() (dAtA []byte, err error)
func (*PushRequest) MarshalToSizedBuffer ¶
func (m *PushRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*PushRequest) Reset ¶
func (m *PushRequest) Reset()
func (*PushRequest) Size ¶
func (m *PushRequest) Size() (n int)
func (*PushRequest) String ¶
func (this *PushRequest) String() string
func (*PushRequest) Unmarshal ¶
func (m *PushRequest) Unmarshal(dAtA []byte) error
type PushResponse ¶
type PushResponse struct { }
func (*PushResponse) Equal ¶
func (this *PushResponse) Equal(that interface{}) bool
func (*PushResponse) GoString ¶
func (this *PushResponse) GoString() string
func (*PushResponse) Marshal ¶
func (m *PushResponse) Marshal() (dAtA []byte, err error)
func (*PushResponse) MarshalToSizedBuffer ¶
func (m *PushResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*PushResponse) Reset ¶
func (m *PushResponse) Reset()
func (*PushResponse) Size ¶
func (m *PushResponse) Size() (n int)
func (*PushResponse) String ¶
func (this *PushResponse) String() string
func (*PushResponse) Unmarshal ¶
func (m *PushResponse) Unmarshal(dAtA []byte) error
type Stream ¶
type Stream struct { Labels string `protobuf:"bytes,1,opt,name=labels,proto3" json:"labels"` Entries []Entry `protobuf:"bytes,2,rep,name=entries,proto3,customtype=EntryAdapter" json:"entries"` Hash uint64 `protobuf:"varint,3,opt,name=hash,proto3" json:"-"` }
Stream contains a unique labels set as a string and a set of entries for it. We are not using the proto generated version but this custom one so that we can improve serialization see benchmark.
func (*Stream) MarshalToSizedBuffer ¶
MarshalToSizedBuffer marshals m to the sized buffer.
type StreamAdapter ¶
type StreamAdapter struct { Labels string `protobuf:"bytes,1,opt,name=labels,proto3" json:"labels"` Entries []EntryAdapter `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries"` // hash contains the original hash of the stream. Hash uint64 `protobuf:"varint,3,opt,name=hash,proto3" json:"-"` }
func (*StreamAdapter) Equal ¶
func (this *StreamAdapter) Equal(that interface{}) bool
func (*StreamAdapter) GetEntries ¶
func (m *StreamAdapter) GetEntries() []EntryAdapter
func (*StreamAdapter) GetHash ¶
func (m *StreamAdapter) GetHash() uint64
func (*StreamAdapter) GetLabels ¶
func (m *StreamAdapter) GetLabels() string
func (*StreamAdapter) GoString ¶
func (this *StreamAdapter) GoString() string
func (*StreamAdapter) Marshal ¶
func (m *StreamAdapter) Marshal() (dAtA []byte, err error)
func (*StreamAdapter) MarshalToSizedBuffer ¶
func (m *StreamAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*StreamAdapter) Reset ¶
func (m *StreamAdapter) Reset()
func (*StreamAdapter) Size ¶
func (m *StreamAdapter) Size() (n int)
func (*StreamAdapter) String ¶
func (this *StreamAdapter) String() string
func (*StreamAdapter) Unmarshal ¶
func (m *StreamAdapter) Unmarshal(dAtA []byte) error
Click to show internal directories.
Click to hide internal directories.