Documentation ¶
Index ¶
- Variables
- func CleanUp() (c *cache)
- func NewCache() (c *cache)
- type ConfigCreateArchive
- type ConfigCreateSSHBucketFromScratch
- type OnlineAPI
- func (o *OnlineAPI) CleanUpCache()
- func (o *OnlineAPI) CreateArchive(config ConfigCreateArchive) (uuid string, err error)
- func (o *OnlineAPI) CreateSSHBucketFromScratch(c ConfigCreateSSHBucketFromScratch) (uuidSafe, uuidArchive string, bucket OnlineGetBucket, err error)
- func (o *OnlineAPI) CreateSafe(name, desc string) (uuid string, err error)
- func (o *OnlineAPI) DeleteArchive(uuidSafe, uuidArchive string) (err error)
- func (o *OnlineAPI) DeleteSafe(uuid string) (err error)
- func (o *OnlineAPI) FetchRessources() (err error)
- func (o *OnlineAPI) FindSafeUUIDFromArchive(archive string, useCache bool) (safe OnlineGetSafe, uuidArchive string, err error)
- func (o *OnlineAPI) GetAllArchives() (archives []OnlineGetArchive, err error)
- func (o *OnlineAPI) GetArchive(uuidSafe, uuidArchive string, useCache bool) (archive OnlineGetArchive, err error)
- func (o *OnlineAPI) GetArchives(uuidSafe string, useCache bool) (archives []OnlineGetArchive, err error)
- func (o *OnlineAPI) GetBucket(uuidSafe, uuidArchive string) (bucket OnlineGetBucket, err error)
- func (o *OnlineAPI) GetJob(uuidSafe, uuidArchive, uuidJob string) (job OnlineGetJob, err error)
- func (o *OnlineAPI) GetJobs(uuidSafe, uuidArchive string) (jobs []OnlineGetJob, err error)
- func (o *OnlineAPI) GetLocations(uuidSafe, uuidArchive string) (loc []OnlineGetLocation, err error)
- func (o *OnlineAPI) GetPlatform(uuid string) (platform OnlineGetPlatform, err error)
- func (o *OnlineAPI) GetPlatforms() (platform []OnlineGetPlatform, err error)
- func (o *OnlineAPI) GetSSHKey(uuid string) (key OnlineGetSSHKey, err error)
- func (o *OnlineAPI) GetSSHKeys() (keys []OnlineGetSSHKey, err error)
- func (o *OnlineAPI) GetSafe(uuid string) (safe OnlineGetSafe, err error)
- func (o *OnlineAPI) GetSafes(useCache bool) (safes []OnlineGetSafe, err error)
- func (o *OnlineAPI) PatchArchive(uuidSafe, uuidArchive string, data OnlinePatchArchive) (err error)
- func (o *OnlineAPI) PostArchive(uuidSafe, uuidArchive string) (uuid string, err error)
- func (o *OnlineAPI) PostUnArchive(uuidSafe, uuidArchive string, data OnlinePostUnArchive) (err error)
- func (o *OnlineAPI) PostVerify(uuidSafe, uuidArchive, uuidLocation string) (err error)
- type OnlineBucketCredentials
- type OnlineError
- type OnlineGetArchive
- type OnlineGetArchives
- type OnlineGetBucket
- type OnlineGetJob
- type OnlineGetLocation
- type OnlineGetPlatform
- type OnlineGetSSHKey
- type OnlineGetSafe
- type OnlinePatchArchive
- type OnlinePostArchive
- type OnlinePostResult
- type OnlinePostSafe
- type OnlinePostUnArchive
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// APIUrl represents Online's endpoint
APIUrl = "https://api.online.net/api/v1"
)
Functions ¶
Types ¶
type ConfigCreateArchive ¶
type OnlineAPI ¶
type OnlineAPI struct {
// contains filtered or unexported fields
}
OnlineAPI is used to communicate with Online API
func (*OnlineAPI) CleanUpCache ¶
func (o *OnlineAPI) CleanUpCache()
func (*OnlineAPI) CreateArchive ¶
func (o *OnlineAPI) CreateArchive(config ConfigCreateArchive) (uuid string, err error)
func (*OnlineAPI) CreateSSHBucketFromScratch ¶
func (o *OnlineAPI) CreateSSHBucketFromScratch(c ConfigCreateSSHBucketFromScratch) (uuidSafe, uuidArchive string, bucket OnlineGetBucket, err error)
CreateSSHBucketFromScratch creates a safe, an archive and returns the bucket available over SSH
func (*OnlineAPI) CreateSafe ¶
func (*OnlineAPI) DeleteArchive ¶
func (*OnlineAPI) DeleteSafe ¶
func (*OnlineAPI) FetchRessources ¶
FetchRessources get the ressources to fill the cache
func (*OnlineAPI) FindSafeUUIDFromArchive ¶
func (*OnlineAPI) GetAllArchives ¶
func (o *OnlineAPI) GetAllArchives() (archives []OnlineGetArchive, err error)
func (*OnlineAPI) GetArchive ¶
func (o *OnlineAPI) GetArchive(uuidSafe, uuidArchive string, useCache bool) (archive OnlineGetArchive, err error)
func (*OnlineAPI) GetArchives ¶
func (o *OnlineAPI) GetArchives(uuidSafe string, useCache bool) (archives []OnlineGetArchive, err error)
func (*OnlineAPI) GetBucket ¶
func (o *OnlineAPI) GetBucket(uuidSafe, uuidArchive string) (bucket OnlineGetBucket, err error)
func (*OnlineAPI) GetJob ¶
func (o *OnlineAPI) GetJob(uuidSafe, uuidArchive, uuidJob string) (job OnlineGetJob, err error)
func (*OnlineAPI) GetJobs ¶
func (o *OnlineAPI) GetJobs(uuidSafe, uuidArchive string) (jobs []OnlineGetJob, err error)
func (*OnlineAPI) GetLocations ¶
func (o *OnlineAPI) GetLocations(uuidSafe, uuidArchive string) (loc []OnlineGetLocation, err error)
func (*OnlineAPI) GetPlatform ¶
func (o *OnlineAPI) GetPlatform(uuid string) (platform OnlineGetPlatform, err error)
GetPlatform returns a platform
func (*OnlineAPI) GetPlatforms ¶
func (o *OnlineAPI) GetPlatforms() (platform []OnlineGetPlatform, err error)
GetPlatforms returns a list of platform
func (*OnlineAPI) GetSSHKey ¶
func (o *OnlineAPI) GetSSHKey(uuid string) (key OnlineGetSSHKey, err error)
func (*OnlineAPI) GetSSHKeys ¶
func (o *OnlineAPI) GetSSHKeys() (keys []OnlineGetSSHKey, err error)
func (*OnlineAPI) GetSafe ¶
func (o *OnlineAPI) GetSafe(uuid string) (safe OnlineGetSafe, err error)
GetSafe returns a safe
func (*OnlineAPI) GetSafes ¶
func (o *OnlineAPI) GetSafes(useCache bool) (safes []OnlineGetSafe, err error)
GetSafes returns a list of safe
func (*OnlineAPI) PatchArchive ¶
func (o *OnlineAPI) PatchArchive(uuidSafe, uuidArchive string, data OnlinePatchArchive) (err error)
func (*OnlineAPI) PostArchive ¶
func (*OnlineAPI) PostUnArchive ¶
func (o *OnlineAPI) PostUnArchive(uuidSafe, uuidArchive string, data OnlinePostUnArchive) (err error)
func (*OnlineAPI) PostVerify ¶
type OnlineBucketCredentials ¶
type OnlineBucketCredentials struct { Login string `json:"login"` Password string `json:"password"` Protocol string `json:"protocol"` SSHKeys []OnlineGetSSHKey `json:"ssh_keys"` URI string `json:"uri"` }
type OnlineError ¶
type OnlineError struct { Why string `json:"error"` Code int `json:"code"` StatusCode int `json:"-"` }
OnlineError represents the structure returned by the Online API when an error occurred
func (OnlineError) Error ¶
func (o OnlineError) Error() string
type OnlineGetArchive ¶
type OnlineGetArchive struct { // _ref string `json:"$ref"` CreationDate string `json:"creation_date"` Description string `json:"description"` Name string `json:"name"` Parity string `json:"parity"` Status string `json:"status"` UUIDRef string `json:"uuid_ref"` Size string `json:"size"` Jobs []OnlineGetJob `json:"current_jobs,omitempty"` Safe OnlineGetSafe `json:"safe"` }
type OnlineGetArchives ¶
type OnlineGetArchives []OnlineGetArchive
func (OnlineGetArchives) Len ¶
func (o OnlineGetArchives) Len() int
func (OnlineGetArchives) Less ¶
func (o OnlineGetArchives) Less(i, j int) bool
func (OnlineGetArchives) Swap ¶
func (o OnlineGetArchives) Swap(i, j int)
type OnlineGetBucket ¶
type OnlineGetBucket struct { // _ref string `json:"$ref"` ArchivalDate string `json:"archival_date"` Credentials []OnlineBucketCredentials `json:"credentials"` Status string `json:"status"` UUIDRef string `json:"uuid_ref"` }
type OnlineGetJob ¶
type OnlineGetLocation ¶
type OnlineGetPlatform ¶
type OnlineGetPlatform struct { // _ref string `json:"$ref"` Datacenter string `json:"datacenter"` ID int `json:"id"` Name string `json:"name"` }
OnlineGetPlatform represents the reponse of a GET /platform/UUID
type OnlineGetSSHKey ¶
type OnlineGetSafe ¶
type OnlineGetSafe struct { // _ref string `json:"$ref"` Description string `json:"description"` Name string `json:"name"` Status string `json:"status"` UUIDRef string `json:"uuid_ref"` }
OnlineGetSafe represents the response of a GET /safe/UUID
type OnlinePatchArchive ¶
type OnlinePostArchive ¶
type OnlinePostArchive struct { Name string `json:"name"` Description string `json:"description"` Parity string `json:"parity,omitempty"` Protocols []string `json:"protocols"` SSHKeys []string `json:"ssh_keys"` Platforms []string `json:"platforms"` Days int `json:"days"` LargeBucket bool `json:"large_bucket"` Crypto string `json:"crypto"` }
type OnlinePostResult ¶
type OnlinePostSafe ¶
type OnlinePostUnArchive ¶
Click to show internal directories.
Click to hide internal directories.