api

package
v0.0.63 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	Action        *string
	Parameters    *json.RawMessage
	Authorisation *cmr.Auth
}

Request is an API request model. It is a mixture of client data with a data set received from the client. This object is used for API function calls between services.

type RequestHandler

type RequestHandler = func(ar *Request, hr *http.Request, hrw http.ResponseWriter)

type RequestWithOnlyAction

type RequestWithOnlyAction struct {
	// Action is a name of the function which a client wants to perform.
	Action *string `json:"action"`

	// Parameters are function parameters.
	Parameters *json.RawMessage `json:"parameters"`
}

RequestWithOnlyAction is a data set for an API request received from a client in JSON format. This data is later mixed with additional client data.

type Response

type Response struct {
	// Action is a name of the function which was called to get this response.
	Action *string `json:"action"`

	// Result returned by the called function.
	Result any `json:"result"`
}

Jump to

Keyboard shortcuts

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