types

package
v0.0.0-...-5613f3b Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: Apache-2.0 Imports: 1 Imported by: 45

Documentation

Overview

GOlang value <--> pointer

##Acknowledgements This repo was started as a fork of https://github.com/aws/aws-sdk-go/blob/master/aws/convert_types.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(v *bool) bool

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

func BoolMap

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

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

func BoolP

func BoolP(v bool) *bool

BoolP returns a pointer to the bool value passed in.

func BoolPMap

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

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

func BoolPSlice

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

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

func BoolSlice

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

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

func FalseP

func FalseP() *bool

FalseP returns a pointer to `false` boolean value.

func Float64

func Float64(v *float64) float64

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

func Float64Map

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

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

func Float64P

func Float64P(v float64) *float64

Float64P returns a pointer to the float64 value passed in.

func Float64PMap

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

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

func Float64PSlice

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

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

func Float64Slice

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

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

func Int

func Int(v *int) int

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

func Int32

func Int32(v *int32) int32

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

func Int32Map

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

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

func Int32P

func Int32P(v int32) *int32

Int32P returns a pointer to the int32 value passed in.

func Int32PMap

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

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

func Int32PSlice

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

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

func Int32Slice

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

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

func Int64

func Int64(v *int64) int64

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

func Int64Map

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

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

func Int64P

func Int64P(v int64) *int64

Int64P returns a pointer to the int64 value passed in.

func Int64PMap

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

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

func Int64PSlice

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

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

func Int64Slice

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

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

func IntMap

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

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

func IntP

func IntP(v int) *int

IntP returns a pointer to the int value passed in.

func IntPMap

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

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

func IntPSlice

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

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

func IntSlice

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

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

func String

func String(v *string) string

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

func StringMap

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

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

func StringP

func StringP(v string) *string

StringP returns a pointer to the string value passed in.

func StringPMap

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

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

func StringPSlice

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

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

func StringSlice

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

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

func Time

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

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

func TimeMap

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

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

func TimeP

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

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

func TimePMap

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

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

func TimePSlice

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

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

func TimeSlice

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

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

func TimeUnixMilli

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 TrueP

func TrueP() *bool

FalseP returns a pointer to `true` boolean value.

func UInt

func UInt(v *uint) uint

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

func UIntMap

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

UIntMap converts a string map of uint pointers into a string map of uint values

func UIntP

func UIntP(v uint) *uint

UIntP returns a pointer to the uint value passed in.

func UIntPMap

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

UIntPMap converts a string map of uint values into a string map of uint pointers

func UIntPSlice

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

UIntPSlice converts a slice of uint values into a slice of uint pointers

func UIntSlice

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

UIntSlice converts a slice of uint pointers into a slice of uint values

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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