github.com/pf-qiu/concourse/v6@v6.7.3-0.20201207032516-1f455d73275f/atc/metric/emitter/influxdb_client.go (about)

     1  package emitter
     2  
     3  import (
     4  	"time"
     5  
     6  	influxclient "github.com/influxdata/influxdb1-client/v2"
     7  )
     8  
     9  // This is a copy of the github.com/influxdata/influxdb1-client/v2/client.Client interface whose sole purpose is
    10  // to allow counterfeiter to generate a fake implementation.
    11  // counterfeiter is not able to resolve github.com/influxdata/influxdb1-client/v2/client.Client, possibly due to
    12  // the v2 in the package name.
    13  
    14  //go:generate counterfeiter . InfluxDBClient
    15  // Client is a client interface for writing & querying the database.
    16  type InfluxDBClient interface {
    17  	// Ping checks that status of cluster, and will always return 0 time and no
    18  	// error for UDP clients.
    19  	Ping(timeout time.Duration) (time.Duration, string, error)
    20  
    21  	// Write takes a BatchPoints object and writes all Points to InfluxDB.
    22  	Write(bp influxclient.BatchPoints) error
    23  
    24  	// Query makes an InfluxDB Query on the database. This will fail if using
    25  	// the UDP client.
    26  	Query(q influxclient.Query) (*influxclient.Response, error)
    27  
    28  	// QueryAsChunk makes an InfluxDB Query on the database. This will fail if using
    29  	// the UDP client.
    30  	QueryAsChunk(q influxclient.Query) (*influxclient.ChunkedResponse, error)
    31  
    32  	// Close releases any resources a Client may be using.
    33  	Close() error
    34  }