dblabapi

package
v3.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package dblabapi provides a client for Database Lab HTTP API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client provides a Database Lab API client.

func NewClient

func NewClient(options Options) (*Client, error)

NewClient constructs a new Client struct.

func (*Client) CreateClone

func (c *Client) CreateClone(ctx context.Context, cloneRequest types.CloneCreateRequest) (*models.Clone, error)

CreateClone creates a new Database Lab clone.

func (*Client) CreateCloneAsync

func (c *Client) CreateCloneAsync(ctx context.Context, cloneRequest types.CloneCreateRequest) (*models.Clone, error)

CreateCloneAsync asynchronously creates a new Database Lab clone.

func (*Client) DestroyClone

func (c *Client) DestroyClone(ctx context.Context, cloneID string) error

DestroyClone destroys a Database Lab clone.

func (*Client) DestroyCloneAsync

func (c *Client) DestroyCloneAsync(ctx context.Context, cloneID string) error

DestroyCloneAsync asynchronously destroys a Database Lab clone.

func (*Client) Do

func (c *Client) Do(ctx context.Context, request *http.Request) (response *http.Response, err error)

Do makes an HTTP request.

func (*Client) DownloadArtifact

func (c *Client) DownloadArtifact(ctx context.Context, cloneID, sessionID, artifactType string) (io.ReadCloser, error)

DownloadArtifact downloads clone observation artifacts.

func (*Client) Estimate

func (c *Client) Estimate(ctx context.Context, cloneID, pid string) (*EstimatorClient, error)

Estimate creates connection for estimation session.

func (*Client) GetClone

func (c *Client) GetClone(ctx context.Context, cloneID string) (*models.Clone, error)

GetClone returns info about a Database Lab clone.

func (*Client) GetCloneRaw

func (c *Client) GetCloneRaw(ctx context.Context, cloneID string) (io.ReadCloser, error)

GetCloneRaw returns raw info about a Database Lab clone.

func (*Client) Health

func (c *Client) Health(ctx context.Context) (*models.Engine, error)

Health provides instance health info.

func (*Client) ListClones

func (c *Client) ListClones(ctx context.Context) ([]*models.Clone, error)

ListClones provides a list of Database Lab clones.

func (*Client) ListClonesRaw

func (c *Client) ListClonesRaw(ctx context.Context) (io.ReadCloser, error)

ListClonesRaw provides a raw list of Database Lab clones.

func (*Client) ListSnapshots

func (c *Client) ListSnapshots(ctx context.Context) ([]*models.Snapshot, error)

ListSnapshots provides a snapshot list.

func (*Client) ListSnapshotsRaw

func (c *Client) ListSnapshotsRaw(ctx context.Context) (io.ReadCloser, error)

ListSnapshotsRaw provides a snapshot list in raw format.

func (*Client) ResetClone

func (c *Client) ResetClone(ctx context.Context, cloneID string, params types.ResetCloneRequest) error

ResetClone resets a Database Lab clone session.

func (*Client) ResetCloneAsync

func (c *Client) ResetCloneAsync(ctx context.Context, cloneID string, params types.ResetCloneRequest) error

ResetCloneAsync asynchronously resets a Database Lab clone session.

func (*Client) StartObservation

func (c *Client) StartObservation(ctx context.Context, startRequest types.StartObservationRequest) (*observer.Session, error)

StartObservation starts a new clone observation.

func (*Client) Status

func (c *Client) Status(ctx context.Context) (*models.InstanceStatus, error)

Status provides an instance status.

func (*Client) StatusRaw

func (c *Client) StatusRaw(ctx context.Context) (io.ReadCloser, error)

StatusRaw provides a raw instance status.

func (*Client) StopObservation

func (c *Client) StopObservation(ctx context.Context, stopRequest types.StopObservationRequest) (*observer.Session, error)

StopObservation stops the clone observation.

func (*Client) SummaryObservation

func (c *Client) SummaryObservation(ctx context.Context, cloneID, sessionID string) (*observer.SummaryArtifact, error)

SummaryObservation returns the summary of clone observation.

func (*Client) URL

func (c *Client) URL(endpoint string) *url.URL

URL builds URL for a specific endpoint.

func (*Client) UpdateClone

func (c *Client) UpdateClone(ctx context.Context, cloneID string, updateRequest types.CloneUpdateRequest) (*models.Clone, error)

UpdateClone updates an existing Database Lab clone.

type EstimatorClient

type EstimatorClient struct {
	// contains filtered or unexported fields
}

EstimatorClient defines a client to perform timing estimation.

func (*EstimatorClient) Close

func (e *EstimatorClient) Close() error

Close closes connection.

func (*EstimatorClient) ReadResult

func (e *EstimatorClient) ReadResult() estimator.Result

ReadResult returns estimation results.

func (*EstimatorClient) SetReadBlocks

func (e *EstimatorClient) SetReadBlocks(readBlocks uint64) error

SetReadBlocks sends a number of read blocks.

func (*EstimatorClient) Wait

func (e *EstimatorClient) Wait() chan struct{}

Wait waits for connection readiness.

type Options

type Options struct {
	Host              string
	VerificationToken string
	Insecure          bool
	RequestTimeout    time.Duration
}

Options describes options of a Database Lab API client.

Directories

Path Synopsis
Package types provides request structures for Database Lab HTTP API.
Package types provides request structures for Database Lab HTTP API.

Jump to

Keyboard shortcuts

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