openapi

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: Unlicense Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExposeMiddleware

func ExposeMiddleware(ctx huma.Context, next func(huma.Context))

ExposeMiddleware adds the http.Request and http.ResponseWriter to the context for the Operations handler.

func New

func New(
	s server.I, name, version, description string, path string,
	sm *servemux.S,
)

New creates a new openapi.Operations and registers its methods.

func NewHuma

func NewHuma(
	router *servemux.S, name, version, description string,
) (api huma.API)

NewHuma creates a new huma.API with a Scalar docs UI, and a middleware that allows methods to access the http.Request and http.ResponseWriter.

Types

type ExportInput added in v0.2.11

type ExportInput struct {
	Auth string `header:"Authorization" doc:"nostr nip-98 (and expiring variant)" required:"true"`
}

ExportInput is the parameters for the HTTP API Export method.

type ExportOutput added in v0.2.11

type ExportOutput struct{ RawBody []byte }

ExportOutput is the return value of Export. It usually will be line structured JSON.

type ImportInput added in v0.2.12

type ImportInput struct {
	Auth string `header:"Authorization" doc:"nostr nip-98 token for authentication" required:"true"`
}

ImportInput is the parameters of an import operation, authentication and the stream of line structured JSON events.

type ImportOutput added in v0.2.12

type ImportOutput struct{}

ImportOutput is nothing, basically; a 204 or 200 status is expected.

type Operations

type Operations struct {
	server.I

	*servemux.S
	// contains filtered or unexported fields
}

func (*Operations) RegisterExport added in v0.2.11

func (x *Operations) RegisterExport(api huma.API)

RegisterExport implements the Export HTTP API method.

func (*Operations) RegisterImport added in v0.2.12

func (x *Operations) RegisterImport(api huma.API)

RegisterImport is the implementation of the Import operation.

Jump to

Keyboard shortcuts

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