tapapi

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 1 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tapapi defines the wire contract for complete TAP operations a Hub executes near the data, under /api/v1/tap/*.

A per-KEG route performs one KEG operation. A TAP operation is a whole client-facing workflow (a relationship lookup plus the fields its listing renders, a tag listing, a multi-KEG read) that would otherwise take several round trips. The Hub resolves every KEG a request names through its KEG authority boundary; nothing here grants access.

Rendering stays on the client: responses carry structured rows and resolved field values, never formatted lines.

Index

Constants

View Source
const (
	PathLinks     = "/tap/links"
	PathBacklinks = "/tap/backlinks"
	PathTags      = "/tap/tags"
	PathCat       = "/tap/cat"
)

Paths of the TAP operations, relative to the Hub's /api/v1 root.

Variables

This section is empty.

Functions

This section is empty.

Types

type CatNode

type CatNode struct {
	Ref     string `json:"ref"`
	Content string `json:"content,omitempty"`
	Meta    string `json:"meta,omitempty"`
	Hash    string `json:"hash,omitempty"`
	Error   string `json:"error,omitempty"`
	Code    string `json:"code,omitempty"`
}

CatNode is one requested node, in request order. A node that cannot be read carries Error and Code instead of content, so one failure does not hide the rest of the batch.

type CatRequest

type CatRequest struct {
	Nodes []string `json:"nodes"`
	Touch bool     `json:"touch,omitempty"`
}

CatRequest reads nodes across any number of KEGs on this Hub in one call. Each reference is qualified, "keg:@namespace/alias/id". Touch records the read as an open.

type CatResponse

type CatResponse struct {
	Nodes []CatNode `json:"nodes"`
}

CatResponse returns the requested nodes in request order.

type RelatedRequest

type RelatedRequest struct {
	// Keg is the qualified KEG reference, "@namespace/alias".
	Keg     string   `json:"keg"`
	NodeIDs []string `json:"node_ids"`
	Fields  []string `json:"fields,omitempty"`
	Offset  int      `json:"offset,omitempty"`
	Limit   int      `json:"limit,omitempty"`
}

RelatedRequest asks for a node set's links or backlinks in one KEG, paged and with the named field selectors resolved for every returned row.

type RelatedResponse

type RelatedResponse struct {
	Rows  []keg.ListViewRow `json:"rows"`
	Pairs []keg.RelatedPair `json:"pairs"`
	Total int               `json:"total"`
}

RelatedResponse is one page of related nodes. Pairs attributes every returned row to the input node that produced it; Total counts related nodes before paging.

type TagsRequest

type TagsRequest struct {
	Keg    string   `json:"keg"`
	Query  string   `json:"query,omitempty"`
	Fields []string `json:"fields,omitempty"`
	Offset int      `json:"offset,omitempty"`
	Limit  int      `json:"limit,omitempty"`
}

TagsRequest lists tags, or with a Query, the nodes it selects rendered as rows with the named fields resolved.

type TagsResponse

type TagsResponse struct {
	Tags  []string          `json:"tags,omitempty"`
	Rows  []keg.ListViewRow `json:"rows,omitempty"`
	Total int               `json:"total"`
}

TagsResponse carries Tags when the request had no query, otherwise Rows. Total counts before paging.

Jump to

Keyboard shortcuts

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