utils

package
v0.0.0-...-4d0ad80 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: MIT Imports: 8 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyStruct

func CopyStruct(source, target interface{})

CopyStruct copy source to target based on json tags/*

func DynamoListToInterface

func DynamoListToInterface(items []map[string]types.AttributeValue, i interface{})

DynamoListToInterface unmarshal items map to model based on dynamoav tags/*

func DynamoMapToInterface

func DynamoMapToInterface(item map[string]types.AttributeValue, i interface{})

DynamoMapToInterface unmarshal items map to model based on dynamoav tags/*

func EncodeStr

func EncodeStr(s string) string

EncodeStr encodes string to base64/*

func GetEnv

func GetEnv(name, value string) string

GetEnv returns a string value/*

func NewContextWithTimeout

func NewContextWithTimeout(inSec time.Duration) (context.Context, context.CancelFunc)

NewContextWithTimeout creates new context with timeout/*

func StringToInt

func StringToInt(value string) int64

StringToInt converts string to int64/*

func StringToStruct

func StringToStruct(s string, i interface{})

StringToStruct parse string to struct/*

func ToDynamoDBMap

func ToDynamoDBMap(i interface{}) map[string]types.AttributeValue

ToDynamoDBMap converts interface to map[string]*dynamodb.Attribute. Just use this function when your struct has configured json tags/*

func ToString

func ToString(i interface{}) string

ToString converts interface to string/*

Types

This section is empty.

Jump to

Keyboard shortcuts

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