oas

package module
v0.0.0-...-3b9bd07 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2016 License: GPL-3.0 Imports: 12 Imported by: 2

README

OAS

GoDoc

Aliyun OAS SDK with Go

Not a complete-API SDK

Documentation

Index

Constants

View Source
const (
	OasDefaultContentType    = "application/octet-stream"
	OasDefaultSendBufferSize = 8192
	OasDefaultGetBufferSize  = 10 * 1024 * 1024
	OasDefaultProvider       = "OAS"

	OasHttpPort  = 80
	OasHttpsPort = 443

	OasUseHttps = true
	OasNoHttps  = false

	OasUserAgent = "gooas-OAS Go SDK"

	OasDescNoContent = ""

	OasJobStatusCodeSucceeded  = "Succeeded"
	OasJobStatusCodeInProgress = "InProgress"
	OasJobStatusCodeFailed     = "Failed"
)
View Source
const (
	OasDefineHeaderPrefix = "x-oas-"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorMsg

type ErrorMsg struct {
	Code    string `json:"code"`
	Message string `json:"message"`
	Type    string `json:"type"`
}

func (*ErrorMsg) String

func (e *ErrorMsg) String() string

type JobResult

type JobResult struct {
	Action          string `json:"Action"`
	ArchiveId       string `json:"ArchiveId"`
	ArchiveSize     int    `json:"ArchiveSizeInBytes"`
	TreeEtag        string `json:"TreeEtag"`
	ArchiveTreeEtag string `json:"ArchiveTreeEtag"`
	Completed       bool   `json:"Completed"`
	CompletionDate  string `json:"CompletionDate"`
	CreationDate    string `json:"CreationsDate"`
	InventorySize   int    `json:"InventorySizeInBytes"`
	JobDescription  string `json:"JobDescription"`
	JobId           string `json:"JobId"`
	RetrievalRange  string `json:"RetrievalByteRange"`
	StatusCode      string `json:"StatusCode"`
	StatusMessage   string `json:"StatusMessage"`
}

type OasClient

type OasClient struct {
	// contains filtered or unexported fields
}

目前只实现需要的功能,其他功能需要时才实现 (不知道Go对大文件上传的支持怎样)

func NewOasClient

func NewOasClient(host, apikey, secret string, port int, security bool) *OasClient

func (*OasClient) ArchiveToOas

func (o *OasClient) ArchiveToOas(vaultID, ossHost, bucket,
	path, desc string) (requestId, jobId string, err error)

func (*OasClient) DeleteArchive

func (o *OasClient) DeleteArchive(vaultID, archiveId string) (string, error)

func (*OasClient) GetJobInfo

func (o *OasClient) GetJobInfo(vaultID, jobId string) (requestId string,
	jr *JobResult, err error)

func (*OasClient) ListVaults

func (o *OasClient) ListVaults(limit int, marker string) (requestId string,
	v *VaultsList, err error)

获取Vault列表 当limit值为-1时,limit参数不启用 当marker值为""时,marker参数不启用

func (*OasClient) RecoverToOss

func (o *OasClient) RecoverToOss(vaultID, archiveId, ossHost,
	bucket, path, desc string) (requestId, jobId string, err error)

type VaultInfo

type VaultInfo struct {
	CreationDate      string `json:"CreationDate"`
	LastInventoryDate string `json:"LastInventoryDate"`
	NumberOfArchives  int    `json:"NumberOfArchives"`
	SizeInBytes       int    `json:"SizeInBytes"`
	VaultID           string `json:"VaultID"`
	VaultName         string `json:"VaultName"`
}

type VaultsList

type VaultsList struct {
	Marker    string       `json:"Marker"`
	VaultList []*VaultInfo `json:"VaultList"`
}

Jump to

Keyboard shortcuts

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