Version: v2.4.0 Latest Latest

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

Go to latest
Published: Jul 9, 2021 License: AGPL-3.0 Imports: 20 Imported by: 0



Package dblabapi provides a client for Database Lab HTTP API.



This section is empty.


This section is empty.


This section is empty.


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 added in v2.4.0

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

DownloadArtifact downloads clone observation artifacts.

func (*Client) Estimate added in v2.4.0

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) Health

func (c *Client) Health(ctx context.Context) (*models.Health, 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) ListSnapshots

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

ListSnapshots provides a snapshot list.

func (*Client) ResetClone

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

ResetClone resets a Database Lab clone session.

func (*Client) ResetCloneAsync

func (c *Client) ResetCloneAsync(ctx context.Context, cloneID string) 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) StopObservation

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

StopObservation stops the clone observation.

func (*Client) SummaryObservation added in v2.4.0

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 added in v2.4.0

type EstimatorClient struct {
	// contains filtered or unexported fields

EstimatorClient defines a client to perform timing estimation.

func (*EstimatorClient) Close added in v2.4.0

func (e *EstimatorClient) Close() error

Close closes connection.

func (*EstimatorClient) ReadResult added in v2.4.0

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

ReadResult returns estimation results.

func (*EstimatorClient) SetReadBlocks added in v2.4.0

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

SetReadBlocks sends a number of read blocks.

func (*EstimatorClient) Wait added in v2.4.0

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.


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
t or T : Toggle theme light dark auto
y or Y : Canonical URL