util

package
v0.0.0-...-454dbe6 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: EUPL-1.2 Imports: 19 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddApiKeyTransport

func AddApiKeyTransport(t http.RoundTripper) http.RoundTripper

func AddHttpHeaderTransport deprecated

func AddHttpHeaderTransport(t http.RoundTripper, name, value string) http.RoundTripper

Deprecated: do not use commons/util package

func AddUserAgentTransport

func AddUserAgentTransport(t http.RoundTripper, userAgent string) http.RoundTripper

func AnyToStruct

func AnyToStruct[T any](obj interface{}) (*T, error)

func GenerateRandomString

func GenerateRandomString(n int) string

func GetEnv

func GetEnv(key, fallback string) string

func JWSToText

func JWSToText(jwsData string) string

func OpenBrowser

func OpenBrowser(url string)

func RandomJWK

func RandomJWK() (jwk.Key, error)

func ResponseToText

func ResponseToText(resp *http.Response) string

Types

type Jwk

type Jwk struct {
	Key jwk.Key
}

small trick to make jwk.Key JSON-serializable

func (*Jwk) MarshalJSON

func (j *Jwk) MarshalJSON() ([]byte, error)

func (*Jwk) ThumbprintString

func (j *Jwk) ThumbprintString(hf crypto.Hash) (string, error)

func (*Jwk) UnmarshalJSON

func (j *Jwk) UnmarshalJSON(data []byte) error

type Jwks

type Jwks struct {
	Keys jwk.Set
}

small trick to make jwk.Set JSON-serializable

func (*Jwks) MarshalJSON

func (j *Jwks) MarshalJSON() ([]byte, error)

func (*Jwks) UnmarshalJSON

func (j *Jwks) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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