book

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package book provides a method starting the book server within another golang code, so as to support the testing of other services within the practable ecosystem, like status it is NOT intended for production usage

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminToken

func AdminToken(cfg Config, ttl int64, subject string) (string, error)

AdminAuth provides a pre-pared authorization header for testing purposes

func Run

func Run(ctx context.Context, cfg Config)

Types

type AccessToken

type AccessToken struct {

	// Audience
	// Required: true
	Aud *string `json:"aud"`

	// Expires At
	// Required: true
	Exp *float64 `json:"exp"`

	// Issued At
	Iat float64 `json:"iat,omitempty"`

	// Not before
	// Required: true
	Nbf *float64 `json:"nbf"`

	// List of scopes
	// Required: true
	Scopes []string `json:"scopes"`

	// Subject
	// Required: true
	Sub *string `json:"sub"`

	// token
	// Required: true
	Token *string `json:"token"`
}

type Config

type Config struct {
	AccessTokenLifetime   time.Duration
	CheckEvery            time.Duration
	DisableCancelAfterUse bool
	Host                  string
	MinUserNameLength     int
	Now                   func() time.Time
	Port                  int
	PruneEvery            time.Duration
	RelaySecret           string
	RequestTimeout        time.Duration
	StoreSecret           string
}

func DefaultConfig

func DefaultConfig() Config

Jump to

Keyboard shortcuts

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