go-lib

module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: Apache-2.0

README

Introduction

A collection of Go libraries.

Index

  1. auth/google/compute: verification of Google Compute Engine identity JSON Web Tokens (see Google's documentation). This is useful for applications that want to accept such JWTs as an authentication mechanism.
  2. cache: a cache for values that need to be periodically re-evaluated where evaluations are expensive enough to justify ensuring only one Goroutine evaluates while other Goroutines wait for the evaluation. This is equivalent to using a Mutex, but this package supports a Context parameter. This primitive is useful for caching remote resources such as JWKS' and authentication tokens.
  3. http: primitives focused around RFC6750. This is useful for HTTP servers that want to implement the Bearer authentication scheme.
  4. test: logrus logging in tests. For example:
    import "github.com/jbrekelmans/go-lib/test"
    
    func Test_MyTest(t *testing.T) {
        defer test.RedirectLogs(t).Dispose()
        // Any calls that MyTest makes to logrus's standard logger are forwarded to t.Logf.
        MyTest()
    }
    
  5. url: url validation and normalization functions.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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