utils

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneFromType added in v0.9.0

func CloneFromType(typ reflect.Type) interface{}

CloneFromType returns a new zeroed type of the given type value CONTRACT: typ must be returned from reflect.Value.Type().Elem()

func CloneFromValue added in v0.9.0

func CloneFromValue(x interface{}) interface{}

CloneFromValue clones an arbitrary type and returns a new zeroed type of the instance, IT DOES NOT COPY THE CONTENTS. CONTRACT: must be a pointer

func GeneratePrivKeyAddressPairs added in v0.9.0

func GeneratePrivKeyAddressPairs(n int) (ks []crypto.PrivKey, addrs []sdk.AccAddress)

func GetPtrType added in v0.9.0

func GetPtrType(ptr interface{}) reflect.Type

GetPtrType returns the pointer type CONTRACT: ptr must be a pointer

func SecondsToTime added in v0.9.0

func SecondsToTime(seconds int64) time.Time

SecondsToTime converts unix seconds to time

func StrPtr added in v0.9.0

func StrPtr(str string) *string

func TimeToSeconds added in v0.9.0

func TimeToSeconds(t time.Time) int64

TimeToSeconds converts a time.Time to unix seconds timestamp

func UnderlyingValue added in v0.9.0

func UnderlyingValue(v reflect.Value) reflect.Value

UnderlyingValue gets the underlying value of a reflect.Value

Types

This section is empty.

Jump to

Keyboard shortcuts

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