mgmthttp

package
v0.3.0-docs.0...-f96dd80 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package mgmthttp implements the Raft management HTTP API public interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBackup

func CreateBackup(api MgmtApi, w http.ResponseWriter, r *http.Request)

CreateBackup creates a backup of the RocksDB data up to now: The http post url is:

POST /backup

The following statuses are expected: If everything is alright, the HTTP status is 200 with an empty body.

func DeleteBackup

func DeleteBackup(api MgmtApi, w http.ResponseWriter, r *http.Request)

DeleteBackup deletes a certain backup (given its ID) from the system: The http post url is:

DELETE /backup?backupID=<id>

The following statuses are expected: If everything is alright, the HTTP status is 204 with an empty body.

func ListBackups

func ListBackups(api MgmtApi) http.HandlerFunc

ListBackups returns a list of backups along with each backup information. The http post url is:

GET /backups

The following statuses are expected: If everything is alright, the HTTP status is 204 and the body contains: [

 {
   "ID":   1,
   "Timestamp": 1523653256854,
   "Size":   16786",
   "NumFiles": 4,
	  "Metadata": "foo"
 },
 {
   "ID":   2,
   "Timestamp": 1523653256999,
   "Size":   21786,
   "NumFiles": 4,
	  "Metadata": "bar"
	},
	...

]

func ManageBackup

func ManageBackup(api MgmtApi) http.HandlerFunc

func NewMgmtHttp

func NewMgmtHttp(api MgmtApi) *http.ServeMux

NewMgmtHttp will return a mux server with endpoints to manage different QED log service features: DDBB backups, Raft membership,...

/backup -> Create or Delete a backup
/backups -> List backups

Types

type MgmtApi

type MgmtApi interface {
	CreateBackup() error
	ListBackups() []*storage.BackupInfo
	DeleteBackup(backupID uint32) error
}

Jump to

Keyboard shortcuts

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