5 // This file was taken from the aws go sdk
7 // String returns a pointer to of the string value passed in.
8 func String(v string) *string {
12 // StringValue returns the value of the string pointer passed in or
13 // "" if the pointer is nil.
14 func StringValue(v *string) string {
21 // StringSlice converts a slice of string values into a slice of
23 func StringSlice(src []string) []*string {
24 dst := make([]*string, len(src))
25 for i := 0; i < len(src); i++ {
31 // StringValueSlice converts a slice of string pointers into a slice of
33 func StringValueSlice(src []*string) []string {
34 dst := make([]string, len(src))
35 for i := 0; i < len(src); i++ {
43 // StringMap converts a string map of string values into a string
44 // map of string pointers
45 func StringMap(src map[string]string) map[string]*string {
46 dst := make(map[string]*string)
47 for k, val := range src {
54 // StringValueMap converts a string map of string pointers into a string
55 // map of string values
56 func StringValueMap(src map[string]*string) map[string]string {
57 dst := make(map[string]string)
58 for k, val := range src {
66 // Bool returns a pointer to of the bool value passed in.
67 func Bool(v bool) *bool {
71 // BoolValue returns the value of the bool pointer passed in or
72 // false if the pointer is nil.
73 func BoolValue(v *bool) bool {
80 // BoolSlice converts a slice of bool values into a slice of
82 func BoolSlice(src []bool) []*bool {
83 dst := make([]*bool, len(src))
84 for i := 0; i < len(src); i++ {
90 // BoolValueSlice converts a slice of bool pointers into a slice of
92 func BoolValueSlice(src []*bool) []bool {
93 dst := make([]bool, len(src))
94 for i := 0; i < len(src); i++ {
102 // BoolMap converts a string map of bool values into a string
103 // map of bool pointers
104 func BoolMap(src map[string]bool) map[string]*bool {
105 dst := make(map[string]*bool)
106 for k, val := range src {
113 // BoolValueMap converts a string map of bool pointers into a string
114 // map of bool values
115 func BoolValueMap(src map[string]*bool) map[string]bool {
116 dst := make(map[string]bool)
117 for k, val := range src {
125 // Int returns a pointer to of the int value passed in.
126 func Int(v int) *int {
130 // IntValue returns the value of the int pointer passed in or
131 // 0 if the pointer is nil.
132 func IntValue(v *int) int {
139 // IntSlice converts a slice of int values into a slice of
141 func IntSlice(src []int) []*int {
142 dst := make([]*int, len(src))
143 for i := 0; i < len(src); i++ {
149 // IntValueSlice converts a slice of int pointers into a slice of
151 func IntValueSlice(src []*int) []int {
152 dst := make([]int, len(src))
153 for i := 0; i < len(src); i++ {
161 // IntMap converts a string map of int values into a string
162 // map of int pointers
163 func IntMap(src map[string]int) map[string]*int {
164 dst := make(map[string]*int)
165 for k, val := range src {
172 // IntValueMap converts a string map of int pointers into a string
174 func IntValueMap(src map[string]*int) map[string]int {
175 dst := make(map[string]int)
176 for k, val := range src {
184 // Int32 returns a pointer to of the int64 value passed in.
185 func Int32(v int32) *int32 {
189 // Int32Value returns the value of the int64 pointer passed in or
190 // 0 if the pointer is nil.
191 func Int32Value(v *int32) int32 {
198 // Int32Slice converts a slice of int64 values into a slice of
200 func Int32Slice(src []int32) []*int32 {
201 dst := make([]*int32, len(src))
202 for i := 0; i < len(src); i++ {
208 // Int32ValueSlice converts a slice of int32 pointers into a slice of
210 func Int32ValueSlice(src []*int32) []int32 {
211 dst := make([]int32, len(src))
212 for i := 0; i < len(src); i++ {
220 // Int32Map converts a string map of int32 values into a string
221 // map of int32 pointers
222 func Int32Map(src map[string]int32) map[string]*int32 {
223 dst := make(map[string]*int32)
224 for k, val := range src {
231 // Int32ValueMap converts a string map of int32 pointers into a string
232 // map of int32 values
233 func Int32ValueMap(src map[string]*int32) map[string]int32 {
234 dst := make(map[string]int32)
235 for k, val := range src {
243 // Int64 returns a pointer to of the int64 value passed in.
244 func Int64(v int64) *int64 {
248 // Int64Value returns the value of the int64 pointer passed in or
249 // 0 if the pointer is nil.
250 func Int64Value(v *int64) int64 {
257 // Int64Slice converts a slice of int64 values into a slice of
259 func Int64Slice(src []int64) []*int64 {
260 dst := make([]*int64, len(src))
261 for i := 0; i < len(src); i++ {
267 // Int64ValueSlice converts a slice of int64 pointers into a slice of
269 func Int64ValueSlice(src []*int64) []int64 {
270 dst := make([]int64, len(src))
271 for i := 0; i < len(src); i++ {
279 // Int64Map converts a string map of int64 values into a string
280 // map of int64 pointers
281 func Int64Map(src map[string]int64) map[string]*int64 {
282 dst := make(map[string]*int64)
283 for k, val := range src {
290 // Int64ValueMap converts a string map of int64 pointers into a string
291 // map of int64 values
292 func Int64ValueMap(src map[string]*int64) map[string]int64 {
293 dst := make(map[string]int64)
294 for k, val := range src {
302 // Uint returns a pouinter to of the uint value passed in.
303 func Uint(v uint) *uint {
307 // UintValue returns the value of the uint pouinter passed in or
308 // 0 if the pouinter is nil.
309 func UintValue(v *uint) uint {
316 // UintSlice converts a slice of uint values uinto a slice of
318 func UintSlice(src []uint) []*uint {
319 dst := make([]*uint, len(src))
320 for i := 0; i < len(src); i++ {
326 // UintValueSlice converts a slice of uint pouinters uinto a slice of
328 func UintValueSlice(src []*uint) []uint {
329 dst := make([]uint, len(src))
330 for i := 0; i < len(src); i++ {
338 // UintMap converts a string map of uint values uinto a string
339 // map of uint pouinters
340 func UintMap(src map[string]uint) map[string]*uint {
341 dst := make(map[string]*uint)
342 for k, val := range src {
349 // UintValueMap converts a string map of uint pouinters uinto a string
350 // map of uint values
351 func UintValueMap(src map[string]*uint) map[string]uint {
352 dst := make(map[string]uint)
353 for k, val := range src {
361 // Uint32 returns a pouinter to of the uint64 value passed in.
362 func Uint32(v uint32) *uint32 {
366 // Uint32Value returns the value of the uint64 pouinter passed in or
367 // 0 if the pouinter is nil.
368 func Uint32Value(v *uint32) uint32 {
375 // Uint32Slice converts a slice of uint64 values uinto a slice of
377 func Uint32Slice(src []uint32) []*uint32 {
378 dst := make([]*uint32, len(src))
379 for i := 0; i < len(src); i++ {
385 // Uint32ValueSlice converts a slice of uint32 pouinters uinto a slice of
387 func Uint32ValueSlice(src []*uint32) []uint32 {
388 dst := make([]uint32, len(src))
389 for i := 0; i < len(src); i++ {
397 // Uint32Map converts a string map of uint32 values uinto a string
398 // map of uint32 pouinters
399 func Uint32Map(src map[string]uint32) map[string]*uint32 {
400 dst := make(map[string]*uint32)
401 for k, val := range src {
408 // Uint32ValueMap converts a string map of uint32 pouinters uinto a string
409 // map of uint32 values
410 func Uint32ValueMap(src map[string]*uint32) map[string]uint32 {
411 dst := make(map[string]uint32)
412 for k, val := range src {
420 // Uint64 returns a pouinter to of the uint64 value passed in.
421 func Uint64(v uint64) *uint64 {
425 // Uint64Value returns the value of the uint64 pouinter passed in or
426 // 0 if the pouinter is nil.
427 func Uint64Value(v *uint64) uint64 {
434 // Uint64Slice converts a slice of uint64 values uinto a slice of
436 func Uint64Slice(src []uint64) []*uint64 {
437 dst := make([]*uint64, len(src))
438 for i := 0; i < len(src); i++ {
444 // Uint64ValueSlice converts a slice of uint64 pouinters uinto a slice of
446 func Uint64ValueSlice(src []*uint64) []uint64 {
447 dst := make([]uint64, len(src))
448 for i := 0; i < len(src); i++ {
456 // Uint64Map converts a string map of uint64 values uinto a string
457 // map of uint64 pouinters
458 func Uint64Map(src map[string]uint64) map[string]*uint64 {
459 dst := make(map[string]*uint64)
460 for k, val := range src {
467 // Uint64ValueMap converts a string map of uint64 pouinters uinto a string
468 // map of uint64 values
469 func Uint64ValueMap(src map[string]*uint64) map[string]uint64 {
470 dst := make(map[string]uint64)
471 for k, val := range src {
479 // Float64 returns a pointer to of the float64 value passed in.
480 func Float64(v float64) *float64 {
484 // Float64Value returns the value of the float64 pointer passed in or
485 // 0 if the pointer is nil.
486 func Float64Value(v *float64) float64 {
493 // Float64Slice converts a slice of float64 values into a slice of
495 func Float64Slice(src []float64) []*float64 {
496 dst := make([]*float64, len(src))
497 for i := 0; i < len(src); i++ {
503 // Float64ValueSlice converts a slice of float64 pointers into a slice of
505 func Float64ValueSlice(src []*float64) []float64 {
506 dst := make([]float64, len(src))
507 for i := 0; i < len(src); i++ {
515 // Float64Map converts a string map of float64 values into a string
516 // map of float64 pointers
517 func Float64Map(src map[string]float64) map[string]*float64 {
518 dst := make(map[string]*float64)
519 for k, val := range src {
526 // Float64ValueMap converts a string map of float64 pointers into a string
527 // map of float64 values
528 func Float64ValueMap(src map[string]*float64) map[string]float64 {
529 dst := make(map[string]float64)
530 for k, val := range src {
538 // Time returns a pointer to of the time.Time value passed in.
539 func Time(v time.Time) *time.Time {
543 // TimeValue returns the value of the time.Time pointer passed in or
544 // time.Time{} if the pointer is nil.
545 func TimeValue(v *time.Time) time.Time {
552 // TimeSlice converts a slice of time.Time values into a slice of
553 // time.Time pointers
554 func TimeSlice(src []time.Time) []*time.Time {
555 dst := make([]*time.Time, len(src))
556 for i := 0; i < len(src); i++ {
562 // TimeValueSlice converts a slice of time.Time pointers into a slice of
564 func TimeValueSlice(src []*time.Time) []time.Time {
565 dst := make([]time.Time, len(src))
566 for i := 0; i < len(src); i++ {
574 // TimeMap converts a string map of time.Time values into a string
575 // map of time.Time pointers
576 func TimeMap(src map[string]time.Time) map[string]*time.Time {
577 dst := make(map[string]*time.Time)
578 for k, val := range src {
585 // TimeValueMap converts a string map of time.Time pointers into a string
586 // map of time.Time values
587 func TimeValueMap(src map[string]*time.Time) map[string]time.Time {
588 dst := make(map[string]time.Time)
589 for k, val := range src {