Documentation
¶
Index ¶
- Constants
- Variables
- func GetGzipReader(r io.Reader) (*gzip.Reader, error)
- func Points2Rows(points []models.Point) ([]influx.Row, error)
- func PutGzipReader(zr *gzip.Reader)
- func ReadRequestToInfluxQuery(req *prompb.ReadRequest) (string, error)
- func TagsConverterRemoveInfluxSystemTag(tags map[string]string) models.Tags
- type AuthenticationMethod
- type Handler
- type Response
- type Route
- type Service
- type Throttler
Constants ¶
const ( // DefaultChunkSize specifies the maximum number of points that will // be read before sending results back to the engine. // // This has no relation to the number of bytes that are returned. DefaultChunkSize = 10000 MaxChunkSize = DefaultChunkSize * 50 DefaultInnerChunkSize = 1024 MaxInnerChunkSize = 4096 DefaultDebugRequestsInterval = 10 * time.Second MaxDebugRequestsInterval = 6 * time.Hour )
Variables ¶
var ( // ErrBearerAuthDisabled is returned when client specifies bearer auth in // a request but bearer auth is disabled. ErrBearerAuthDisabled = errors.New("bearer auth disabld") )
Functions ¶
func PutGzipReader ¶
PutGzipReader returns back gzip reader obtained via GetGzipReader.
func ReadRequestToInfluxQuery ¶
func ReadRequestToInfluxQuery(req *prompb.ReadRequest) (string, error)
Types ¶
type AuthenticationMethod ¶
type AuthenticationMethod int
AuthenticationMethod defines the type of authentication used.
const ( // Authenticate using basic authentication. UserAuthentication AuthenticationMethod = iota // Authenticate with jwt. BearerAuthentication )
Supported authentication methods.
type Handler ¶
type Handler struct {
Version string
BuildType string
MetaClient interface {
Database(name string) (*meta2.DatabaseInfo, error)
Authenticate(username, password string) (ui meta2.User, err error)
User(username string) (meta2.User, error)
AdminUserExists() bool
DataNodes() ([]meta2.DataNode, error)
ShowShards() models.Rows
}
QueryAuthorizer interface {
AuthorizeQuery(u meta2.User, query *influxql.Query, database string) error
}
WriteAuthorizer interface {
AuthorizeWrite(username, database string) error
}
ExtSysCtrl interface {
SendSysCtrlOnNode(nodID uint64, req netstorage.SysCtrlRequest) (map[string]string, error)
}
QueryExecutor *query2.Executor
Monitor interface {
}
PointsWriter interface {
WritePointRows(database, retentionPolicy string, points []influx.Row) error
}
Config *config.Config
Logger *logger.Logger
CLFLogger *zap.Logger
// contains filtered or unexported fields
}
Handler represents an HTTP handler for the InfluxDB server.
func NewHandler ¶
NewHandler returns a new instance of handler with routes.
type Response ¶
Response represents a list of statement results.
func (*Response) Error ¶
Error returns the first error from any statement. Returns nil if no errors occurred on any statements.
func (Response) MarshalJSON ¶
MarshalJSON encodes a Response struct into JSON.
func (*Response) UnmarshalJSON ¶
UnmarshalJSON decodes the data into the Response struct.
type Route ¶
type Route struct {
Name string
Method string
Pattern string
Gzipped bool
LoggingEnabled bool
HandlerFunc interface{}
}
Route specifies how to handle a HTTP verb for a given endpoint.
type Service ¶
type Service struct {
Ln []net.Listener
Handler *Handler
Logger *zap.Logger
// contains filtered or unexported fields
}
Service manages the listener and handler for an HTTP endpoint.
func NewService ¶
NewService returns a new instance of Service.
func (*Service) Addr ¶
Addr returns the listener's address. Returns nil if listener is closed. test func, so return 0 index addr
func (*Service) BoundHTTPAddr ¶
BoundHTTPAddr returns the string version of the address that the HTTP server is listening on. This is useful if you start an ephemeral server in test with bind address localhost:0. test func, so return 0 index addr
func (*Service) Openlistener ¶
type Throttler ¶
type Throttler struct {
// Maximum amount of time requests can wait in queue.
// Must be set before adding middleware.
EnqueueTimeout time.Duration
Logger *zap.Logger
// contains filtered or unexported fields
}
Throttler represents an HTTP throttler that limits the number of concurrent requests being processed as well as the number of enqueued requests.
func NewThrottler ¶
NewThrottler returns a new instance of Throttler that limits to concurrentN. requests processed at a time and maxEnqueueN requests waiting to be processed.