Documentation
¶
Overview ¶
From aws-sdk-go-v2 convert_types.go
Index ¶
- Constants
- Variables
- func Bool(v bool) *bool
- func BoolMap(src map[string]bool) map[string]*bool
- func BoolSlice(src []bool) []*bool
- func BoolValue(v *bool) bool
- func BoolValueMap(src map[string]*bool) map[string]bool
- func BoolValueSlice(src []*bool) []bool
- func BytesToString(b []byte) string
- func DoRequest(client *http.Client, req *http.Request, requestInterface RequestInterface, ...) error
- func EnsureFileExists(path string)
- func EnsureFolderExists(folder string)
- func Exec(bin string, args []string)
- func ExecCommand(bin string, args []string) (string, error)
- func Exists(path string) bool
- func Float32(v float32) *float32
- func Float32Map(src map[string]float32) map[string]*float32
- func Float32Slice(src []float32) []*float32
- func Float32Value(v *float32) float32
- func Float32ValueMap(src map[string]*float32) map[string]float32
- func Float32ValueSlice(src []*float32) []float32
- func Float64(v float64) *float64
- func Float64Map(src map[string]float64) map[string]*float64
- func Float64Slice(src []float64) []*float64
- func Float64Value(v *float64) float64
- func Float64ValueMap(src map[string]*float64) map[string]float64
- func Float64ValueSlice(src []*float64) []float64
- func FromDeployPolicy(policy DeployPolicy) string
- func GetDomainSuffix(name string) string
- func GetRootDomain(name string) (string, error)
- func HTTPRequest(requestInterface RequestInterface, responseInterface ResponseInterface) error
- func HTTPRequestWithClient(client *http.Client, requestInterface RequestInterface, ...) error
- func Int(v int) *int
- func Int16(v int16) *int16
- func Int16Map(src map[string]int16) map[string]*int16
- func Int16Slice(src []int16) []*int16
- func Int16Value(v *int16) int16
- func Int16ValueMap(src map[string]*int16) map[string]int16
- func Int16ValueSlice(src []*int16) []int16
- func Int32(v int32) *int32
- func Int32Map(src map[string]int32) map[string]*int32
- func Int32Slice(src []int32) []*int32
- func Int32Value(v *int32) int32
- func Int32ValueMap(src map[string]*int32) map[string]int32
- func Int32ValueSlice(src []*int32) []int32
- func Int64(v int64) *int64
- func Int64Map(src map[string]int64) map[string]*int64
- func Int64Slice(src []int64) []*int64
- func Int64Value(v *int64) int64
- func Int64ValueMap(src map[string]*int64) map[string]int64
- func Int64ValueSlice(src []*int64) []int64
- func Int8(v int8) *int8
- func Int8Map(src map[string]int8) map[string]*int8
- func Int8Slice(src []int8) []*int8
- func Int8Value(v *int8) int8
- func Int8ValueMap(src map[string]*int8) map[string]int8
- func Int8ValueSlice(src []*int8) []int8
- func IntMap(src map[string]int) map[string]*int
- func IntSlice(src []int) []*int
- func IntValue(v *int) int
- func IntValueMap(src map[string]*int) map[string]int
- func IntValueSlice(src []*int) []int
- func MillisecondsTimeValue(v *int64) time.Time
- func QueryDNSCnameRecord(domain string) *dns.CNAME
- func QueryDNSSRVRecord(domain string) *dns.SRV
- func SecondsTimeValue(v *int64) time.Time
- func SetFQDN(domain string) string
- func String(v string) *string
- func StringMap(src map[string]string) map[string]*string
- func StringSlice(src []string) []*string
- func StringToBytes(s string) []byte
- func StringValue(v *string) string
- func StringValueMap(src map[string]*string) map[string]string
- func StringValueSlice(src []*string) []string
- func TemplateGenerateFileFromReader(reader io.Reader, dstPath string, data interface{}) error
- func TemplateGenerateString(str string, data interface{}) (string, error)
- func Time(v time.Time) *time.Time
- func TimeMap(src map[string]time.Time) map[string]*time.Time
- func TimeSlice(src []time.Time) []*time.Time
- func TimeUnixMilli(t time.Time) int64
- func TimeValue(v *time.Time) time.Time
- func TimeValueMap(src map[string]*time.Time) map[string]time.Time
- func TimeValueSlice(src []*time.Time) []time.Time
- func ToDomainWithDot(domain string) string
- func TrimDomainDot(domain string) string
- func Uint(v uint) *uint
- func Uint16(v uint16) *uint16
- func Uint16Map(src map[string]uint16) map[string]*uint16
- func Uint16Slice(src []uint16) []*uint16
- func Uint16Value(v *uint16) uint16
- func Uint16ValueMap(src map[string]*uint16) map[string]uint16
- func Uint16ValueSlice(src []*uint16) []uint16
- func Uint32(v uint32) *uint32
- func Uint32Map(src map[string]uint32) map[string]*uint32
- func Uint32Slice(src []uint32) []*uint32
- func Uint32Value(v *uint32) uint32
- func Uint32ValueMap(src map[string]*uint32) map[string]uint32
- func Uint32ValueSlice(src []*uint32) []uint32
- func Uint64(v uint64) *uint64
- func Uint64Map(src map[string]uint64) map[string]*uint64
- func Uint64Slice(src []uint64) []*uint64
- func Uint64Value(v *uint64) uint64
- func Uint64ValueMap(src map[string]*uint64) map[string]uint64
- func Uint64ValueSlice(src []*uint64) []uint64
- func Uint8(v uint8) *uint8
- func Uint8Map(src map[string]uint8) map[string]*uint8
- func Uint8Slice(src []uint8) []*uint8
- func Uint8Value(v *uint8) uint8
- func Uint8ValueMap(src map[string]*uint8) map[string]uint8
- func Uint8ValueSlice(src []*uint8) []uint8
- func UintMap(src map[string]uint) map[string]*uint
- func UintSlice(src []uint) []*uint
- func UintValue(v *uint) uint
- func UintValueMap(src map[string]*uint) map[string]uint
- func UintValueSlice(src []*uint) []uint
- func UnixTimeMilliSecond() float64
- func WriteFile(path string, content string) error
- type DeployPolicy
- type HTTPAirdbResponse
- type HTTPClient
- func (client *HTTPClient) GetBody() interface{}
- func (client *HTTPClient) GetDebug() bool
- func (client *HTTPClient) GetHeaders() map[string]string
- func (client *HTTPClient) GetMethod() string
- func (client *HTTPClient) GetURL() string
- func (client *HTTPClient) GetUserAgent() string
- func (client *HTTPClient) GetValues() url.Values
- func (client *HTTPClient) SetBody(body interface{})
- func (client *HTTPClient) SetDebug()
- func (client *HTTPClient) SetHeaders(headers map[string]string)
- func (client *HTTPClient) SetMethod(method string)
- func (client *HTTPClient) SetURL(url string)
- func (client *HTTPClient) SetUserAgent(ua string)
- func (client *HTTPClient) SetValues(values url.Values)
- type ProcessBar
- type RequestInterface
- type ResponseInterface
Constants ¶
const ( CloudPlatformAWS = "aws" CloudPlatformAliyun = "aliyun" // The name from github. XD CloudPlatformTencent = "tencentyun" )
const ( DelimiterNewline = "\n" DelimiterComma = "," DelimiterDot = "." DelimiterAt = "@" DelimiterStar = "*" DelimiterDash = "-" DelimiterSlash = "/" DelimiterUnderline = "_" DelimiterStarHex = "\\052" )
Delimiter const value.
const ( OperationCreate string = "CREATE" OperationUpdate string = "UPDATE" OperationDelete string = "DELETE" OperationUpsert string = "UPSERT" OperationPatch string = "PATCH" OperationPut string = "PUT" )
Operation const value.
const ( FilePerm600 os.FileMode = 0600 // For secret files. FilePerm644 os.FileMode = 0644 // For normal files. FilePerm755 os.FileMode = 0755 // For directory or execute files. )
const ( UserAgent = "sailor-agent/1.0.0" UserAgentKey = "User-Agent" )
const (
DefaultDNSServer = "8.8.8.8:53"
)
Variables ¶
var DNSRetry int = 3
var DNSTimeout time.Duration = 3
var DefaultClient = &http.Client{ Timeout: 60 * time.Second, }
var DeployPolicyMap = map[DeployPolicy]string{ DeployPolicyBlue: "blue", DeployPolicyGreen: "green", DeployPolicyRed: "red", DeployPolicyBlack: "black", }
Functions ¶
func BoolValue ¶
BoolValue returns the value of the bool pointer passed in or false if the pointer is nil.
func BoolValueMap ¶
BoolValueMap converts a string map of bool pointers into a string map of bool values.
func BoolValueSlice ¶
BoolValueSlice converts a slice of bool pointers into a slice of bool values.
func BytesToString ¶ added in v1.1.1
b2s converts byte slice to a string without memory allocation. See https://groups.google.com/forum/#!msg/Golang-Nuts/ENgbUzYvCuU/90yGx7GUAgAJ .
Note it may break if string and/or slice header will change in the future go versions.
func DoRequest ¶ added in v1.6.0
func DoRequest(client *http.Client, req *http.Request, requestInterface RequestInterface, responseInterface ResponseInterface, ) error
func EnsureFileExists ¶ added in v1.1.1
func EnsureFileExists(path string)
func EnsureFolderExists ¶ added in v1.1.1
func EnsureFolderExists(folder string)
func Float32Map ¶
Float32Map converts a string map of float32 values into a string map of float32 pointers.
func Float32Slice ¶
Float32Slice converts a slice of float32 values into a slice of float32 pointers.
func Float32Value ¶
Float32Value returns the value of the float32 pointer passed in or 0 if the pointer is nil.
func Float32ValueMap ¶
Float32ValueMap converts a string map of float32 pointers into a string map of float32 values.
func Float32ValueSlice ¶
Float32ValueSlice converts a slice of float32 pointers into a slice of float32 values.
func Float64Map ¶
Float64Map converts a string map of float64 values into a string map of float64 pointers.
func Float64Slice ¶
Float64Slice converts a slice of float64 values into a slice of float64 pointers.
func Float64Value ¶
Float64Value returns the value of the float64 pointer passed in or 0 if the pointer is nil.
func Float64ValueMap ¶
Float64ValueMap converts a string map of float64 pointers into a string map of float64 values.
func Float64ValueSlice ¶
Float64ValueSlice converts a slice of float64 pointers into a slice of float64 values.
func FromDeployPolicy ¶ added in v1.3.0
func FromDeployPolicy(policy DeployPolicy) string
func GetDomainSuffix ¶ added in v1.6.0
func GetRootDomain ¶ added in v1.6.0
func HTTPRequest ¶ added in v1.6.0
func HTTPRequest(requestInterface RequestInterface, responseInterface ResponseInterface) error
func HTTPRequestWithClient ¶ added in v1.6.0
func HTTPRequestWithClient(client *http.Client, requestInterface RequestInterface, responseInterface ResponseInterface, ) error
func Int16Slice ¶
Int16Slice converts a slice of int16 values into a slice of int16 pointers.
func Int16Value ¶
Int16Value returns the value of the int16 pointer passed in or 0 if the pointer is nil.
func Int16ValueMap ¶
Int16ValueMap converts a string map of int16 pointers into a string map of int16 values.
func Int16ValueSlice ¶
Int16ValueSlice converts a slice of int16 pointers into a slice of int16 values.
func Int32Slice ¶
Int32Slice converts a slice of int32 values into a slice of int32 pointers.
func Int32Value ¶
Int32Value returns the value of the int32 pointer passed in or 0 if the pointer is nil.
func Int32ValueMap ¶
Int32ValueMap converts a string map of int32 pointers into a string map of int32 values.
func Int32ValueSlice ¶
Int32ValueSlice converts a slice of int32 pointers into a slice of int32 values.
func Int64Slice ¶
Int64Slice converts a slice of int64 values into a slice of int64 pointers.
func Int64Value ¶
Int64Value returns the value of the int64 pointer passed in or 0 if the pointer is nil.
func Int64ValueMap ¶
Int64ValueMap converts a string map of int64 pointers into a string map of int64 values.
func Int64ValueSlice ¶
Int64ValueSlice converts a slice of int64 pointers into a slice of int64 values.
func Int8Value ¶
Int8Value returns the value of the int8 pointer passed in or 0 if the pointer is nil.
func Int8ValueMap ¶
Int8ValueMap converts a string map of int8 pointers into a string map of int8 values.
func Int8ValueSlice ¶
Int8ValueSlice converts a slice of int8 pointers into a slice of int8 values.
func IntValueMap ¶
IntValueMap converts a string map of int pointers into a string map of int values.
func IntValueSlice ¶
IntValueSlice converts a slice of int pointers into a slice of int values.
func MillisecondsTimeValue ¶
MillisecondsTimeValue converts an int64 pointer to a time.Time value representing milliseconds sinch Epoch or time.Time{} if the pointer is nil.
func QueryDNSCnameRecord ¶ added in v1.3.0
func QueryDNSSRVRecord ¶ added in v1.3.0
func SecondsTimeValue ¶
SecondsTimeValue converts an int64 pointer to a time.Time value representing seconds since Epoch or time.Time{} if the pointer is nil.
func StringMap ¶
StringMap converts a string map of string values into a string map of string pointers.
func StringSlice ¶
StringSlice converts a slice of string values into a slice of string pointers.
func StringToBytes ¶ added in v1.1.1
s2b converts string to a byte slice without memory allocation.
Note it may break if string and/or slice header will change in the future go versions.
func StringValue ¶
StringValue returns the value of the string pointer passed in or "" if the pointer is nil.
func StringValueMap ¶
StringValueMap converts a string map of string pointers into a string map of string values.
func StringValueSlice ¶
StringValueSlice converts a slice of string pointers into a slice of string values.
func TemplateGenerateFileFromReader ¶ added in v1.1.1
func TemplateGenerateString ¶ added in v1.1.1
func TimeMap ¶
TimeMap converts a string map of time.Time values into a string map of time.Time pointers.
func TimeUnixMilli ¶
TimeUnixMilli returns a Unix timestamp in milliseconds from "January 1, 1970 UTC". The result is undefined if the Unix time cannot be represented by an int64. Which includes calling TimeUnixMilli on a zero Time is undefined.
This utility is useful for service API's such as CloudWatch Logs which require their unix time values to be in milliseconds.
See Go stdlib https://golang.org/pkg/time/#Time.UnixNano for more information.
func TimeValue ¶
TimeValue returns the value of the time.Time pointer passed in or time.Time{} if the pointer is nil.
func TimeValueMap ¶
TimeValueMap converts a string map of time.Time pointers into a string. map of time.Time values.
func TimeValueSlice ¶
TimeValueSlice converts a slice of time.Time pointers into a slice of time.Time values.
func ToDomainWithDot ¶ added in v1.6.0
func TrimDomainDot ¶ added in v1.6.0
func Uint16Map ¶
Uint16Map converts a string map of uint16 values into a string map of uint16 pointers.
func Uint16Slice ¶
Uint16Slice converts a slice of uint16 values into a slice of uint16 pointers.
func Uint16Value ¶
Uint16Value returns the value of the uint16 pointer passed in or 0 if the pointer is nil.
func Uint16ValueMap ¶
Uint16ValueMap converts a string map of uint16 pointers into a string map of uint16 values.
func Uint16ValueSlice ¶
Uint16ValueSlice converts a slice of uint16 pointers into a slice of uint16 values.
func Uint32Map ¶
Uint32Map converts a string map of uint32 values into a string map of uint32 pointers.
func Uint32Slice ¶
Uint32Slice converts a slice of uint32 values into a slice of uint32 pointers.
func Uint32Value ¶
Uint32Value returns the value of the uint32 pointer passed in or 0 if the pointer is nil.
func Uint32ValueMap ¶
Uint32ValueMap converts a string map of uint32 pointers into a string map of uint32 values.
func Uint32ValueSlice ¶
Uint32ValueSlice converts a slice of uint32 pointers into a slice of uint32 values.
func Uint64Map ¶
Uint64Map converts a string map of uint64 values into a string map of uint64 pointers.
func Uint64Slice ¶
Uint64Slice converts a slice of uint64 values into a slice of uint64 pointers.
func Uint64Value ¶
Uint64Value returns the value of the uint64 pointer passed in or 0 if the pointer is nil.
func Uint64ValueMap ¶
Uint64ValueMap converts a string map of uint64 pointers into a string map of uint64 values.
func Uint64ValueSlice ¶
Uint64ValueSlice converts a slice of uint64 pointers into a slice of uint64 values.
func Uint8Slice ¶
Uint8Slice converts a slice of uint8 values into a slice of uint8 pointers.
func Uint8Value ¶
Uint8Value returns the value of the uint8 pointer passed in or 0 if the pointer is nil.
func Uint8ValueMap ¶
Uint8ValueMap converts a string map of uint8 pointers into a string map of uint8 values.
func Uint8ValueSlice ¶
Uint8ValueSlice converts a slice of uint8 pointers into a slice of uint8 values.
func UintValue ¶
UintValue returns the value of the uint pointer passed in or 0 if the pointer is nil.
func UintValueMap ¶
UintValueMap converts a string map of uint pointers uinto a string map of uint values.
func UintValueSlice ¶
UintValueSlice converts a slice of uint pointers uinto a slice of uint values.
func UnixTimeMilliSecond ¶ added in v1.1.0
func UnixTimeMilliSecond() float64
Types ¶
type DeployPolicy ¶ added in v1.3.0
type DeployPolicy uint
const ( DeployPolicyBlue DeployPolicy = iota + 1 DeployPolicyGreen DeployPolicyRed DeployPolicyBlack )
func ToEnv ¶ added in v1.3.0
func ToEnv(sPolicy string) DeployPolicy
type HTTPAirdbResponse ¶
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
func (*HTTPClient) GetBody ¶
func (client *HTTPClient) GetBody() interface{}
func (*HTTPClient) GetDebug ¶
func (client *HTTPClient) GetDebug() bool
func (*HTTPClient) GetHeaders ¶
func (client *HTTPClient) GetHeaders() map[string]string
func (*HTTPClient) GetMethod ¶
func (client *HTTPClient) GetMethod() string
func (*HTTPClient) GetURL ¶
func (client *HTTPClient) GetURL() string
func (*HTTPClient) GetUserAgent ¶
func (client *HTTPClient) GetUserAgent() string
func (*HTTPClient) GetValues ¶
func (client *HTTPClient) GetValues() url.Values
func (*HTTPClient) SetBody ¶
func (client *HTTPClient) SetBody(body interface{})
func (*HTTPClient) SetDebug ¶
func (client *HTTPClient) SetDebug()
func (*HTTPClient) SetHeaders ¶
func (client *HTTPClient) SetHeaders(headers map[string]string)
func (*HTTPClient) SetMethod ¶
func (client *HTTPClient) SetMethod(method string)
func (*HTTPClient) SetURL ¶
func (client *HTTPClient) SetURL(url string)
func (*HTTPClient) SetUserAgent ¶
func (client *HTTPClient) SetUserAgent(ua string)
func (*HTTPClient) SetValues ¶
func (client *HTTPClient) SetValues(values url.Values)
type ProcessBar ¶ added in v1.6.0
type ProcessBar struct {
// contains filtered or unexported fields
}
func (*ProcessBar) Finish ¶ added in v1.6.0
func (bar *ProcessBar) Finish()
func (*ProcessBar) NewOption ¶ added in v1.6.0
func (bar *ProcessBar) NewOption(start, total int64)
func (*ProcessBar) NewOptionWithGraph ¶ added in v1.6.0
func (bar *ProcessBar) NewOptionWithGraph(start, total int64, graph string)
func (*ProcessBar) Play ¶ added in v1.6.0
func (bar *ProcessBar) Play(cur int64)
type RequestInterface ¶
type RequestInterface interface { SetDebug() GetDebug() bool SetURL(string) GetURL() string SetMethod(string) GetMethod() string SetHeaders(headers map[string]string) GetHeaders() map[string]string SetValues(url.Values) GetValues() url.Values SetBody(interface{}) GetBody() interface{} SetUserAgent(string) GetUserAgent() string }
type ResponseInterface ¶
type ResponseInterface interface{}