Documentation ¶
Overview ¶
Package logspray is a generated protocol buffer package.
It is generated from these files:
proto/logspray/log.proto
It has these top-level messages:
Message LogSummary TailRequest LabelsRequest LabelsResponse LabelValuesRequest LabelValuesResponse SearchRequest SearchResponse
Package logspray is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterLogServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterLogServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LogServiceClient) error
- func RegisterLogServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterLogServiceServer(s *grpc.Server, srv LogServiceServer)
- type LabelValuesRequest
- func (*LabelValuesRequest) Descriptor() ([]byte, []int)
- func (m *LabelValuesRequest) GetCount() int64
- func (m *LabelValuesRequest) GetFrom() *google_protobuf1.Timestamp
- func (m *LabelValuesRequest) GetName() string
- func (m *LabelValuesRequest) GetTo() *google_protobuf1.Timestamp
- func (*LabelValuesRequest) ProtoMessage()
- func (m *LabelValuesRequest) Reset()
- func (m *LabelValuesRequest) String() string
- type LabelValuesResponse
- type LabelsRequest
- type LabelsResponse
- type LogServiceClient
- type LogServiceServer
- type LogService_LogStreamClient
- type LogService_LogStreamServer
- type LogService_SearchStreamClient
- type LogService_SearchStreamServer
- type LogService_TailClient
- type LogService_TailServer
- type LogSummary
- type Message
- func (m *Message) Copy() (tm *Message)
- func (*Message) Descriptor() ([]byte, []int)
- func (m *Message) GetControlMessage() Message_ControlMessage
- func (m *Message) GetIndex() uint64
- func (m *Message) GetLabels() map[string]string
- func (m *Message) GetSetheader() bool
- func (m *Message) GetStreamID() string
- func (m *Message) GetText() string
- func (m *Message) GetTime() *google_protobuf1.Timestamp
- func (m *Message) ID() (string, error)
- func (*Message) ProtoMessage()
- func (m *Message) Reset()
- func (m *Message) String() string
- type MessageFunc
- type Message_ControlMessage
- type SearchRequest
- func (*SearchRequest) Descriptor() ([]byte, []int)
- func (m *SearchRequest) GetCount() uint64
- func (m *SearchRequest) GetFrom() *google_protobuf1.Timestamp
- func (m *SearchRequest) GetOffset() uint64
- func (m *SearchRequest) GetQuery() string
- func (m *SearchRequest) GetReverse() bool
- func (m *SearchRequest) GetTo() *google_protobuf1.Timestamp
- func (*SearchRequest) ProtoMessage()
- func (m *SearchRequest) Reset()
- func (m *SearchRequest) String() string
- type SearchResponse
- type TailRequest
Constants ¶
This section is empty.
Variables ¶
var Message_ControlMessage_name = map[int32]string{
0: "NONE",
1: "OK",
2: "ERROR",
3: "SETHEADER",
4: "STREAMEND",
}
var Message_ControlMessage_value = map[string]int32{
"NONE": 0,
"OK": 1,
"ERROR": 2,
"SETHEADER": 3,
"STREAMEND": 4,
}
Functions ¶
func RegisterLogServiceHandler ¶
func RegisterLogServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterLogServiceHandler registers the http handlers for service LogService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterLogServiceHandlerClient ¶ added in v0.2.0
func RegisterLogServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LogServiceClient) error
RegisterLogServiceHandler registers the http handlers for service LogService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "LogServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "LogServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "LogServiceClient" to call the correct interceptors.
func RegisterLogServiceHandlerFromEndpoint ¶
func RegisterLogServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterLogServiceHandlerFromEndpoint is same as RegisterLogServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterLogServiceServer ¶
func RegisterLogServiceServer(s *grpc.Server, srv LogServiceServer)
Types ¶
type LabelValuesRequest ¶
type LabelValuesRequest struct { From *google_protobuf1.Timestamp `protobuf:"bytes,1,opt,name=from" json:"from,omitempty"` To *google_protobuf1.Timestamp `protobuf:"bytes,2,opt,name=to" json:"to,omitempty"` Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` Count int64 `protobuf:"varint,4,opt,name=count" json:"count,omitempty"` }
LabelValuesRequest
func (*LabelValuesRequest) Descriptor ¶
func (*LabelValuesRequest) Descriptor() ([]byte, []int)
func (*LabelValuesRequest) GetCount ¶
func (m *LabelValuesRequest) GetCount() int64
func (*LabelValuesRequest) GetFrom ¶
func (m *LabelValuesRequest) GetFrom() *google_protobuf1.Timestamp
func (*LabelValuesRequest) GetName ¶
func (m *LabelValuesRequest) GetName() string
func (*LabelValuesRequest) GetTo ¶
func (m *LabelValuesRequest) GetTo() *google_protobuf1.Timestamp
func (*LabelValuesRequest) ProtoMessage ¶
func (*LabelValuesRequest) ProtoMessage()
func (*LabelValuesRequest) Reset ¶
func (m *LabelValuesRequest) Reset()
func (*LabelValuesRequest) String ¶
func (m *LabelValuesRequest) String() string
type LabelValuesResponse ¶
type LabelValuesResponse struct { Values []string `protobuf:"bytes,1,rep,name=values" json:"values,omitempty"` TotalHitCount uint64 `protobuf:"varint,2,opt,name=total_hit_count,json=totalHitCount" json:"total_hit_count,omitempty"` }
LabelValuesResponse
func (*LabelValuesResponse) Descriptor ¶
func (*LabelValuesResponse) Descriptor() ([]byte, []int)
func (*LabelValuesResponse) GetTotalHitCount ¶
func (m *LabelValuesResponse) GetTotalHitCount() uint64
func (*LabelValuesResponse) GetValues ¶
func (m *LabelValuesResponse) GetValues() []string
func (*LabelValuesResponse) ProtoMessage ¶
func (*LabelValuesResponse) ProtoMessage()
func (*LabelValuesResponse) Reset ¶
func (m *LabelValuesResponse) Reset()
func (*LabelValuesResponse) String ¶
func (m *LabelValuesResponse) String() string
type LabelsRequest ¶
type LabelsRequest struct { From *google_protobuf1.Timestamp `protobuf:"bytes,1,opt,name=from" json:"from,omitempty"` To *google_protobuf1.Timestamp `protobuf:"bytes,2,opt,name=to" json:"to,omitempty"` }
LabelsRequest
func (*LabelsRequest) Descriptor ¶
func (*LabelsRequest) Descriptor() ([]byte, []int)
func (*LabelsRequest) GetFrom ¶
func (m *LabelsRequest) GetFrom() *google_protobuf1.Timestamp
func (*LabelsRequest) GetTo ¶
func (m *LabelsRequest) GetTo() *google_protobuf1.Timestamp
func (*LabelsRequest) ProtoMessage ¶
func (*LabelsRequest) ProtoMessage()
func (*LabelsRequest) Reset ¶
func (m *LabelsRequest) Reset()
func (*LabelsRequest) String ¶
func (m *LabelsRequest) String() string
type LabelsResponse ¶
type LabelsResponse struct {
Names []string `protobuf:"bytes,1,rep,name=names" json:"names,omitempty"`
}
LabelsResponse
func (*LabelsResponse) Descriptor ¶
func (*LabelsResponse) Descriptor() ([]byte, []int)
func (*LabelsResponse) GetNames ¶
func (m *LabelsResponse) GetNames() []string
func (*LabelsResponse) ProtoMessage ¶
func (*LabelsResponse) ProtoMessage()
func (*LabelsResponse) Reset ¶
func (m *LabelsResponse) Reset()
func (*LabelsResponse) String ¶
func (m *LabelsResponse) String() string
type LogServiceClient ¶
type LogServiceClient interface { // LogStream ingests the stream of messages // The first message sent in a stream should set // an initial set of default labels. You must provide a UUID // for the stream, and each message should include an incrementing // index into that stream. // The client assign the UUID, and Index, rather than the server, // making it the singe source of truth for a given log item, and allowing // potential deduplication of log itmes later on. LogStream(ctx context.Context, opts ...grpc.CallOption) (LogService_LogStreamClient, error) // Log logs an individual message. Log(ctx context.Context, in *Message, opts ...grpc.CallOption) (*LogSummary, error) // Tail returns a stream of log data that matches the // query in the TailRequest. When reading the stream // clients should pay attention to ControlMessage_SETHEADER // events which include the base sets of labels for a stream. // These labels should be added to log entries associated with // that stream. Tail(ctx context.Context, in *TailRequest, opts ...grpc.CallOption) (LogService_TailClient, error) // Search takes a string query Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) // SearchStream takes a string query and returns results as a stream. SearchStream(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (LogService_SearchStreamClient, error) // Labels returns the set of labels known in the current index // active index. Labels(ctx context.Context, in *LabelsRequest, opts ...grpc.CallOption) (*LabelsResponse, error) // LabelsValue returns the set of values for a label known in the current // index active index. (from/to are currently ignored) LabelValues(ctx context.Context, in *LabelValuesRequest, opts ...grpc.CallOption) (*LabelValuesResponse, error) }
func NewLogServiceClient ¶
func NewLogServiceClient(cc *grpc.ClientConn) LogServiceClient
type LogServiceServer ¶
type LogServiceServer interface { // LogStream ingests the stream of messages // The first message sent in a stream should set // an initial set of default labels. You must provide a UUID // for the stream, and each message should include an incrementing // index into that stream. // The client assign the UUID, and Index, rather than the server, // making it the singe source of truth for a given log item, and allowing // potential deduplication of log itmes later on. LogStream(LogService_LogStreamServer) error // Log logs an individual message. Log(context.Context, *Message) (*LogSummary, error) // Tail returns a stream of log data that matches the // query in the TailRequest. When reading the stream // clients should pay attention to ControlMessage_SETHEADER // events which include the base sets of labels for a stream. // These labels should be added to log entries associated with // that stream. Tail(*TailRequest, LogService_TailServer) error // Search takes a string query Search(context.Context, *SearchRequest) (*SearchResponse, error) // SearchStream takes a string query and returns results as a stream. SearchStream(*SearchRequest, LogService_SearchStreamServer) error // Labels returns the set of labels known in the current index // active index. Labels(context.Context, *LabelsRequest) (*LabelsResponse, error) // LabelsValue returns the set of values for a label known in the current // index active index. (from/to are currently ignored) LabelValues(context.Context, *LabelValuesRequest) (*LabelValuesResponse, error) }
type LogService_LogStreamClient ¶
type LogService_LogStreamClient interface { Send(*Message) error CloseAndRecv() (*LogSummary, error) grpc.ClientStream }
type LogService_LogStreamServer ¶
type LogService_LogStreamServer interface { SendAndClose(*LogSummary) error Recv() (*Message, error) grpc.ServerStream }
type LogService_SearchStreamClient ¶
type LogService_SearchStreamClient interface { Recv() (*Message, error) grpc.ClientStream }
type LogService_SearchStreamServer ¶
type LogService_SearchStreamServer interface { Send(*Message) error grpc.ServerStream }
type LogService_TailClient ¶
type LogService_TailClient interface { Recv() (*Message, error) grpc.ClientStream }
type LogService_TailServer ¶
type LogService_TailServer interface { Send(*Message) error grpc.ServerStream }
type LogSummary ¶
type LogSummary struct {
Count int64 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"`
}
LogSummary
func (*LogSummary) Descriptor ¶
func (*LogSummary) Descriptor() ([]byte, []int)
func (*LogSummary) GetCount ¶
func (m *LogSummary) GetCount() int64
func (*LogSummary) ProtoMessage ¶
func (*LogSummary) ProtoMessage()
func (*LogSummary) Reset ¶
func (m *LogSummary) Reset()
func (*LogSummary) String ¶
func (m *LogSummary) String() string
type Message ¶
type Message struct { Time *google_protobuf1.Timestamp `protobuf:"bytes,1,opt,name=time" json:"time,omitempty"` Labels map[string]string `` /* 132-byte string literal not displayed */ Setheader bool `protobuf:"varint,3,opt,name=setheader" json:"setheader,omitempty"` Text string `protobuf:"bytes,4,opt,name=text" json:"text,omitempty"` ControlMessage Message_ControlMessage `` /* 134-byte string literal not displayed */ StreamID string `protobuf:"bytes,6,opt,name=StreamID,json=streamID" json:"StreamID,omitempty"` Index uint64 `protobuf:"varint,7,opt,name=Index,json=index" json:"Index,omitempty"` }
Message
func (*Message) Copy ¶
Copy copies a message into an existing message struct It will allocate a labelset if none
func (*Message) Descriptor ¶
func (*Message) GetControlMessage ¶
func (m *Message) GetControlMessage() Message_ControlMessage
func (*Message) GetSetheader ¶
func (*Message) GetStreamID ¶
func (*Message) GetTime ¶
func (m *Message) GetTime() *google_protobuf1.Timestamp
func (*Message) ID ¶
ID Returns a unique string message ID for a message. The StreamID and Index must be populated
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
type MessageFunc ¶
MessageFunc represent a function for processing a stream of messages.
func MakeFlattenStreamFunc ¶
func MakeFlattenStreamFunc(next MessageFunc) MessageFunc
MakeFlattenStreamFunc create a stream processing function that reconstructs full messages from a stream of message headers and bodies.
func MakeInjectStreamHeadersFunc ¶
func MakeInjectStreamHeadersFunc(next MessageFunc) MessageFunc
MakeInjectStreamHeadersFunc creates a message processing function that sends Stream headers on demand.
type Message_ControlMessage ¶
type Message_ControlMessage int32
const ( Message_NONE Message_ControlMessage = 0 Message_OK Message_ControlMessage = 1 Message_ERROR Message_ControlMessage = 2 Message_SETHEADER Message_ControlMessage = 3 Message_STREAMEND Message_ControlMessage = 4 )
func (Message_ControlMessage) EnumDescriptor ¶
func (Message_ControlMessage) EnumDescriptor() ([]byte, []int)
func (Message_ControlMessage) String ¶
func (x Message_ControlMessage) String() string
type SearchRequest ¶
type SearchRequest struct { From *google_protobuf1.Timestamp `protobuf:"bytes,1,opt,name=from" json:"from,omitempty"` To *google_protobuf1.Timestamp `protobuf:"bytes,2,opt,name=to" json:"to,omitempty"` Query string `protobuf:"bytes,3,opt,name=query" json:"query,omitempty"` Count uint64 `protobuf:"varint,4,opt,name=count" json:"count,omitempty"` Offset uint64 `protobuf:"varint,5,opt,name=offset" json:"offset,omitempty"` Reverse bool `protobuf:"varint,6,opt,name=reverse" json:"reverse,omitempty"` }
SearchRequest
func (*SearchRequest) Descriptor ¶
func (*SearchRequest) Descriptor() ([]byte, []int)
func (*SearchRequest) GetCount ¶
func (m *SearchRequest) GetCount() uint64
func (*SearchRequest) GetFrom ¶
func (m *SearchRequest) GetFrom() *google_protobuf1.Timestamp
func (*SearchRequest) GetOffset ¶
func (m *SearchRequest) GetOffset() uint64
func (*SearchRequest) GetQuery ¶
func (m *SearchRequest) GetQuery() string
func (*SearchRequest) GetReverse ¶
func (m *SearchRequest) GetReverse() bool
func (*SearchRequest) GetTo ¶
func (m *SearchRequest) GetTo() *google_protobuf1.Timestamp
func (*SearchRequest) ProtoMessage ¶
func (*SearchRequest) ProtoMessage()
func (*SearchRequest) Reset ¶
func (m *SearchRequest) Reset()
func (*SearchRequest) String ¶
func (m *SearchRequest) String() string
type SearchResponse ¶
type SearchResponse struct { Messages []*Message `protobuf:"bytes,1,rep,name=messages" json:"messages,omitempty"` TotalHitCount uint64 `protobuf:"varint,2,opt,name=total_hit_count,json=totalHitCount" json:"total_hit_count,omitempty"` }
SearchResponse
func (*SearchResponse) Descriptor ¶
func (*SearchResponse) Descriptor() ([]byte, []int)
func (*SearchResponse) GetMessages ¶
func (m *SearchResponse) GetMessages() []*Message
func (*SearchResponse) GetTotalHitCount ¶
func (m *SearchResponse) GetTotalHitCount() uint64
func (*SearchResponse) ProtoMessage ¶
func (*SearchResponse) ProtoMessage()
func (*SearchResponse) Reset ¶
func (m *SearchResponse) Reset()
func (*SearchResponse) String ¶
func (m *SearchResponse) String() string
type TailRequest ¶
type TailRequest struct { Max int64 `protobuf:"varint,1,opt,name=max" json:"max,omitempty"` Query string `protobuf:"bytes,2,opt,name=query" json:"query,omitempty"` }
TailRequest
func (*TailRequest) Descriptor ¶
func (*TailRequest) Descriptor() ([]byte, []int)
func (*TailRequest) GetMax ¶
func (m *TailRequest) GetMax() int64
func (*TailRequest) GetQuery ¶
func (m *TailRequest) GetQuery() string
func (*TailRequest) ProtoMessage ¶
func (*TailRequest) ProtoMessage()
func (*TailRequest) Reset ¶
func (m *TailRequest) Reset()
func (*TailRequest) String ¶
func (m *TailRequest) String() string