handlers

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package handlers provides HTTP request handlers for the Gate API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorResponse

type ErrorResponse struct {
	Code              string `json:"error_code"`
	Message           string `json:"error"`
	RequestID         string `json:"request_id"`
	RetryAfterSeconds int    `json:"retry_after_seconds,omitempty"`
}

ErrorResponse is the JSON body returned for all exchange failures.

type ExchangeHandler

type ExchangeHandler struct {
	// contains filtered or unexported fields
}

ExchangeHandler handles POST /api/v1/exchange requests.

func NewExchangeHandler

func NewExchangeHandler(service sts.Exchanger) (*ExchangeHandler, error)

NewExchangeHandler creates an ExchangeHandler with the given STS service. It pulls a tracer and meters from the global OTel providers.

func (*ExchangeHandler) Exchange

func (h *ExchangeHandler) Exchange(w http.ResponseWriter, r *http.Request)

Exchange delegates to the STS service and writes the response.

type ExchangeInput

type ExchangeInput struct {
	Body sts.ExchangeRequest `in:"body=json"`
}

ExchangeInput is the httpin-decoded input for the exchange endpoint.

type InfoHandler

type InfoHandler struct{}

InfoHandler serves build and version information.

func NewInfoHandler

func NewInfoHandler() *InfoHandler

NewInfoHandler creates an InfoHandler.

func (InfoHandler) GetInfo

func (InfoHandler) GetInfo(w http.ResponseWriter, r *http.Request)

GetInfo writes build and version information as JSON.

type InfoResponse

type InfoResponse struct {
	FIPSEnabled bool `json:"fips_enabled"`
}

InfoResponse is the JSON body returned by the info endpoint.

Jump to

Keyboard shortcuts

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