influxdb

package
v0.0.0-...-c731d2b Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// QueryTimeout is the default time to use for a query's context timeout
	QueryTimeout = time.Millisecond * 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetMoisture(context.Context, uint, string) (float64, error)
	GetLastContact(context.Context, string) (time.Time, error)
	GetWaterHistory(context.Context, uint, string, time.Duration, uint64) ([]map[string]interface{}, error)
	GetTemperatureAndHumidity(context.Context, string) (float64, float64, error)
	influxdb2.Client
}

Client is an interface that allows querying InfluxDB for data

func NewClient

func NewClient(config Config) Client

NewClient creates an InfluxDB client from the viper config

type Config

type Config struct {
	Address string `mapstructure:"address"`
	Token   string `mapstructure:"token"`
	Org     string `mapstructure:"org"`
	Bucket  string `mapstructure:"bucket"`
}

Config holds configuration values for connecting the the InfluxDB server

type MockClient

type MockClient struct {
	mock.Mock
}

MockClient is an autogenerated mock type for the Client type

func NewMockClient

func NewMockClient(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockClient

NewMockClient creates a new instance of MockClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockClient) APIClient

func (_m *MockClient) APIClient() *domain.Client

APIClient provides a mock function with given fields:

func (*MockClient) AuthorizationsAPI

func (_m *MockClient) AuthorizationsAPI() api.AuthorizationsAPI

AuthorizationsAPI provides a mock function with given fields:

func (*MockClient) BucketsAPI

func (_m *MockClient) BucketsAPI() api.BucketsAPI

BucketsAPI provides a mock function with given fields:

func (*MockClient) Close

func (_m *MockClient) Close()

Close provides a mock function with given fields:

func (*MockClient) DeleteAPI

func (_m *MockClient) DeleteAPI() api.DeleteAPI

DeleteAPI provides a mock function with given fields:

func (*MockClient) GetLastContact

func (_m *MockClient) GetLastContact(_a0 context.Context, _a1 string) (time.Time, error)

GetLastContact provides a mock function with given fields: _a0, _a1

func (*MockClient) GetMoisture

func (_m *MockClient) GetMoisture(_a0 context.Context, _a1 uint, _a2 string) (float64, error)

GetMoisture provides a mock function with given fields: _a0, _a1, _a2

func (*MockClient) GetTemperatureAndHumidity

func (_m *MockClient) GetTemperatureAndHumidity(_a0 context.Context, _a1 string) (float64, float64, error)

GetTemperatureAndHumidity provides a mock function with given fields: _a0, _a1

func (*MockClient) GetWaterHistory

func (_m *MockClient) GetWaterHistory(_a0 context.Context, _a1 uint, _a2 string, _a3 time.Duration, _a4 uint64) ([]map[string]interface{}, error)

GetWaterHistory provides a mock function with given fields: _a0, _a1, _a2, _a3, _a4

func (*MockClient) HTTPService

func (_m *MockClient) HTTPService() http.Service

HTTPService provides a mock function with given fields:

func (*MockClient) Health

func (_m *MockClient) Health(ctx context.Context) (*domain.HealthCheck, error)

Health provides a mock function with given fields: ctx

func (*MockClient) LabelsAPI

func (_m *MockClient) LabelsAPI() api.LabelsAPI

LabelsAPI provides a mock function with given fields:

func (*MockClient) Options

func (_m *MockClient) Options() *influxdb2.Options

Options provides a mock function with given fields:

func (*MockClient) OrganizationsAPI

func (_m *MockClient) OrganizationsAPI() api.OrganizationsAPI

OrganizationsAPI provides a mock function with given fields:

func (*MockClient) Ping

func (_m *MockClient) Ping(ctx context.Context) (bool, error)

Ping provides a mock function with given fields: ctx

func (*MockClient) QueryAPI

func (_m *MockClient) QueryAPI(org string) api.QueryAPI

QueryAPI provides a mock function with given fields: org

func (*MockClient) Ready

func (_m *MockClient) Ready(ctx context.Context) (*domain.Ready, error)

Ready provides a mock function with given fields: ctx

func (*MockClient) ServerURL

func (_m *MockClient) ServerURL() string

ServerURL provides a mock function with given fields:

func (*MockClient) Setup

func (_m *MockClient) Setup(ctx context.Context, username string, password string, org string, bucket string, retentionPeriodHours int) (*domain.OnboardingResponse, error)

Setup provides a mock function with given fields: ctx, username, password, org, bucket, retentionPeriodHours

func (*MockClient) SetupWithToken

func (_m *MockClient) SetupWithToken(ctx context.Context, username string, password string, org string, bucket string, retentionPeriodHours int, token string) (*domain.OnboardingResponse, error)

SetupWithToken provides a mock function with given fields: ctx, username, password, org, bucket, retentionPeriodHours, token

func (*MockClient) TasksAPI

func (_m *MockClient) TasksAPI() api.TasksAPI

TasksAPI provides a mock function with given fields:

func (*MockClient) UsersAPI

func (_m *MockClient) UsersAPI() api.UsersAPI

UsersAPI provides a mock function with given fields:

func (*MockClient) WriteAPI

func (_m *MockClient) WriteAPI(org string, bucket string) api.WriteAPI

WriteAPI provides a mock function with given fields: org, bucket

func (*MockClient) WriteAPIBlocking

func (_m *MockClient) WriteAPIBlocking(org string, bucket string) api.WriteAPIBlocking

WriteAPIBlocking provides a mock function with given fields: org, bucket

Jump to

Keyboard shortcuts

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