common

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 4 Imported by: 1 module, 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 common holds helpers shared across oneauth examples — the seam where "every example needs this now" updates land in one place instead of N copy-paste edits.

Each example follows the same shape:

main.go         — boots the auth server and resource server. With
                  --serve, binds them on real ports and blocks so any
                  external client can drive them. Default behavior
                  spins them up in-process and runs the walkthrough.
walkthrough.go  — defines the demokit demo (the "client") that drives
                  the servers and prints the protocol exchange.

SetupRenderer wires the TUI renderer when --tui is passed; the default PlainRenderer stays in place otherwise. Examples should call this before demo.Execute().

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOneAuthLogger

func NewOneAuthLogger(prefix string, extraRules ...demokit.ColorRule) *log.Logger

NewOneAuthLogger returns the canonical demokit ColorLogger used across oneauth examples. The baseline rules tint:

  • error= and ERROR markers (red)
  • [http] → outbound HTTP requests (gray / dim blue)
  • [http] ← inbound HTTP responses (cyan / blue)
  • "minted" / "issued" token-mint events (bright green / green)

extraRules append to the baseline so callers can tint example-specific lines without losing the shared set.

func SetupRenderer

func SetupRenderer(demo *demokit.Demo)

SetupRenderer wires the renderer matching demokit's --mode (or the legacy --tui alias):

--mode=tui      → tui.New()              (Lipgloss boxes)
--mode=notebook → notebookbridge.New()   (cell-based UI)
default         → demokit's PlainRenderer

Types

This section is empty.

Jump to

Keyboard shortcuts

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