httpapi

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package httpapi exposes the catalog through a single authenticated operation dispatcher.

Index

Constants

This section is empty.

Variables

View Source
var Tools = []string{"search", "get_asset", "get_service", "list_by_host", "list_by_network", "get_site", "topology", "list_outdated", "get_changes", "get_context", "put_context", "record_note", "propose_change", "update", "mark_verified", "check_versions"}

Functions

func IntArg

func IntArg(v string) json.RawMessage

func StringArg

func StringArg(v string) json.RawMessage

func WriteError

func WriteError(w http.ResponseWriter, err error)

func WriteJSON

func WriteJSON(w http.ResponseWriter, status int, v any)

Types

type APIError

type APIError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
	Details any    `json:"details,omitempty"`
}

func Error

func Error(err error) (int, APIError)

type Args

type Args map[string]json.RawMessage

func (Args) Bool

func (a Args) Bool(k string) bool

func (Args) Int

func (a Args) Int(k string) int64

func (Args) Object

func (a Args) Object() (catalog.Object, error)

func (Args) Patch

func (a Args) Patch() (catalog.Patch, error)

func (Args) String

func (a Args) String(k string) string

type Engine

type Engine struct {
	Auth              auth.Service
	Catalog           catalog.Service
	VersionChecker    *versioncheck.Checker
	AllowInsecureHTTP bool
}

func (Engine) Call

func (e Engine) Call(ctx context.Context, p auth.Principal, op string, a Args, via string) (any, error)

func (Engine) Handler

func (e Engine) Handler() http.Handler

func (Engine) Principal

func (e Engine) Principal(r *http.Request) (auth.Principal, error)

Jump to

Keyboard shortcuts

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