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

response

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AppName      string
	BuildDate    string
	CommitSHA    string
	Version      string
	BuildVersion string
)
View Source
var HealthBuilder = builder.Register(healthBuilder{}, Health{}).(healthBuilder)
View Source
var HealthDetailBuilder = builder.Register(healthDetailBuilder{}, HealthDetail{}).(healthDetailBuilder)
View Source
var ResourceStatusResponseBuilder = builder.Register(resourceStatusResponseBuilder{}, ResourceStatusResponse{}).(resourceStatusResponseBuilder)

Functions

func HTTPStatusFor

func HTTPStatusFor(kind errors.Kind) int

HTTPStatusFor maps a boost error Kind to its HTTP status code.

Types

type AdditionalInfoError

type AdditionalInfoError struct {
	Key   string `json:"errorCode"`
	Value string `json:"message"`
}

type Error

type Error struct {
	HttpStatusCode int                   `json:"httpStatusCode"`
	ErrorCode      string                `json:"errorCode,omitempty"`
	Message        string                `json:"message"`
	Info           string                `json:"info,omitempty"`
	AdditionalInfo []AdditionalInfoError `json:"additionalInfo,omitempty"`
}

type Health

type Health struct {
	Status  HealthStatus   `json:"status" binding:"required"`
	Details []HealthDetail `json:"details,omitempty" binding:"required"`
}

func NewHealth

func NewHealth(ctx context.Context) (Health, int)

type HealthDetail

type HealthDetail struct {
	Status      HealthStatus `json:"status" binding:"required"`
	Name        string       `json:"name" binding:"required"`
	Description string       `json:"description,omitempty" binding:"required"`
	Error       string       `json:"error,omitempty"`
}

type HealthStatus

type HealthStatus int
const (
	Ok HealthStatus = iota
	Partial
	Down
)

func (HealthStatus) MarshalJSON

func (s HealthStatus) MarshalJSON() ([]byte, error)

MarshalJSON marshals the enum as a quoted json string

func (HealthStatus) String

func (s HealthStatus) String() string

func (*HealthStatus) UnmarshalJSON

func (s *HealthStatus) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals a quoted json string to the enum value

type ResourceStatusResponse

type ResourceStatusResponse struct {
	ApplicationName       string `json:"applicationName" binding:"required"`
	ImplementationVersion string `json:"implementationVersion" binding:"required"`
	ImplementationBuild   string `json:"implementationBuild" binding:"required"`
	CommitSHA             string `json:"commitSHA" binding:"required"`
	BuildDate             string `json:"buildDate" binding:"required"`
}

func NewResourceStatus

func NewResourceStatus() ResourceStatusResponse

type UnprocessableEntityError

type UnprocessableEntityError struct {
	Error
	ValidationErrors []ValidationError `json:"validationErrors,omitempty"`
}

type ValidationError

type ValidationError struct {
	FieldName string `json:"fieldName"`
	Message   string `json:"message"`
}

Jump to

Keyboard shortcuts

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