response

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	// Code is the numeric error code for the error response. See https://api.sfomuseum.org/errors/ for details.
	Code int `json:"code"`
	// Message is the human-readable message describing the error.
	Message string `json:"message"`
}

Error defines a SFO Museum API error response.

type Method

type Method struct {
	// Name is the name of the API method.
	Name string `json:"name"`
	// RequestMethod is the HTTP request method that the API method should be invoked with.
	RequestMethod string `json:"request_method"`
	// Description descibes	the API method.
	Description string `json:"description"`
	// RequiresPermissions is the minimum numeric permissions type necessary to invoke the method.
	RequiresPermissions int `json:"requires_perms"`
	// Parameters are zero or more `Parameter` instances associated with the API method.
	Parameters []Parameter `json:"parameters"`
	// Errors are zero or more `Error` instances associated with the API method (in addition to common errors).
	Errors []Error `json:"errors"`
	// Notes are zero or more text-based notes relating to the API method.
	Notes []string `json:"notes"`
	// Paginated is a boolean value indicating whether the API method returns paginated responses.
	Paginated bool `json:"paginated"`
}

Method defines a SFO Museum API method.

type Pagination

type Pagination struct {
	// The current page of results for an API request.
	Page int `json:"page"`
	// The total number of pages of results for an API request.
	Pages int `json:"pages"`
	// The number of results, per page, for an API request.
	PerPage int `json:"perpage"`
	// The total number of results, across all pages, for an API request.
	Total int `json:"total"`
}

Pagination is a struct containing pagination metrics for a given API response.

func DerivePagination

func DerivePagination(ctx context.Context, fh io.ReadSeekCloser) (*Pagination, error)

Given an API response try to derive pagination metrics.

type Parameter

type Parameter struct {
	// Name is the name of the API method parameter.
	Name string `json:"name"`
	// Type is a string label describing the type of the API method parameter.
	Type string `json:"type"`
	// Description descibes the API method	parameter.
	Description string `json:"description"`
	// Required indicates with the API method parameter must be included with an API method request.
	Required bool `json:"required"`
	// Example is a stringified example value for the API method	parameter.
	Example string `json:"example"`
}

Parameter defines a SFO Museum API method parameter.

Jump to

Keyboard shortcuts

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