helpers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package helpers hosts shared helper functions reused across packages

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneOAuthToken

func CloneOAuthToken(token *oauth2.Token) *oauth2.Token

CloneOAuthToken returns a shallow copy of the token to prevent callers from modifying shared state

func CloneOIDCClaims

func CloneOIDCClaims(claims *oidc.IDTokenClaims) *oidc.IDTokenClaims

CloneOIDCClaims returns a shallow copy of the claims struct

func DeepCloneMap

func DeepCloneMap(src map[string]any) map[string]any

DeepCloneMap creates a deep copy of a map[string]any, recursively cloning nested maps

Types

type HashBuilder

type HashBuilder struct {
	// contains filtered or unexported fields
}

HashBuilder provides a composable interface for building content hashes

func NewHashBuilder

func NewHashBuilder() *HashBuilder

NewHashBuilder creates a new hash builder using SHA-256

func (*HashBuilder) Hex

func (h *HashBuilder) Hex() string

Hex returns the hex-encoded hash digest

func (*HashBuilder) WriteSortedMap

func (h *HashBuilder) WriteSortedMap(m map[string]any) *HashBuilder

WriteSortedMap adds a map[string]any to the hash in deterministic order

func (*HashBuilder) WriteStrings

func (h *HashBuilder) WriteStrings(values ...string) *HashBuilder

WriteStrings adds one or more strings to the hash, skipping empty values

func (*HashBuilder) WriteTime

func (h *HashBuilder) WriteTime(t time.Time) *HashBuilder

WriteTime adds a time value to the hash in RFC3339Nano format

func (*HashBuilder) WriteTimePtr

func (h *HashBuilder) WriteTimePtr(t *time.Time) *HashBuilder

WriteTimePtr adds a time pointer to the hash, handling nil values

Jump to

Keyboard shortcuts

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