util

package
v0.0.0-...-ed43482 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2016 License: BSD-3-Clause Imports: 10 Imported by: 1

Documentation

Overview

Copyright 2015 Beijing Venusource Tech.Co.Ltd. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

封装了http调用相关的一些方法

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallApiServer

func CallApiServer(server string, signer *signer.SHA1Signer, params *OrderedParams, i interface{}) error

调用API

func Escape

func Escape(s string) string

func RemoveNetworkRouter

func RemoveNetworkRouter(server string, user string, password string, os string) error

本方法用于处理阿里云自动移除172.16.0.0的路由表,否则无法启动docker的服务

Types

type ErrorResponse

type ErrorResponse struct {
	RequestId string `json:"RequestId"` //请求ID
	HostId    string `json:"HostId"`    //服务器HOSTID
	Code      string `json:"Code"`      //错误代码
	Message   string `json:"Message"`   //错误信息
}

API调用错误返回对象

type HTTPExecuteError

type HTTPExecuteError struct {
	// Request Header
	RequestHeaders string
	// Response BodyBytes
	ResponseBodyBytes []byte
	// Status
	Status string
	// StatusCode
	StatusCode int
}

HTTP请求错误信息

func (HTTPExecuteError) Error

func (e HTTPExecuteError) Error() string

Error 输出

type OrderedParams

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

排序后的参数列表

func NewOrderedParams

func NewOrderedParams() *OrderedParams

func (*OrderedParams) Add

func (o *OrderedParams) Add(key, value string)

func (*OrderedParams) AddUnescaped

func (o *OrderedParams) AddUnescaped(key, value string)

func (*OrderedParams) Clone

func (o *OrderedParams) Clone() *OrderedParams

func (*OrderedParams) Get

func (o *OrderedParams) Get(key string) string

func (*OrderedParams) Keys

func (o *OrderedParams) Keys() []string

func (*OrderedParams) Len

func (o *OrderedParams) Len() int

func (*OrderedParams) Less

func (o *OrderedParams) Less(i int, j int) bool

func (*OrderedParams) Swap

func (o *OrderedParams) Swap(i int, j int)

Jump to

Keyboard shortcuts

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