utilitee

package
v0.1.93 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package utilitee provides utility functions that can be used across the project

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustParseRSAKey added in v0.1.78

func MustParseRSAKey(b64 string) *rsa.PrivateKey

MustParseRSAKey parses a base64-encoded RSA private key in PEM format. It panics if the key cannot be parsed.

func RightNow

func RightNow() time.Time

RightNow is a simple utility function to ensure consistency of returning a "now" timestamp being localized to UTC.

func SafeIntToInt32 added in v0.1.0

func SafeIntToInt32(i *int) int32

SafeIntToInt32 safely converts an *int to int32, returning 0 if the pointer is nil or if the value is out of int32 bounds.

func SliceOfPointersToPointerSlice added in v0.1.69

func SliceOfPointersToPointerSlice[T any](slice []*T) *[]T

SafeIntToInt64 safely converts an *int to int64, returning 0 if the pointer is nil or if the value is out of int64 bounds.

func SliceOfPointersToSlice added in v0.1.69

func SliceOfPointersToSlice[T any](slice []*T) []T

PointerSliceToSliceOfPointers converts a pointer to a slice of values to a slice of pointers. If the input pointer is nil, it returns nil.

func SliceOfValuesToSliceOfPointers added in v0.1.69

func SliceOfValuesToSliceOfPointers[T any](slice []T) []*T

SliceOfValuesToSliceOfPointers converts a slice of values to a slice of pointers. If the input slice is nil, it returns nil.

Types

type ErrPrivateKeyIssue added in v0.1.78

type ErrPrivateKeyIssue struct{}

func (ErrPrivateKeyIssue) Error added in v0.1.78

func (e ErrPrivateKeyIssue) Error() string

Jump to

Keyboard shortcuts

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