api

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Custom HTTP response header used to report the unique download ID.
	HttpHeaderDownloadID = "X-Prombackup-Download-Id"
)

Variables

View Source
var ArchiveFormatAll = []ArchiveFormat{
	ArchiveTar,
	ArchiveTarGzip,
}

Functions

This section is empty.

Types

type ArchiveFormat

type ArchiveFormat string
const (
	ArchiveTar     ArchiveFormat = "tar"
	ArchiveTarGzip               = "tgz"
)

func (ArchiveFormat) ContentType

func (f ArchiveFormat) ContentType() string

func (ArchiveFormat) FileExtension

func (f ArchiveFormat) FileExtension() string

func (ArchiveFormat) Name

func (f ArchiveFormat) Name() string

func (ArchiveFormat) String

func (f ArchiveFormat) String() string

type DownloadOptions

type DownloadOptions struct {
	// Snapshot name.
	SnapshotName string

	// Requested archive format.
	Format ArchiveFormat

	// Function returning a writer for storing the body returned by the server.
	BodyWriter func(DownloadResult) (io.Writer, error)
}

DownloadOptions are the options available when requesting the download of a snapshot archive.

type DownloadResult

type DownloadResult struct {
	// Unique download ID, used to request the status.
	ID string `json:"id"`

	// Body content type (e.g. "application/x-tar").
	ContentType string

	// Parameters for body content type (e.g. "charset").
	ContentTypeParams map[string]string

	// The preferred filename as reported by the server.
	Filename string
}

DownloadResult contains information about a requested snapshot download.

type DownloadStatus

type DownloadStatus struct {
	// Unique download ID.
	ID string `json:"id"`

	// Requested snapshot name.
	SnapshotName string `json:"snapshot_name"`

	// Finished is non-nil if the server consider the download finished.
	Finished *DownloadStatusFinished `json:"finished"`
}

DownloadStatus contains information about an ongoing or recent download.

type DownloadStatusFinished

type DownloadStatusFinished struct {
	// Success is true if the server encountered no error while generating the
	// snapshot archive.
	Success bool `json:"success"`

	// ErrorText contains a descriptive error message after the server
	// encountered an error.
	ErrorText *string `json:"error_text"`

	// Sha256Hex is the result of the SHA256 algorithm over the downloaded
	// archive.
	Sha256Hex string `json:"sha256_hex"`
}

DownloadStatusFinished contains information about a finished download.

type DownloadStatusOptions

type DownloadStatusOptions struct {
	// Unique download ID.
	ID string `json:"id"`
}

DownloadStatusOptions are the options available when requesting status information about an ongoing or recent download.

type PruneOptions

type PruneOptions struct {
	// Keep all snapshots within this time interval.
	KeepWithin time.Duration `json:"keep_within"`
}

PruneOptions are the options available when requesting pruning of snapshots.

type PruneResult

type PruneResult struct {
}

PruneResult may be used in the future.

type SnapshotOptions

type SnapshotOptions struct {
	// Whether to skip data present in the head block.
	SkipHead bool `json:"skip_head"`
}

SnapshotOptions are the options available for requesting a new snapshot.

type SnapshotResult

type SnapshotResult struct {
	// Snapshot name.
	Name string `json:"name"`
}

SnapshotResult reports the name of a newly created TSDB snapshot.

Jump to

Keyboard shortcuts

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