Documentation ¶
Index ¶
- func AttributeValuetoStr(av interface{}) (string, error)
- func Contains(a []interface{}, x interface{}) bool
- func Float64Contains(a []float64, x float64) bool
- func GenerateNewID() string
- func GetErrorMessage(err interface{}) string
- func GetErrorType(err interface{}) string
- func GetEventTypeFromContext(ctx context.Context) interface{}
- func GetPid() string
- func GetStatusCode(responseInterface *interface{}) (int, error)
- func GetStringFieldFromValue(value reflect.Value, fieldName string) (string, bool)
- func GetThisProcess() *process.Process
- func GetTimestamp() int64
- func GetXRayTraceInfo(ctx context.Context) (string, string)
- func Int64Contains(a []int64, x int64) bool
- func IsTimeout(err interface{}) bool
- func MarshalJSON(av AttributeValue) ([]byte, error)
- func MsToTime(t int64) time.Time
- func ReadRequestBody(body io.ReadCloser, contentLength int) (string, io.ReadCloser)
- func Round(x float64) float64
- func SerializeToMap(data interface{}) map[string]interface{}
- func SetEventTypeToContext(ctx context.Context, et reflect.Type) context.Context
- func SetSpanError(span opentracing.Span, err interface{})
- func StringContains(a []string, x string) bool
- func TimeToMs(t time.Time) int64
- type AttributeValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttributeValuetoStr ¶
AttributeValuetoStr returns string representation of an attribute value
func Float64Contains ¶
func GetErrorMessage ¶
func GetErrorMessage(err interface{}) string
GetErrorMessage returns error message
func GetErrorType ¶
func GetErrorType(err interface{}) string
GetErrorType returns type of the error
func GetEventTypeFromContext ¶
GetEventTypeFromContext returns event type passed in context
func GetStatusCode ¶
func GetStringFieldFromValue ¶
func GetThisProcess ¶
GetThisProcess returns process info about this process.
func GetXRayTraceInfo ¶
GetXRayTraceInfo parses X-Ray trace information
func Int64Contains ¶
func IsTimeout ¶
func IsTimeout(err interface{}) bool
IsTimeout returns whether or not an err is a timeout error
func MarshalJSON ¶
func MarshalJSON(av AttributeValue) ([]byte, error)
MarshalJSON implements custom marshaling for AttributeValue
func ReadRequestBody ¶
func ReadRequestBody(body io.ReadCloser, contentLength int) (string, io.ReadCloser)
func SerializeToMap ¶
func SerializeToMap(data interface{}) map[string]interface{}
func SetEventTypeToContext ¶
SetEventTypeToContext returns a context with event type value
func SetSpanError ¶
func SetSpanError(span opentracing.Span, err interface{})
SetSpanError sets the tags related to the given error to the given span
func StringContains ¶
Types ¶
type AttributeValue ¶
type AttributeValue struct { B []byte `type:"blob" json:",omitempty"` BOOL *bool `type:"boolean" json:",omitempty"` BS [][]byte `type:"list" json:",omitempty"` L []*AttributeValue `type:"list" json:",omitempty"` M *map[string]*AttributeValue `type:"map" json:",omitempty"` N *string `type:"string" json:",omitempty"` NS []*string `type:"list" json:",omitempty"` NULL *bool `type:"boolean" json:",omitempty"` S *string `type:"string" json:"S,omitempty"` SS []*string `type:"list" json:",omitempty"` }
AttributeValue is a struct for marshalling dynamodb attribute value without null fields