core

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2018 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const PWD = `github.com/tencentcloudplatform/tcpicli/core`
View Source
const (
	VERSION = "1.0.0"
)

Variables

View Source
var Endpoint = map[string]string{
	"vpc":       "vpc.api.qcloud.com/v2/index.php",
	"cdn":       "cdn.api.qcloud.com/v2/index.php",
	"cvm":       "cvm.api.qcloud.com/v2/index.php",
	"cvm3.0":    "cvm.tencentcloudapi.com/",
	"ccs":       "ccs.api.qcloud.com/v2/index.php",
	"account":   "account.api.qcloud.com/v2/index.php",
	"dfw":       "dfw.api.qcloud.com/v2/index.php",
	"redis":     "redis.api.qcloud.com/v2/index.php",
	"img":       "image.api.qcloud.com/v2/index.php",
	"eip":       "eip.api.qcloud.com/v2/index.php",
	"lb":        "lb.api.qcloud.com/v2/index.php",
	"vod":       "vod.api.qcloud.com/v2/index.php",
	"ckafka":    "ckafka.api.qcloud.com/v2/index.php",
	"trade":     "trade.api.qcloud.com/v2/index.php",
	"feecenter": "feecenter.api.qcloud.com/v2/index.php",
}

cmq endpoint def lives in tcpicli/core/utils.go

Functions

func AssignParams

func AssignParams(params map[string]interface{}, options ...string) error

func CmqEndPoint added in v1.3.0

func CmqEndPoint(action string, options ...string) string

func CreateProfile

func CreateProfile(name string, conf *Configure) error

func CurrentProfile

func CurrentProfile() string

func DefaultRegion

func DefaultRegion() string

func DoAction

func DoAction(service, action string, options ...string) ([]byte, error)

func FmtOutput added in v1.1.0

func FmtOutput(view string, intf interface{}) ([]byte, error)

func HasRegion

func HasRegion(options ...string) (string, bool)

func HasVersion added in v1.1.0

func HasVersion(options ...string) (string, bool)

func Inspect

func Inspect(flag string, cmd string, action string, options ...string) error

unmarshal response to query into empty interface

func Internal

func Internal() bool

func ListProfiles

func ListProfiles() []*ini.Section

func ParamsToStr

func ParamsToStr(params map[string]interface{}) string

func SwitchProfile

func SwitchProfile(name string) error

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}
var DefaultClient *Client

func NewClient

func NewClient() *Client

func (*Client) AppendUserAgent added in v1.3.2

func (c *Client) AppendUserAgent(ua string)

func (*Client) DoAction added in v1.3.0

func (client *Client) DoAction(service, action string, options ...string) ([]byte, error)

func (*Client) SendRequest

func (c *Client) SendRequest(method, requesturl string, params map[string]interface{}) (*http.Response, error)

func (*Client) SetLog added in v1.3.0

func (c *Client) SetLog(out io.Writer, prefix string, flag int)

func (*Client) SetUserAgent added in v1.3.2

func (c *Client) SetUserAgent(ua string)

type ConfigFile

type ConfigFile struct {
	*ini.File
}

type Configure

type Configure struct {
	SecretId      string
	SecretKey     string
	DefaultRegion string
	Internal      bool
}

Jump to

Keyboard shortcuts

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