helpers

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 8 Imported by: 2 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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