protocols

package
v0.0.0-...-c5655c4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2017 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// HTTPPathVersion indicates the version
	HTTPPathVersion = "v1"

	// HTTPPathVolumeSet get/create/delete volume set
	HTTPPathVolumeSet = "volumeset"
	// HTTPPathVolumeSets get all volume sets
	HTTPPathVolumeSets = "volumesets"
	// HTTPPathSnapshots get all snapshots
	HTTPPathSnapshots = "snapshots"
	// HTTPPathBranches get all branches
	HTTPPathBranches = "branches"
	// HTTPPathSnapshotIDs get all snapshot IDs
	HTTPPathSnapshotIDs = "snapshotids"
	// HTTPPathBlob ...
	HTTPPathBlob = "blob"
	// HTTPPathTip get tip of a branch
	HTTPPathTip = "tip"
	// HTTPPathImportBranch Import snapshots by importing a new branch
	HTTPPathImportBranch = "importbranch"
	// HTTPPathForkBranch Import snapshots by forking a new branch
	HTTPPathForkBranch = "forkbranch"
	// HTTPPathExtendBranch Import snapshots by extending an existing branch
	HTTPPathExtendBranch = "extendbranch"
	// HTTPPathOfferBlob offer to push a blob
	HTTPPathOfferBlob = "upload/blob"
	// HTTPPathRequestBlob request to pull a blob
	HTTPPathRequestBlob = "download/blob"
	// HTTPPathSnapshotByBranch obtains snapshots of a branch
	HTTPPathSnapshotByBranch = "snapshotsbybranch"
	// HTTPPathStats get stats
	HTTPPathStats = "stats"
	// HTTPPathNewDataServer put data server url
	HTTPPathNewDataServer = "dataserver"
	// HTTPPathUpdateVolumeSet ...
	HTTPPathUpdateVolumeSet = "update/volumeset"
	// HTTPPathPullVolumeSet ...
	HTTPPathPullVolumeSet = "pull/volumeset"
	// HTTPPathUpdateSnapshot ...
	HTTPPathUpdateSnapshot = "update/snapshot"
	// HTTPPathUpdateSnapshots ...
	HTTPPathUpdateSnapshots = "update/snapshots"
	// HTTPPathPullSnapshots ...
	HTTPPathPullSnapshots = "pull/snapshots"

	// HTTPReqUploadBlob upload a blob with token
	HTTPReqUploadBlob = "upload"
	// HTTPReqDownloadBlob download a blob with token
	HTTPReqDownloadBlob = "download"
	// HTTPFieldToken token field use as a parameter in blob upload/download requests
	HTTPFieldToken = "token"

	// HTTPPathUploadToken get upload token
	HTTPPathUploadToken = "upload/token"
	// HTTPPathDownloadToken get download token
	HTTPPathDownloadToken = "download/token"

	// HTTPPathUploadStatus upload status
	HTTPPathUploadStatus = "upload/status"
	// HTTPPathDownloadStatus download status
	HTTPPathDownloadStatus = "download/status"

	// HTTPPathAnalytics ...
	HTTPPathAnalytics = "analytics"
)
View Source
const (
	// HTTPPathUsage quries the usage given a list of volumesets.
	HTTPPathUsage = "usage"
)
View Source
const VerifyCert = false

VerifyCert ..

Variables

View Source
var ErrHTTPXferTimeout = "HTTP Transfer Timeout"

ErrHTTPXferTimeout transfer timed out error

Functions

func GenerateCorrelationID

func GenerateCorrelationID() string

GenerateCorrelationID generates a GUID.

func GetCorrelationID

func GetCorrelationID(r *http.Request) string

GetCorrelationID obtains the correlationID from the header.

func SetCorrelationID

func SetCorrelationID(r *http.Request, correlationID string)

SetCorrelationID sets the correslation ID for the header.

Types

type Client

type Client struct {
	*http.Client
}

Client is a wrapper to the http.Client.

func GetClient

func GetClient() *Client

GetClient returns a client to be used to send requests. Our code should always this function instead of directly creating http.Client{}.

func (*Client) Do

func (c *Client) Do(req *http.Request) (*http.Response, error)

Do ...

type ReqBlobID

type ReqBlobID struct {
	ID blob.ID
}

ReqBlobID ...

type ReqBranch

type ReqBranch struct {
	VolSetID volumeset.ID
	Branch   string
}

ReqBranch ..

type ReqDataServerStats

type ReqDataServerStats struct {
	VolumeSetID volumeset.ID
}

ReqDataServerStats returns stats of storage or a volume set If volume set id is given, it returns the stats of the volume set; otherwise, returns stats of the storage

type ReqDownloadToken

type ReqDownloadToken struct {
	VolumeSetID  volumeset.ID
	BaseBlobID   blob.ID
	TargetBlobID blob.ID
}

ReqDownloadToken ...

type ReqDownloadTokenStatus

type ReqDownloadTokenStatus struct {
	Token  string
	Status string
}

ReqDownloadTokenStatus ..

type ReqExtendBranch

type ReqExtendBranch struct {
	Snapshots []*snapshot.Snapshot
}

ReqExtendBranch ..

type ReqForkBranch

type ReqForkBranch struct {
	Branch    string
	Snapshots []*snapshot.Snapshot
}

ReqForkBranch ..

type ReqGetBranches

type ReqGetBranches struct {
	branch.Query
}

ReqGetBranches ..

type ReqGetSnapshotIDs

type ReqGetSnapshotIDs struct {
	VolSetID volumeset.ID
}

ReqGetSnapshotIDs ..

type ReqGetSnapshots

type ReqGetSnapshots struct {
	snapshot.Query
}

ReqGetSnapshots ..

type ReqGetVolumeSets

type ReqGetVolumeSets struct {
	volumeset.Query
}

ReqGetVolumeSets ...

type ReqImportBranch

type ReqImportBranch struct {
	ID        branch.ID
	Branch    string
	Snapshots []*snapshot.Snapshot
}

ReqImportBranch ..

type ReqSnapshot

type ReqSnapshot struct {
	Snapshot *snapshot.Snapshot
}

ReqSnapshot ...

type ReqSnapshotID

type ReqSnapshotID struct {
	ID snapshot.ID `json:"id"`
}

ReqSnapshotID ...

type ReqSyncBlob

type ReqSyncBlob struct {
	VolSetID         volumeset.ID
	TargetID         snapshot.ID
	BaseCandidateIDs []snapshot.ID
}

ReqSyncBlob ..

type ReqURL

type ReqURL struct {
	URL string
}

ReqURL ..

type ReqUpdateSnapshot

type ReqUpdateSnapshot struct {
	SnapInit *snapshot.Snapshot `json:"snap_init"`
	SnapCur  *snapshot.Snapshot `json:"snap_cur"`
}

ReqUpdateSnapshot ...

type ReqUpdateSnapshots

type ReqUpdateSnapshots struct {
	Snaps []*metastore.SnapshotPair `json:"snap_pairs"`
}

ReqUpdateSnapshots ...

type ReqUpdateVolumeSet

type ReqUpdateVolumeSet struct {
	VolSetInit *volumeset.VolumeSet `json:"volset_init"`
	VolSetCur  *volumeset.VolumeSet `json:"volset_cur"`
}

ReqUpdateVolumeSet ...

type ReqUploadToken

type ReqUploadToken struct {
	VolumeSetID volumeset.ID
	SnapshotID  snapshot.ID
	BaseBlobID  blob.ID
}

ReqUploadToken ...

type ReqUploadTokenStatus

type ReqUploadTokenStatus struct {
	Token  string
	BlobID blob.ID
	Size   uint64
	Status string
}

ReqUploadTokenStatus ..

type ReqUsage

type ReqUsage struct {
	Volumesets []volumeset.ID `json:"volumesets"`
}

ReqUsage ..

type ReqVolSet

type ReqVolSet struct {
	VolSet *volumeset.VolumeSet
}

ReqVolSet ..

type ReqVolSetID

type ReqVolSetID struct {
	ID volumeset.ID `json:"id"`
}

ReqVolSetID ...

type RespDataServerStats

type RespDataServerStats struct {
	DiskSize uint64
	Used     uint64
}

RespDataServerStats is the struct for reporting data server stats

type RespGetBranches

type RespGetBranches struct {
	Total    int              `json:"total_branches"`
	Branches []*branch.Branch `json:"branches"`
}

RespGetBranches ..

type RespGetSnapshotIDs

type RespGetSnapshotIDs struct {
	IDs []snapshot.ID `json:"ids"`
}

RespGetSnapshotIDs ..

type RespGetSnapshots

type RespGetSnapshots struct {
	Total     int                  `json:"total_snapshots"`
	Snapshots []*snapshot.Snapshot `json:"snapshots"`
}

RespGetSnapshots ..

type RespGetTip

type RespGetTip struct {
	Snapshot *snapshot.Snapshot
}

RespGetTip ...

type RespGetVolumeSets

type RespGetVolumeSets struct {
	Total      int                    `json:"total_volumesets"`
	VolumeSets []*volumeset.VolumeSet `json:"volumesets"`
}

RespGetVolumeSets ..

type RespSyncBlob

type RespSyncBlob struct {
	Token               string
	DataServerPublicURL string
	BaseSnapshotID      snapshot.ID
}

RespSyncBlob ..

type RespToken

type RespToken struct {
	Token               string
	DataServerPublicURL string
}

RespToken is the response from DS to DP when DP request either a upload or download token.

type RespUpdateSnapshot

type RespUpdateSnapshot struct {
	SnapMetaConfl metastore.SnapMetaConflict `json:"snap_meta_confl"`
}

RespUpdateSnapshot ..

type RespUpdateSnapshots

type RespUpdateSnapshots struct {
	SnapMetaConfls []metastore.SnapMetaConflict `json:"snap_meta_confls"`
}

RespUpdateSnapshots ..

type RespUpdateVolumeSet

type RespUpdateVolumeSet struct {
	VSMetaConfl metastore.VSMetaConflict `json:"vs_meta_confl"`
}

RespUpdateVolumeSet ..

type RespUsage

type RespUsage struct {
	TotalBytes string `json:"total_bytes"`
}

RespUsage ..

type RespVolSet

type RespVolSet struct {
	VolSet *volumeset.VolumeSet
	Err    error
}

RespVolSet ..

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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