Help us shape the future of Go! Take the 2026 Go Developer Survey

demoserver

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package demoserver is a small API matching the user-creation example collection, so the collection (and Flowi) can be tried without a real backend. It also has helper routes for exercising HTTP behaviour: redirects, cookies, status codes, compression and large bodies.

It keeps no state: tokens are signed with a key made when the handler is created, so restarting the server invalidates them.

Index

Constants

View Source
const ClientID = "demo-client"

ClientID is what GET /v1/config returns and POST /v1/verify requires in X-Client-Id.

Variables

This section is empty.

Functions

func Handler

func Handler(o Options) http.Handler

Handler returns the demo API.

Types

type Options

type Options struct {
	Password string           // the password login accepts
	Clock    func() time.Time // nil → time.Now
}

Options configures the demo API.

Directories

Path Synopsis
cmd
flowi-demo-server command
Command flowi-demo-server serves the demo API that the user-creation example collection talks to.
Command flowi-demo-server serves the demo API that the user-creation example collection talks to.

Jump to

Keyboard shortcuts

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