nifcloud

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool added in v0.0.3

func Bool(v bool) *bool

Bool returns a pointer to the bool value passed in.

func BoolMap added in v0.0.3

func BoolMap(src map[string]bool) map[string]*bool

BoolMap converts a string map of bool values into a string map of bool pointers

func BoolSlice added in v0.0.3

func BoolSlice(src []bool) []*bool

BoolSlice converts a slice of bool values into a slice of bool pointers

func BoolValue added in v0.0.3

func BoolValue(v *bool) bool

BoolValue returns the value of the bool pointer passed in or false if the pointer is nil.

func BoolValueMap added in v0.0.3

func BoolValueMap(src map[string]*bool) map[string]bool

BoolValueMap converts a string map of bool pointers into a string map of bool values

func BoolValueSlice added in v0.0.3

func BoolValueSlice(src []*bool) []bool

BoolValueSlice converts a slice of bool pointers into a slice of bool values

func Float32 added in v0.0.3

func Float32(v float32) *float32

Float32 returns a pointer to the float32 value passed in.

func Float32Map added in v0.0.3

func Float32Map(src map[string]float32) map[string]*float32

Float32Map converts a string map of float32 values into a string map of float32 pointers

func Float32Slice added in v0.0.3

func Float32Slice(src []float32) []*float32

Float32Slice converts a slice of float32 values into a slice of float32 pointers

func Float32Value added in v0.0.3

func Float32Value(v *float32) float32

Float32Value returns the value of the float32 pointer passed in or 0 if the pointer is nil.

func Float32ValueMap added in v0.0.3

func Float32ValueMap(src map[string]*float32) map[string]float32

Float32ValueMap converts a string map of float32 pointers into a string map of float32 values

func Float32ValueSlice added in v0.0.3

func Float32ValueSlice(src []*float32) []float32

Float32ValueSlice converts a slice of float32 pointers into a slice of float32 values

func Float64 added in v0.0.3

func Float64(v float64) *float64

Float64 returns a pointer to the float64 value passed in.

func Float64Map added in v0.0.3

func Float64Map(src map[string]float64) map[string]*float64

Float64Map converts a string map of float64 values into a string map of float64 pointers

func Float64Slice added in v0.0.3

func Float64Slice(src []float64) []*float64

Float64Slice converts a slice of float64 values into a slice of float64 pointers

func Float64Value added in v0.0.3

func Float64Value(v *float64) float64

Float64Value returns the value of the float64 pointer passed in or 0 if the pointer is nil.

func Float64ValueMap added in v0.0.3

func Float64ValueMap(src map[string]*float64) map[string]float64

Float64ValueMap converts a string map of float64 pointers into a string map of float64 values

func Float64ValueSlice added in v0.0.3

func Float64ValueSlice(src []*float64) []float64

Float64ValueSlice converts a slice of float64 pointers into a slice of float64 values

func Int added in v0.0.3

func Int(v int) *int

Int returns a pointer to the int value passed in.

func Int16 added in v0.0.3

func Int16(v int16) *int16

Int16 returns a pointer to the int16 value passed in.

func Int16Map added in v0.0.3

func Int16Map(src map[string]int16) map[string]*int16

Int16Map converts a string map of int16 values into a string map of int16 pointers

func Int16Slice added in v0.0.3

func Int16Slice(src []int16) []*int16

Int16Slice converts a slice of int16 values into a slice of int16 pointers

func Int16Value added in v0.0.3

func Int16Value(v *int16) int16

Int16Value returns the value of the int16 pointer passed in or 0 if the pointer is nil.

func Int16ValueMap added in v0.0.3

func Int16ValueMap(src map[string]*int16) map[string]int16

Int16ValueMap converts a string map of int16 pointers into a string map of int16 values

func Int16ValueSlice added in v0.0.3

func Int16ValueSlice(src []*int16) []int16

Int16ValueSlice converts a slice of int16 pointers into a slice of int16 values

func Int32 added in v0.0.3

func Int32(v int32) *int32

Int32 returns a pointer to the int32 value passed in.

func Int32Map added in v0.0.3

func Int32Map(src map[string]int32) map[string]*int32

Int32Map converts a string map of int32 values into a string map of int32 pointers

func Int32Slice added in v0.0.3

func Int32Slice(src []int32) []*int32

Int32Slice converts a slice of int32 values into a slice of int32 pointers

func Int32Value added in v0.0.3

func Int32Value(v *int32) int32

Int32Value returns the value of the int32 pointer passed in or 0 if the pointer is nil.

func Int32ValueMap added in v0.0.3

func Int32ValueMap(src map[string]*int32) map[string]int32

Int32ValueMap converts a string map of int32 pointers into a string map of int32 values

func Int32ValueSlice added in v0.0.3

func Int32ValueSlice(src []*int32) []int32

Int32ValueSlice converts a slice of int32 pointers into a slice of int32 values

func Int64 added in v0.0.3

func Int64(v int64) *int64

Int64 returns a pointer to the int64 value passed in.

func Int64Map added in v0.0.3

func Int64Map(src map[string]int64) map[string]*int64

Int64Map converts a string map of int64 values into a string map of int64 pointers

func Int64Slice added in v0.0.3

func Int64Slice(src []int64) []*int64

Int64Slice converts a slice of int64 values into a slice of int64 pointers

func Int64Value added in v0.0.3

func Int64Value(v *int64) int64

Int64Value returns the value of the int64 pointer passed in or 0 if the pointer is nil.

func Int64ValueMap added in v0.0.3

func Int64ValueMap(src map[string]*int64) map[string]int64

Int64ValueMap converts a string map of int64 pointers into a string map of int64 values

func Int64ValueSlice added in v0.0.3

func Int64ValueSlice(src []*int64) []int64

Int64ValueSlice converts a slice of int64 pointers into a slice of int64 values

func Int8 added in v0.0.3

func Int8(v int8) *int8

Int8 returns a pointer to the int8 value passed in.

func Int8Map added in v0.0.3

func Int8Map(src map[string]int8) map[string]*int8

Int8Map converts a string map of int8 values into a string map of int8 pointers

func Int8Slice added in v0.0.3

func Int8Slice(src []int8) []*int8

Int8Slice converts a slice of int8 values into a slice of int8 pointers

func Int8Value added in v0.0.3

func Int8Value(v *int8) int8

Int8Value returns the value of the int8 pointer passed in or 0 if the pointer is nil.

func Int8ValueMap added in v0.0.3

func Int8ValueMap(src map[string]*int8) map[string]int8

Int8ValueMap converts a string map of int8 pointers into a string map of int8 values

func Int8ValueSlice added in v0.0.3

func Int8ValueSlice(src []*int8) []int8

Int8ValueSlice converts a slice of int8 pointers into a slice of int8 values

func IntMap added in v0.0.3

func IntMap(src map[string]int) map[string]*int

IntMap converts a string map of int values into a string map of int pointers

func IntSlice added in v0.0.3

func IntSlice(src []int) []*int

IntSlice converts a slice of int values into a slice of int pointers

func IntValue added in v0.0.3

func IntValue(v *int) int

IntValue returns the value of the int pointer passed in or 0 if the pointer is nil.

func IntValueMap added in v0.0.3

func IntValueMap(src map[string]*int) map[string]int

IntValueMap converts a string map of int pointers into a string map of int values

func IntValueSlice added in v0.0.3

func IntValueSlice(src []*int) []int

IntValueSlice converts a slice of int pointers into a slice of int values

func MillisecondsTimeValue added in v0.0.3

func MillisecondsTimeValue(v *int64) time.Time

MillisecondsTimeValue converts an int64 pointer to a time.Time value representing milliseconds sinch Epoch or time.Time{} if the pointer is nil.

func SecondsTimeValue added in v0.0.3

func SecondsTimeValue(v *int64) time.Time

SecondsTimeValue converts an int64 pointer to a time.Time value representing seconds since Epoch or time.Time{} if the pointer is nil.

func String

func String(v string) *string

String returns a pointer to the string value passed in.

func StringMap added in v0.0.3

func StringMap(src map[string]string) map[string]*string

StringMap converts a string map of string values into a string map of string pointers

func StringSlice added in v0.0.3

func StringSlice(src []string) []*string

StringSlice converts a slice of string values into a slice of string pointers

func StringValue added in v0.0.3

func StringValue(v *string) string

StringValue returns the value of the string pointer passed in or "" if the pointer is nil.

func StringValueMap added in v0.0.3

func StringValueMap(src map[string]*string) map[string]string

StringValueMap converts a string map of string pointers into a string map of string values

func StringValueSlice added in v0.0.3

func StringValueSlice(src []*string) []string

StringValueSlice converts a slice of string pointers into a slice of string values

func Time added in v0.0.3

func Time(v time.Time) *time.Time

Time returns a pointer to the time.Time value passed in.

func TimeMap added in v0.0.3

func TimeMap(src map[string]time.Time) map[string]*time.Time

TimeMap converts a string map of time.Time values into a string map of time.Time pointers

func TimeSlice added in v0.0.3

func TimeSlice(src []time.Time) []*time.Time

TimeSlice converts a slice of time.Time values into a slice of time.Time pointers

func TimeUnixMilli added in v0.0.3

func TimeUnixMilli(t time.Time) int64

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 added in v0.0.3

func TimeValue(v *time.Time) time.Time

TimeValue returns the value of the time.Time pointer passed in or time.Time{} if the pointer is nil.

func TimeValueMap added in v0.0.3

func TimeValueMap(src map[string]*time.Time) map[string]time.Time

TimeValueMap converts a string map of time.Time pointers into a string map of time.Time values

func TimeValueSlice added in v0.0.3

func TimeValueSlice(src []*time.Time) []time.Time

TimeValueSlice converts a slice of time.Time pointers into a slice of time.Time values

func Uint added in v0.0.3

func Uint(v uint) *uint

Uint returns a pointer to the uint value passed in.

func Uint16 added in v0.0.3

func Uint16(v uint16) *uint16

Uint16 returns a pointer to the uint16 value passed in.

func Uint16Map added in v0.0.3

func Uint16Map(src map[string]uint16) map[string]*uint16

Uint16Map converts a string map of uint16 values into a string map of uint16 pointers

func Uint16Slice added in v0.0.3

func Uint16Slice(src []uint16) []*uint16

Uint16Slice converts a slice of uint16 values into a slice of uint16 pointers

func Uint16Value added in v0.0.3

func Uint16Value(v *uint16) uint16

Uint16Value returns the value of the uint16 pointer passed in or 0 if the pointer is nil.

func Uint16ValueMap added in v0.0.3

func Uint16ValueMap(src map[string]*uint16) map[string]uint16

Uint16ValueMap converts a string map of uint16 pointers into a string map of uint16 values

func Uint16ValueSlice added in v0.0.3

func Uint16ValueSlice(src []*uint16) []uint16

Uint16ValueSlice converts a slice of uint16 pointers into a slice of uint16 values

func Uint32 added in v0.0.3

func Uint32(v uint32) *uint32

Uint32 returns a pointer to the uint32 value passed in.

func Uint32Map added in v0.0.3

func Uint32Map(src map[string]uint32) map[string]*uint32

Uint32Map converts a string map of uint32 values into a string map of uint32 pointers

func Uint32Slice added in v0.0.3

func Uint32Slice(src []uint32) []*uint32

Uint32Slice converts a slice of uint32 values into a slice of uint32 pointers

func Uint32Value added in v0.0.3

func Uint32Value(v *uint32) uint32

Uint32Value returns the value of the uint32 pointer passed in or 0 if the pointer is nil.

func Uint32ValueMap added in v0.0.3

func Uint32ValueMap(src map[string]*uint32) map[string]uint32

Uint32ValueMap converts a string map of uint32 pointers into a string map of uint32 values

func Uint32ValueSlice added in v0.0.3

func Uint32ValueSlice(src []*uint32) []uint32

Uint32ValueSlice converts a slice of uint32 pointers into a slice of uint32 values

func Uint64 added in v0.0.3

func Uint64(v uint64) *uint64

Uint64 returns a pointer to the uint64 value passed in.

func Uint64Map added in v0.0.3

func Uint64Map(src map[string]uint64) map[string]*uint64

Uint64Map converts a string map of uint64 values into a string map of uint64 pointers

func Uint64Slice added in v0.0.3

func Uint64Slice(src []uint64) []*uint64

Uint64Slice converts a slice of uint64 values into a slice of uint64 pointers

func Uint64Value added in v0.0.3

func Uint64Value(v *uint64) uint64

Uint64Value returns the value of the uint64 pointer passed in or 0 if the pointer is nil.

func Uint64ValueMap added in v0.0.3

func Uint64ValueMap(src map[string]*uint64) map[string]uint64

Uint64ValueMap converts a string map of uint64 pointers into a string map of uint64 values

func Uint64ValueSlice added in v0.0.3

func Uint64ValueSlice(src []*uint64) []uint64

Uint64ValueSlice converts a slice of uint64 pointers into a slice of uint64 values

func Uint8 added in v0.0.3

func Uint8(v uint8) *uint8

Uint8 returns a pointer to the uint8 value passed in.

func Uint8Map added in v0.0.3

func Uint8Map(src map[string]uint8) map[string]*uint8

Uint8Map converts a string map of uint8 values into a string map of uint8 pointers

func Uint8Slice added in v0.0.3

func Uint8Slice(src []uint8) []*uint8

Uint8Slice converts a slice of uint8 values into a slice of uint8 pointers

func Uint8Value added in v0.0.3

func Uint8Value(v *uint8) uint8

Uint8Value returns the value of the uint8 pointer passed in or 0 if the pointer is nil.

func Uint8ValueMap added in v0.0.3

func Uint8ValueMap(src map[string]*uint8) map[string]uint8

Uint8ValueMap converts a string map of uint8 pointers into a string map of uint8 values

func Uint8ValueSlice added in v0.0.3

func Uint8ValueSlice(src []*uint8) []uint8

Uint8ValueSlice converts a slice of uint8 pointers into a slice of uint8 values

func UintMap added in v0.0.3

func UintMap(src map[string]uint) map[string]*uint

UintMap converts a string map of uint values uinto a string map of uint pointers

func UintSlice added in v0.0.3

func UintSlice(src []uint) []*uint

UintSlice converts a slice of uint values uinto a slice of uint pointers

func UintValue added in v0.0.3

func UintValue(v *uint) uint

UintValue returns the value of the uint pointer passed in or 0 if the pointer is nil.

func UintValueMap added in v0.0.3

func UintValueMap(src map[string]*uint) map[string]uint

UintValueMap converts a string map of uint pointers uinto a string map of uint values

func UintValueSlice added in v0.0.3

func UintValueSlice(src []*uint) []uint

UintValueSlice converts a slice of uint pointers uinto a slice of uint values

Types

type Config

type Config struct {
	// The region to send requests to. This parameter is required and must
	// be configured globally or on a per-client basis unless otherwise
	// noted. A full list of regions is found in the "Regions and Endpoints"
	// document.
	//
	// See http://docs.aws.amazon.com/general/latest/gr/rande.html for
	// information on AWS regions.
	Region string

	// The credentials object to use when signing requests. Defaults to a
	// chain of credential providers to search for credentials in environment
	// variables, shared credential file, and EC2 Instance Roles.
	Credentials aws.CredentialsProvider

	// The resolver to use for looking up endpoints for AWS service clients
	// to use based on region.
	EndpointResolver aws.EndpointResolver

	// The HTTP Client the SDK's API clients will use to invoke HTTP requests.
	// The SDK defaults to a BuildableHTTPClient allowing API clients to create
	// copies of the HTTP Client for service specific customizations.
	//
	// Use a (*http.Client) for custom behavior. Using a custom http.Client
	// will prevent the SDK from modifying the HTTP client.
	HTTPClient aws.HTTPClient

	// TODO document
	Handlers aws.Handlers

	// Retryer guides how HTTP requests should be retried in case of
	// recoverable failures.
	//
	// When nil or the value does not implement the request.Retryer interface,
	// the client.DefaultRetryer will be used.
	//
	// When both Retryer and MaxRetries are non-nil, the former is used and
	// the latter ignored.
	//
	// To set the Retryer field in a type-safe manner and with chaining, use
	// the request.WithRetryer helper function:
	//
	//   cfg := request.WithRetryer(aws.NewConfig(), myRetryer)
	Retryer aws.Retryer

	// An integer value representing the logging level. The default log level
	// is zero (LogOff), which represents no logging. To enable logging set
	// to a LogLevel Value.
	LogLevel aws.LogLevel

	// The logger writer interface to write logging messages to. Defaults to
	// standard out.
	Logger aws.Logger

	// DisableRestProtocolURICleaning will not clean the URL path when making
	// rest protocol requests.  Will default to false. This would only be used
	// for empty directory names in s3 requests.
	//
	// Example:
	//    cfg, err := external.LoadDefaultAWSConfig()
	//    cfg.DisableRestProtocolURICleaning = true
	//
	//    svc := s3.New(cfg)
	//    out, err := svc.GetObject(&s3.GetObjectInput {
	//    	Bucket: aws.String("bucketname"),
	//    	Key: aws.String("//foo//bar//moo"),
	//    })
	//
	// TODO need better way of representing support for this concept. Not on Config.
	DisableRestProtocolURICleaning bool

	// DisableEndpointHostPrefix will disable the SDK's behavior of prefixing
	// request endpoint hosts with modeled information.
	//
	// Disabling this feature is useful when you want to use local endpoints
	// for testing that do not support the modeled host prefix pattern.
	DisableEndpointHostPrefix bool
}

A Config provides service configuration for service clients. This struct is copied from github.com/aws/aws-sdk-go-v2/aws.Config

func NewConfig

func NewConfig(key, secret, region string) Config

NewConfig returns a new Config with access key, secret key and region.

func (Config) AWSConfig

func (c Config) AWSConfig() aws.Config

AWSConfig converts the config values to aws.Config.

type StaticCredentialsProvider

type StaticCredentialsProvider struct {
	Value aws.Credentials
}

A StaticCredentialsProvider is a set of credentials which are set programmatically.

func NewStaticCredentialsProvider

func NewStaticCredentialsProvider(key, secret string) StaticCredentialsProvider

NewStaticCredentialsProvider return a StaticCredentialsProvider initialized with the NIFCLOUD credentials passed in.

func (StaticCredentialsProvider) Retrieve

Retrieve returns the credentials or error if the credentials are invalid.

Directories

Path Synopsis
signer
v2

Jump to

Keyboard shortcuts

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