push

package module
v0.0.0-...-2d62fca Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 19 Imported by: 15

Documentation

Index

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 RegisterPusherServer

func RegisterPusherServer(s *grpc.Server, srv PusherServer)

func SizeOfStdTime

func SizeOfStdTime(t time.Time) int

func StdTimeMarshalTo

func StdTimeMarshalTo(t time.Time, data []byte) (int, error)

func StdTimeUnmarshal

func StdTimeUnmarshal(t *time.Time, data []byte) error

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"`
	StructuredMetadata LabelsAdapter `protobuf:"bytes,3,opt,name=structuredMetadata,proto3" json:"structuredMetadata,omitempty"`
	Parsed             LabelsAdapter `protobuf:"bytes,4,opt,name=parsed,proto3" json:"parsed,omitempty"`
}

Entry is a log entry with a timestamp.

func (*Entry) Equal

func (m *Entry) Equal(that interface{}) bool

func (*Entry) Marshal

func (m *Entry) Marshal() (dAtA []byte, err error)

func (*Entry) MarshalJSON

func (m *Entry) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. In Loki, this method should only be used by the Legacy encoder used when hitting the deprecated /api/promt/query endpoint. We will ignore the structured metadata.

func (*Entry) MarshalTo

func (m *Entry) MarshalTo(dAtA []byte) (int, error)

func (*Entry) MarshalToSizedBuffer

func (m *Entry) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Entry) Size

func (m *Entry) Size() (n int)

func (*Entry) Unmarshal

func (m *Entry) Unmarshal(dAtA []byte) error

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"`
	StructuredMetadata []LabelPairAdapter `protobuf:"bytes,3,rep,name=structuredMetadata,proto3" json:"structuredMetadata,omitempty"`
	// This field shouldn't be used by clients to push data to Loki.
	// It is only used by Loki to return parsed log lines in query responses.
	// TODO: Remove this field from the write path Proto.
	Parsed []LabelPairAdapter `protobuf:"bytes,4,rep,name=parsed,proto3" json:"parsed,omitempty"`
}

func (*EntryAdapter) Descriptor

func (*EntryAdapter) Descriptor() ([]byte, []int)

func (*EntryAdapter) Equal

func (this *EntryAdapter) Equal(that interface{}) bool

func (*EntryAdapter) GetLine

func (m *EntryAdapter) GetLine() string

func (*EntryAdapter) GetParsed

func (m *EntryAdapter) GetParsed() []LabelPairAdapter

func (*EntryAdapter) GetStructuredMetadata

func (m *EntryAdapter) GetStructuredMetadata() []LabelPairAdapter

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) MarshalTo

func (m *EntryAdapter) MarshalTo(dAtA []byte) (int, error)

func (*EntryAdapter) MarshalToSizedBuffer

func (m *EntryAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*EntryAdapter) ProtoMessage

func (*EntryAdapter) ProtoMessage()

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

func (*EntryAdapter) XXX_DiscardUnknown

func (m *EntryAdapter) XXX_DiscardUnknown()

func (*EntryAdapter) XXX_Marshal

func (m *EntryAdapter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EntryAdapter) XXX_Merge

func (m *EntryAdapter) XXX_Merge(src proto.Message)

func (*EntryAdapter) XXX_Size

func (m *EntryAdapter) XXX_Size() int

func (*EntryAdapter) XXX_Unmarshal

func (m *EntryAdapter) XXX_Unmarshal(b []byte) error

type LabelAdapter

type LabelAdapter struct {
	Name, Value string
}

LabelAdapter should be a copy of the Prometheus labels.Label type. We cannot import Prometheus in this package because it would create many dependencies in other projects importing this package. Instead, we copy the definition here, which should be kept in sync with the original, so it can be cast to the prometheus type.

func (*LabelAdapter) Compare

func (m *LabelAdapter) Compare(other LabelAdapter) int

Compare implements proto.Comparer.

func (*LabelAdapter) Equal

func (m *LabelAdapter) Equal(other LabelAdapter) bool

Equal implements proto.Equaler.

func (*LabelAdapter) Marshal

func (m *LabelAdapter) Marshal() (dAtA []byte, err error)

func (*LabelAdapter) MarshalTo

func (m *LabelAdapter) MarshalTo(dAtA []byte) (int, error)

func (*LabelAdapter) MarshalToSizedBuffer

func (m *LabelAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*LabelAdapter) Size

func (m *LabelAdapter) Size() (n int)

func (*LabelAdapter) Unmarshal

func (m *LabelAdapter) Unmarshal(dAtA []byte) error

Unmarshal a LabelAdapter, implements proto.Unmarshaller. NB this is a copy of the autogenerated code to unmarshal a LabelPair, with the byte copying replaced with a yoloString.

type LabelPairAdapter

type LabelPairAdapter struct {
	Name  string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}

func (*LabelPairAdapter) Descriptor

func (*LabelPairAdapter) Descriptor() ([]byte, []int)

func (*LabelPairAdapter) Equal

func (this *LabelPairAdapter) Equal(that interface{}) bool

func (*LabelPairAdapter) GetName

func (m *LabelPairAdapter) GetName() string

func (*LabelPairAdapter) GetValue

func (m *LabelPairAdapter) GetValue() string

func (*LabelPairAdapter) GoString

func (this *LabelPairAdapter) GoString() string

func (*LabelPairAdapter) Marshal

func (m *LabelPairAdapter) Marshal() (dAtA []byte, err error)

func (*LabelPairAdapter) MarshalTo

func (m *LabelPairAdapter) MarshalTo(dAtA []byte) (int, error)

func (*LabelPairAdapter) MarshalToSizedBuffer

func (m *LabelPairAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*LabelPairAdapter) ProtoMessage

func (*LabelPairAdapter) ProtoMessage()

func (*LabelPairAdapter) Reset

func (m *LabelPairAdapter) Reset()

func (*LabelPairAdapter) Size

func (m *LabelPairAdapter) Size() (n int)

func (*LabelPairAdapter) String

func (this *LabelPairAdapter) String() string

func (*LabelPairAdapter) Unmarshal

func (m *LabelPairAdapter) Unmarshal(dAtA []byte) error

func (*LabelPairAdapter) XXX_DiscardUnknown

func (m *LabelPairAdapter) XXX_DiscardUnknown()

func (*LabelPairAdapter) XXX_Marshal

func (m *LabelPairAdapter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LabelPairAdapter) XXX_Merge

func (m *LabelPairAdapter) XXX_Merge(src proto.Message)

func (*LabelPairAdapter) XXX_Size

func (m *LabelPairAdapter) XXX_Size() int

func (*LabelPairAdapter) XXX_Unmarshal

func (m *LabelPairAdapter) XXX_Unmarshal(b []byte) error

type LabelsAdapter

type LabelsAdapter []LabelAdapter

LabelsAdapter is equivalent to the Prometheus labels.Labels type.

func (LabelsAdapter) MarshalJSON

func (ls LabelsAdapter) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. Should be kept in sync with Prometheus's labels.Labels implementation.

func (*LabelsAdapter) UnmarshalJSON

func (ls *LabelsAdapter) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler. Should be kept in sync with Prometheus's labels.Labels implementation.

type PushRequest

type PushRequest struct {
	Streams []Stream `protobuf:"bytes,1,rep,name=streams,proto3,customtype=Stream" json:"streams"`
}

func (*PushRequest) Descriptor

func (*PushRequest) Descriptor() ([]byte, []int)

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) MarshalTo

func (m *PushRequest) MarshalTo(dAtA []byte) (int, error)

func (*PushRequest) MarshalToSizedBuffer

func (m *PushRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PushRequest) ProtoMessage

func (*PushRequest) ProtoMessage()

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

func (*PushRequest) XXX_DiscardUnknown

func (m *PushRequest) XXX_DiscardUnknown()

func (*PushRequest) XXX_Marshal

func (m *PushRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PushRequest) XXX_Merge

func (m *PushRequest) XXX_Merge(src proto.Message)

func (*PushRequest) XXX_Size

func (m *PushRequest) XXX_Size() int

func (*PushRequest) XXX_Unmarshal

func (m *PushRequest) XXX_Unmarshal(b []byte) error

type PushResponse

type PushResponse struct {
}

func (*PushResponse) Descriptor

func (*PushResponse) Descriptor() ([]byte, []int)

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) MarshalTo

func (m *PushResponse) MarshalTo(dAtA []byte) (int, error)

func (*PushResponse) MarshalToSizedBuffer

func (m *PushResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PushResponse) ProtoMessage

func (*PushResponse) ProtoMessage()

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

func (*PushResponse) XXX_DiscardUnknown

func (m *PushResponse) XXX_DiscardUnknown()

func (*PushResponse) XXX_Marshal

func (m *PushResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PushResponse) XXX_Merge

func (m *PushResponse) XXX_Merge(src proto.Message)

func (*PushResponse) XXX_Size

func (m *PushResponse) XXX_Size() int

func (*PushResponse) XXX_Unmarshal

func (m *PushResponse) XXX_Unmarshal(b []byte) error

type PusherClient

type PusherClient interface {
	Push(ctx context.Context, in *PushRequest, opts ...grpc.CallOption) (*PushResponse, error)
}

PusherClient is the client API for Pusher service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewPusherClient

func NewPusherClient(cc *grpc.ClientConn) PusherClient

type PusherServer

type PusherServer interface {
	Push(context.Context, *PushRequest) (*PushResponse, error)
}

PusherServer is the server API for Pusher service.

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) Equal

func (m *Stream) Equal(that interface{}) bool

func (*Stream) Marshal

func (m *Stream) Marshal() (dAtA []byte, err error)

func (*Stream) MarshalJSON

func (m *Stream) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. In Loki, this method should only be used by the Legacy encoder used when hitting the deprecated /api/promt/query endpoint. We will ignore the categorized labels and only return the stream labels.

func (*Stream) MarshalTo

func (m *Stream) MarshalTo(dAtA []byte) (int, error)

func (*Stream) MarshalToSizedBuffer

func (m *Stream) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Stream) Size

func (m *Stream) Size() (n int)

func (*Stream) Unmarshal

func (m *Stream) Unmarshal(dAtA []byte) error

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) Descriptor

func (*StreamAdapter) Descriptor() ([]byte, []int)

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) MarshalTo

func (m *StreamAdapter) MarshalTo(dAtA []byte) (int, error)

func (*StreamAdapter) MarshalToSizedBuffer

func (m *StreamAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*StreamAdapter) ProtoMessage

func (*StreamAdapter) ProtoMessage()

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

func (*StreamAdapter) XXX_DiscardUnknown

func (m *StreamAdapter) XXX_DiscardUnknown()

func (*StreamAdapter) XXX_Marshal

func (m *StreamAdapter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StreamAdapter) XXX_Merge

func (m *StreamAdapter) XXX_Merge(src proto.Message)

func (*StreamAdapter) XXX_Size

func (m *StreamAdapter) XXX_Size() int

func (*StreamAdapter) XXX_Unmarshal

func (m *StreamAdapter) XXX_Unmarshal(b []byte) error

type UnimplementedPusherServer

type UnimplementedPusherServer struct {
}

UnimplementedPusherServer can be embedded to have forward compatible implementations.

func (*UnimplementedPusherServer) Push

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL