clients

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns whether the error is of type NotFound.

func NewClient

func NewClient(ctx context.Context, kube client.Client, mg resource.Managed) (influxdbv2.Client, error)

NewClient returns the base InfluxDB client.

func NewClientWithResponses

func NewClientWithResponses(ctx context.Context, kube client.Client, mg resource.Managed) (*domain.ClientWithResponses, error)

NewClientWithResponses returns the bare client. Use this only if NewClient does not meet your needs.

Types

type BucketsAPI

type BucketsAPI interface {
	// CreateBucket creates a new bucket.
	CreateBucket(ctx context.Context, bucket *domain.Bucket) (*domain.Bucket, error)

	// FindBucketByName returns a bucket found using bucketName.
	FindBucketByName(ctx context.Context, bucketName string) (*domain.Bucket, error)

	// UpdateBucket updates a bucket.
	UpdateBucket(ctx context.Context, bucket *domain.Bucket) (*domain.Bucket, error)

	// DeleteBucket deletes a bucket.
	DeleteBucket(ctx context.Context, bucket *domain.Bucket) error
}

BucketsAPI is the set of calls we make in controllers that use Buckets API.

type DBRPsAPI

type DBRPsAPI interface {
	PostDBRPWithResponse(ctx context.Context, params *domain.PostDBRPParams, body domain.PostDBRPJSONRequestBody) (*domain.PostDBRPResponse, error)
	GetDBRPsWithResponse(ctx context.Context, params *domain.GetDBRPsParams) (*domain.GetDBRPsResponse, error)
	PatchDBRPIDWithResponse(ctx context.Context, dbrpID string, params *domain.PatchDBRPIDParams, body domain.PatchDBRPIDJSONRequestBody) (*domain.PatchDBRPIDResponse, error)
	DeleteDBRPIDWithResponse(ctx context.Context, dbrpID string, params *domain.DeleteDBRPIDParams) (*domain.DeleteDBRPIDResponse, error)
}

DBRPsAPI is the set of calls we make in controllers that use DBRPs API.

type MockBucketsAPI

type MockBucketsAPI struct {
	CreateBucketFn     func(ctx context.Context, org *domain.Bucket) (*domain.Bucket, error)
	FindBucketByNameFn func(ctx context.Context, orgName string) (*domain.Bucket, error)
	UpdateBucketFn     func(ctx context.Context, org *domain.Bucket) (*domain.Bucket, error)
	DeleteBucketFn     func(ctx context.Context, org *domain.Bucket) error
}

MockBucketsAPI mocks BucketsAPI.

func (*MockBucketsAPI) CreateBucket

func (m *MockBucketsAPI) CreateBucket(ctx context.Context, org *domain.Bucket) (*domain.Bucket, error)

CreateBucket calls CreateBucketFn.

func (*MockBucketsAPI) DeleteBucket

func (m *MockBucketsAPI) DeleteBucket(ctx context.Context, org *domain.Bucket) error

DeleteBucket calls DeleteBucketFn.

func (*MockBucketsAPI) FindBucketByName

func (m *MockBucketsAPI) FindBucketByName(ctx context.Context, orgName string) (*domain.Bucket, error)

FindBucketByName calls FindBucketByNameFn.

func (*MockBucketsAPI) UpdateBucket

func (m *MockBucketsAPI) UpdateBucket(ctx context.Context, org *domain.Bucket) (*domain.Bucket, error)

UpdateBucket calls UpdateBucketFn.

type MockDBRPsAPI

type MockDBRPsAPI struct {
	PostDBRPWithResponseFn     func(ctx context.Context, params *domain.PostDBRPParams, body domain.PostDBRPJSONRequestBody) (*domain.PostDBRPResponse, error)
	GetDBRPsWithResponseFn     func(ctx context.Context, params *domain.GetDBRPsParams) (*domain.GetDBRPsResponse, error)
	PatchDBRPIDWithResponseFn  func(ctx context.Context, dbrpID string, params *domain.PatchDBRPIDParams, body domain.PatchDBRPIDJSONRequestBody) (*domain.PatchDBRPIDResponse, error)
	DeleteDBRPIDWithResponseFn func(ctx context.Context, dbrpID string, params *domain.DeleteDBRPIDParams) (*domain.DeleteDBRPIDResponse, error)
}

MockDBRPsAPI mocks DBRPsAPI.

func (*MockDBRPsAPI) DeleteDBRPIDWithResponse

func (m *MockDBRPsAPI) DeleteDBRPIDWithResponse(ctx context.Context, dbrpID string, params *domain.DeleteDBRPIDParams) (*domain.DeleteDBRPIDResponse, error)

DeleteDBRPIDWithResponse calls DeleteDBRPIDWithResponseFn..

func (*MockDBRPsAPI) GetDBRPsWithResponse

func (m *MockDBRPsAPI) GetDBRPsWithResponse(ctx context.Context, params *domain.GetDBRPsParams) (*domain.GetDBRPsResponse, error)

GetDBRPsWithResponse calls GetDBRPsWithResponseFn.

func (*MockDBRPsAPI) PatchDBRPIDWithResponse

func (m *MockDBRPsAPI) PatchDBRPIDWithResponse(ctx context.Context, dbrpID string, params *domain.PatchDBRPIDParams, body domain.PatchDBRPIDJSONRequestBody) (*domain.PatchDBRPIDResponse, error)

PatchDBRPIDWithResponse calls PatchDBRPIDWithResponseFn.

func (*MockDBRPsAPI) PostDBRPWithResponse

PostDBRPWithResponse calls PostDBRPWithResponseFn.

type MockOrganizationsAPI

type MockOrganizationsAPI struct {
	CreateOrganizationFn     func(ctx context.Context, org *domain.Organization) (*domain.Organization, error)
	FindOrganizationByNameFn func(ctx context.Context, orgName string) (*domain.Organization, error)
	UpdateOrganizationFn     func(ctx context.Context, org *domain.Organization) (*domain.Organization, error)
	DeleteOrganizationFn     func(ctx context.Context, org *domain.Organization) error
}

MockOrganizationsAPI mocks OrganizationsAPI.

func (*MockOrganizationsAPI) CreateOrganization

func (m *MockOrganizationsAPI) CreateOrganization(ctx context.Context, org *domain.Organization) (*domain.Organization, error)

CreateOrganization calls CreateOrganizationFn.

func (*MockOrganizationsAPI) DeleteOrganization

func (m *MockOrganizationsAPI) DeleteOrganization(ctx context.Context, org *domain.Organization) error

DeleteOrganization calls DeleteOrganizationFn.

func (*MockOrganizationsAPI) FindOrganizationByName

func (m *MockOrganizationsAPI) FindOrganizationByName(ctx context.Context, orgName string) (*domain.Organization, error)

FindOrganizationByName calls FindOrganizationByNameFn.

func (*MockOrganizationsAPI) UpdateOrganization

func (m *MockOrganizationsAPI) UpdateOrganization(ctx context.Context, org *domain.Organization) (*domain.Organization, error)

UpdateOrganization calls UpdateOrganizationFn.

type OrganizationsAPI

type OrganizationsAPI interface {
	// CreateOrganization creates new organization.
	CreateOrganization(ctx context.Context, org *domain.Organization) (*domain.Organization, error)

	// FindOrganizationByName returns an organization found using orgName.
	FindOrganizationByName(ctx context.Context, orgName string) (*domain.Organization, error)

	// UpdateOrganization updates organization.
	UpdateOrganization(ctx context.Context, org *domain.Organization) (*domain.Organization, error)

	// DeleteOrganization deletes an organization.
	DeleteOrganization(ctx context.Context, org *domain.Organization) error
}

OrganizationsAPI is the set of calls we make in controllers that use Organizations API.

Jump to

Keyboard shortcuts

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