registrytoken

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package registrytoken is the GET /v2/token response shape (ADR-0031). The token-minting flow and JWT access-claim parsing stay in consumers — only the response type is contract.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

type Response struct {
	Token       string `json:"token"`
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in,omitempty"`
	IssuedAt    string `json:"issued_at,omitempty"`
}

Response is the hub's Distribution bearer-token response. The Distribution spec splits the field — some responses carry token, some access_token — so use BearerToken to read it rather than picking a field by hand.

func (Response) BearerToken

func (r Response) BearerToken() string

BearerToken returns the registry bearer token, preferring Token and falling back to AccessToken. Empty only if the hub returned neither.

Jump to

Keyboard shortcuts

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