Documentation ¶
Index ¶
- Constants
- func CanBeNil(rt reflect.Type) bool
- func Cast[T any](obj any) (T, error)
- func ConvertToError(e any) error
- func ConvertToMap(input any) (map[any]any, error)
- func ConvertToSlice(input any) ([]any, error)
- func ConvertToSliceOf[T any](obj any) ([]T, bool)
- func ConvertToTimestamp(obj any) (time.Time, error)
- func CopyMemory(mem wasm.Memory, sourceOffset, targetOffset, size uint32) bool
- func DebugModeEnabled() bool
- func DecodeUTF16(bytes []byte) string
- func DereferencePointer(obj any) any
- func EncodeUTF16(str string) []byte
- func EnvVarFlagEnabled(envVarName string) bool
- func FlushSentryEvents()
- func GenerateUUIDv7() string
- func GetTime() time.Time
- func HasNil(x any) bool
- func HttpClient() *http.Client
- func InitSentry(rootPath string)
- func JsonDeserialize(data []byte, v any) error
- func JsonSerialize(v any) ([]byte, error)
- func MakePointer(obj any) any
- func MapKeys[M ~map[K]V, K comparable, V any](m M) []K
- func MapKeysAndValues[M ~map[K]V, K comparable, V any](m M) ([]K, []V)
- func MapToStruct(m map[string]any, result any) error
- func MapValues[M ~map[K]V, K comparable, V any](m M) []V
- func NewSentrySpan(ctx context.Context, funcName string) (*sentry.Span, context.Context)
- func NewSentrySpanForCallingFunc(ctx context.Context) (*sentry.Span, context.Context)
- func NewSentrySpanForCurrentFunc(ctx context.Context) (*sentry.Span, context.Context)
- func NilIf[T any](condition bool, val T) *T
- func NilIfEmpty(val string) *string
- func ParseTime(s string) (time.Time, error)
- func SplitConsoleOutputLine(line string) (level string, message string)
- func TraceModeEnabled() bool
- func TrimStringBefore(s string, sep string) string
- func WriteJsonContentHeader(w http.ResponseWriter)
- type Cleaner
- type HttpResult
- type JSONTime
- type LogMessage
- type OutputBuffers
Constants ¶
const CustomTypesContextKey contextKey = "custom_types"
const ExecutionIdContextKey contextKey = "execution_id"
const FunctionMessagesContextKey contextKey = "function_messages"
const FunctionNameContextKey contextKey = "function_name"
const FunctionOutputContextKey contextKey = "function_output"
const MetadataContextKey contextKey = "metadata"
const PluginContextKey contextKey = "plugin"
const TimeFormat = "2006-01-02T15:04:05.000Z"
TimeFormat is the default time format template throughout the application. It is used for output to logs, query results, etc.
const WasmAdapterContextKey contextKey = "wasm_adapter"
const WasmHostContextKey contextKey = "wasm_host"
Variables ¶
This section is empty.
Functions ¶
func ConvertToError ¶
func ConvertToSlice ¶
func ConvertToSliceOf ¶
func DebugModeEnabled ¶
func DebugModeEnabled() bool
func DecodeUTF16 ¶
func DereferencePointer ¶
func EncodeUTF16 ¶
func EnvVarFlagEnabled ¶
func FlushSentryEvents ¶
func FlushSentryEvents()
func GenerateUUIDv7 ¶
func GenerateUUIDv7() string
func HasNil ¶
HasNil returns true if the given interface value is nil, or contains an object that is nil.
func HttpClient ¶
func InitSentry ¶
func InitSentry(rootPath string)
func JsonDeserialize ¶
JsonDeserialize deserializes the given JSON data into the given value. Unlike json.Unmarshal, it does not automatically use a float64 type for numbers. It uses goccy/go-json to improve performance.
func JsonSerialize ¶
JsonSerialize serializes the given value to JSON. Unlike json.Marshal, it does not escape HTML characters. It uses goccy/go-json to improve performance.
func MakePointer ¶
func MapKeys ¶
func MapKeys[M ~map[K]V, K comparable, V any](m M) []K
func MapKeysAndValues ¶
func MapKeysAndValues[M ~map[K]V, K comparable, V any](m M) ([]K, []V)
func MapValues ¶
func MapValues[M ~map[K]V, K comparable, V any](m M) []V
func NewSentrySpan ¶
func NilIfEmpty ¶
func ParseTime ¶
ParseTime parses a string into a time.Time object. It tries multiple formats to parse the string.
func SplitConsoleOutputLine ¶
func TraceModeEnabled ¶
func TraceModeEnabled() bool
func TrimStringBefore ¶
func WriteJsonContentHeader ¶
func WriteJsonContentHeader(w http.ResponseWriter)
Types ¶
type HttpResult ¶
func (HttpResult[T]) Duration ¶
func (r HttpResult[T]) Duration() time.Duration
type JSONTime ¶
JSONTime extends the time type so that when it marshals to JSON the output is fixed to include milliseconds as three digits.
func (JSONTime) MarshalJSON ¶
func (*JSONTime) UnmarshalJSON ¶
type LogMessage ¶
func TransformConsoleOutput ¶
func TransformConsoleOutput(buffers OutputBuffers) []LogMessage
func (LogMessage) IsError ¶
func (l LogMessage) IsError() bool
type OutputBuffers ¶
func NewOutputBuffers ¶
func NewOutputBuffers() OutputBuffers