Documentation ¶
Index ¶
- Variables
- func RegisterFrontendServer(s *grpc.Server, srv FrontendServer)
- type Config
- type Frontend
- func (f *Frontend) Close()
- func (f *Frontend) Handler() http.Handler
- func (f *Frontend) Process(server Frontend_ProcessServer) error
- func (f *Frontend) RoundTrip(r *http.Request) (*http.Response, error)
- func (f *Frontend) RoundTripGRPC(ctx context.Context, req *ProcessRequest) (*ProcessResponse, error)
- type FrontendClient
- type FrontendServer
- type Frontend_ProcessClient
- type Frontend_ProcessServer
- type ProcessRequest
- func (*ProcessRequest) Descriptor() ([]byte, []int)
- func (this *ProcessRequest) Equal(that interface{}) bool
- func (m *ProcessRequest) GetHttpRequest() *httpgrpc.HTTPRequest
- func (m *ProcessRequest) GetQueryRangeRequest() *queryrange.Request
- func (this *ProcessRequest) GoString() string
- func (m *ProcessRequest) Marshal() (dAtA []byte, err error)
- func (m *ProcessRequest) MarshalTo(dAtA []byte) (int, error)
- func (*ProcessRequest) ProtoMessage()
- func (m *ProcessRequest) Reset()
- func (m *ProcessRequest) Size() (n int)
- func (this *ProcessRequest) String() string
- func (m *ProcessRequest) Unmarshal(dAtA []byte) error
- func (m *ProcessRequest) XXX_DiscardUnknown()
- func (m *ProcessRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ProcessRequest) XXX_Merge(src proto.Message)
- func (m *ProcessRequest) XXX_Size() int
- func (m *ProcessRequest) XXX_Unmarshal(b []byte) error
- type ProcessResponse
- func (*ProcessResponse) Descriptor() ([]byte, []int)
- func (this *ProcessResponse) Equal(that interface{}) bool
- func (m *ProcessResponse) GetApiResponse() *queryrange.APIResponse
- func (m *ProcessResponse) GetHttpResponse() *httpgrpc.HTTPResponse
- func (this *ProcessResponse) GoString() string
- func (m *ProcessResponse) Marshal() (dAtA []byte, err error)
- func (m *ProcessResponse) MarshalTo(dAtA []byte) (int, error)
- func (*ProcessResponse) ProtoMessage()
- func (m *ProcessResponse) Reset()
- func (m *ProcessResponse) Size() (n int)
- func (this *ProcessResponse) String() string
- func (m *ProcessResponse) Unmarshal(dAtA []byte) error
- func (m *ProcessResponse) XXX_DiscardUnknown()
- func (m *ProcessResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ProcessResponse) XXX_Merge(src proto.Message)
- func (m *ProcessResponse) XXX_Size() int
- func (m *ProcessResponse) XXX_Unmarshal(b []byte) error
- type RoundTripFunc
- type Worker
- type WorkerConfig
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthFrontend = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowFrontend = fmt.Errorf("proto: integer overflow") )
Functions ¶
func RegisterFrontendServer ¶
func RegisterFrontendServer(s *grpc.Server, srv FrontendServer)
Types ¶
type Config ¶
type Config struct { MaxOutstandingPerTenant int `yaml:"max_outstanding_per_tenant"` MaxRetries int `yaml:"max_retries"` SplitQueriesByDay bool `yaml:"split_queries_by_day"` AlignQueriesWithStep bool `yaml:"align_queries_with_step"` CacheResults bool `yaml:"cache_results"` CompressResponses bool `yaml:"compress_responses"` queryrange.ResultsCacheConfig `yaml:"results_cache"` DownstreamURL string `yaml:"downstream"` }
Config for a Frontend.
func (*Config) RegisterFlags ¶
RegisterFlags adds the flags required to config this to the given FlagSet.
type Frontend ¶
type Frontend struct {
// contains filtered or unexported fields
}
Frontend queues HTTP requests, dispatches them to backends, and handles retries for requests which failed.
func (*Frontend) Close ¶
func (f *Frontend) Close()
Close stops new requests and errors out any pending requests.
func (*Frontend) Process ¶
func (f *Frontend) Process(server Frontend_ProcessServer) error
Process allows backends to pull requests from the frontend.
func (*Frontend) RoundTripGRPC ¶
func (f *Frontend) RoundTripGRPC(ctx context.Context, req *ProcessRequest) (*ProcessResponse, error)
RoundTripGRPC round trips a proto (instread of a HTTP request).
type FrontendClient ¶
type FrontendClient interface {
Process(ctx context.Context, opts ...grpc.CallOption) (Frontend_ProcessClient, error)
}
FrontendClient is the client API for Frontend service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewFrontendClient ¶
func NewFrontendClient(cc *grpc.ClientConn) FrontendClient
type FrontendServer ¶
type FrontendServer interface {
Process(Frontend_ProcessServer) error
}
FrontendServer is the server API for Frontend service.
type Frontend_ProcessClient ¶
type Frontend_ProcessClient interface { Send(*ProcessResponse) error Recv() (*ProcessRequest, error) grpc.ClientStream }
type Frontend_ProcessServer ¶
type Frontend_ProcessServer interface { Send(*ProcessRequest) error Recv() (*ProcessResponse, error) grpc.ServerStream }
type ProcessRequest ¶
type ProcessRequest struct { HttpRequest *httpgrpc.HTTPRequest `protobuf:"bytes,1,opt,name=httpRequest,proto3" json:"httpRequest,omitempty"` QueryRangeRequest *queryrange.Request `protobuf:"bytes,2,opt,name=queryRangeRequest,proto3" json:"queryRangeRequest,omitempty"` }
func (*ProcessRequest) Descriptor ¶
func (*ProcessRequest) Descriptor() ([]byte, []int)
func (*ProcessRequest) Equal ¶
func (this *ProcessRequest) Equal(that interface{}) bool
func (*ProcessRequest) GetHttpRequest ¶
func (m *ProcessRequest) GetHttpRequest() *httpgrpc.HTTPRequest
func (*ProcessRequest) GetQueryRangeRequest ¶
func (m *ProcessRequest) GetQueryRangeRequest() *queryrange.Request
func (*ProcessRequest) GoString ¶
func (this *ProcessRequest) GoString() string
func (*ProcessRequest) Marshal ¶
func (m *ProcessRequest) Marshal() (dAtA []byte, err error)
func (*ProcessRequest) ProtoMessage ¶
func (*ProcessRequest) ProtoMessage()
func (*ProcessRequest) Reset ¶
func (m *ProcessRequest) Reset()
func (*ProcessRequest) Size ¶
func (m *ProcessRequest) Size() (n int)
func (*ProcessRequest) String ¶
func (this *ProcessRequest) String() string
func (*ProcessRequest) Unmarshal ¶
func (m *ProcessRequest) Unmarshal(dAtA []byte) error
func (*ProcessRequest) XXX_DiscardUnknown ¶
func (m *ProcessRequest) XXX_DiscardUnknown()
func (*ProcessRequest) XXX_Marshal ¶
func (m *ProcessRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ProcessRequest) XXX_Merge ¶
func (m *ProcessRequest) XXX_Merge(src proto.Message)
func (*ProcessRequest) XXX_Size ¶
func (m *ProcessRequest) XXX_Size() int
func (*ProcessRequest) XXX_Unmarshal ¶
func (m *ProcessRequest) XXX_Unmarshal(b []byte) error
type ProcessResponse ¶
type ProcessResponse struct { HttpResponse *httpgrpc.HTTPResponse `protobuf:"bytes,1,opt,name=httpResponse,proto3" json:"httpResponse,omitempty"` ApiResponse *queryrange.APIResponse `protobuf:"bytes,2,opt,name=apiResponse,proto3" json:"apiResponse,omitempty"` }
func (*ProcessResponse) Descriptor ¶
func (*ProcessResponse) Descriptor() ([]byte, []int)
func (*ProcessResponse) Equal ¶
func (this *ProcessResponse) Equal(that interface{}) bool
func (*ProcessResponse) GetApiResponse ¶
func (m *ProcessResponse) GetApiResponse() *queryrange.APIResponse
func (*ProcessResponse) GetHttpResponse ¶
func (m *ProcessResponse) GetHttpResponse() *httpgrpc.HTTPResponse
func (*ProcessResponse) GoString ¶
func (this *ProcessResponse) GoString() string
func (*ProcessResponse) Marshal ¶
func (m *ProcessResponse) Marshal() (dAtA []byte, err error)
func (*ProcessResponse) ProtoMessage ¶
func (*ProcessResponse) ProtoMessage()
func (*ProcessResponse) Reset ¶
func (m *ProcessResponse) Reset()
func (*ProcessResponse) Size ¶
func (m *ProcessResponse) Size() (n int)
func (*ProcessResponse) String ¶
func (this *ProcessResponse) String() string
func (*ProcessResponse) Unmarshal ¶
func (m *ProcessResponse) Unmarshal(dAtA []byte) error
func (*ProcessResponse) XXX_DiscardUnknown ¶
func (m *ProcessResponse) XXX_DiscardUnknown()
func (*ProcessResponse) XXX_Marshal ¶
func (m *ProcessResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ProcessResponse) XXX_Merge ¶
func (m *ProcessResponse) XXX_Merge(src proto.Message)
func (*ProcessResponse) XXX_Size ¶
func (m *ProcessResponse) XXX_Size() int
func (*ProcessResponse) XXX_Unmarshal ¶
func (m *ProcessResponse) XXX_Unmarshal(b []byte) error
type RoundTripFunc ¶
RoundTripFunc is to http.RoundTripper what http.HandlerFunc is to http.Handler.
type Worker ¶
type Worker interface {
Stop()
}
Worker is the counter-part to the frontend, actually processing requests.
type WorkerConfig ¶
type WorkerConfig struct { Address string Parallelism int DNSLookupDuration time.Duration GRPCClientConfig grpcclient.Config `yaml:"grpc_client_config"` }
WorkerConfig is config for a worker.
func (*WorkerConfig) RegisterFlags ¶
func (cfg *WorkerConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags adds the flags required to config this to the given FlagSet.