qcloud

package
v0.0.0-...-a9fc4e5 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2016 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QCLOUD_SECRETID  = "QCLOUD_SECRETID"
	QCLOUD_SECRETKEY = "QCLOUD_SECRETKEY"
)
View Source
const (
	LvlError loggerLevel = iota
	LvlWarn
	LvlInfo
	LvlDebug
)
View Source
const (
	PARAM_ERROR = internal_sdk_error_code_base + iota
)

Variables

This section is empty.

Functions

func NewError

func NewError(code int, codeDesc, message string) error

func NewParamError

func NewParamError(msg string) error

Types

type CbsService

type CbsService interface {
	DescribeCbsStorages(diskType *string, payMode *string) (*DescribeCbsStoragesResponse, error)
}

func NewCbsService

func NewCbsService(engine QcloudEngine) CbsService

type CvmService

type CvmService interface {
	DescribeInstances(status *int, zoneId *int) (*DescribeInstancesResponse, error)
}

func NewCvmService

func NewCvmService(engine QcloudEngine) CvmService

type DescribeCbsStoragesResponse

type DescribeCbsStoragesResponse struct {
	Code     int    `json:"code,omitempty"`
	CodeDesc string `json:"codeDesc,omitempty"`
	Message  string `json:"message,omitempty"`
}

type DescribeInstancesResponse

type DescribeInstancesResponse struct {
	Code     int    `json:"code,omitempty"`
	CodeDesc string `json:"codeDesc,omitempty"`
	Message  string `json:"message,omitempty"`
}

type Error

type Error struct {
	Code     int
	CodeDesc string
	Message  string
}

func (Error) Error

func (e Error) Error() string

type Formatter

type Formatter interface {
	Format(level loggerLevel, msg string, ctx ...interface{}) []byte
}

type Logger

type Logger interface {
	Error(msg string, ctx ...interface{})
	Warn(msg string, ctx ...interface{})
	Info(msg string, ctx ...interface{})
	Debug(msg string, ctx ...interface{})
}

func NewLogger

func NewLogger(writer io.Writer, formatter Formatter) Logger

type QcloudEngine

type QcloudEngine interface {
	WithRegion(region string) QcloudEngine
	WithSecret(secretId, secretKey string) QcloudEngine
	WithLogger(logger Logger) QcloudEngine
	DoRequest(componetUrl, action string, content map[string]interface{}, rspObj interface{}) error
	GetLogger() Logger
}

func NewQcloudEngine

func NewQcloudEngine() QcloudEngine

Jump to

Keyboard shortcuts

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