api

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Provider

func Provider()

Provider registers all API endpoints with the schemaf framework. Wire up in go/main.go: app.AddApi(api.Provider)

Types

type CreateNodeEndpoint

type CreateNodeEndpoint struct{}

CreateNodeEndpoint creates a graph node. L0 sources use multipart form upload; L1/L2 use JSON. L0 root creation is idempotent via content_sha256.

func (CreateNodeEndpoint) Auth

func (e CreateNodeEndpoint) Auth() bool

func (CreateNodeEndpoint) HandleRaw

func (CreateNodeEndpoint) Method

func (e CreateNodeEndpoint) Method() string

func (CreateNodeEndpoint) Path

func (e CreateNodeEndpoint) Path() string

type CreateRunEndpoint

type CreateRunEndpoint struct{}

CreateRunEndpoint registers a new worker run and returns a run_id.

func (CreateRunEndpoint) Auth

func (e CreateRunEndpoint) Auth() bool

func (CreateRunEndpoint) Handle

func (CreateRunEndpoint) Method

func (e CreateRunEndpoint) Method() string

func (CreateRunEndpoint) Path

func (e CreateRunEndpoint) Path() string

type CreateRunReq

type CreateRunReq struct {
	WorkerConfigID string `json:"worker_config_id"`
}

type CreateRunResp

type CreateRunResp struct {
	RunID string `json:"run_id"`
}

type EdgeProvenanceResp

type EdgeProvenanceResp struct {
	Edge             EdgeResponse  `json:"edge"`
	RunID            string        `json:"run_id,omitempty"`
	WorkerConfigNode *NodeResponse `json:"worker_config_node,omitempty"`
}

type EdgeResponse

type EdgeResponse struct {
	ID           string   `json:"id"`
	SourceNodeID string   `json:"source_node_id"`
	TargetNodeID string   `json:"target_node_id"`
	Type         string   `json:"type"`
	Confidence   *float64 `json:"confidence,omitempty"`
	RunID        *string  `json:"run_id,omitempty"`
	CreatedAt    string   `json:"created_at"`
}

EdgeResponse is the unified API representation of any edge.

type GetEdgeEndpoint

type GetEdgeEndpoint struct{}

GetEdgeEndpoint returns an edge by ID with its metadata.

func (GetEdgeEndpoint) Auth

func (e GetEdgeEndpoint) Auth() bool

func (GetEdgeEndpoint) Handle

func (GetEdgeEndpoint) Method

func (e GetEdgeEndpoint) Method() string

func (GetEdgeEndpoint) Path

func (e GetEdgeEndpoint) Path() string

type GetEdgeProvenanceEndpoint

type GetEdgeProvenanceEndpoint struct{}

GetEdgeProvenanceEndpoint returns the provenance context of an edge: run, worker config node.

func (GetEdgeProvenanceEndpoint) Auth

func (GetEdgeProvenanceEndpoint) Handle

func (GetEdgeProvenanceEndpoint) Method

func (e GetEdgeProvenanceEndpoint) Method() string

func (GetEdgeProvenanceEndpoint) Path

type GetEdgeProvenanceReq

type GetEdgeProvenanceReq struct {
	ID string `path:"id"`
}

type GetEdgeReq

type GetEdgeReq struct {
	ID string `path:"id"`
}

type GetEntityEndpoint

type GetEntityEndpoint struct{}

GetEntityEndpoint returns an entity with all its relations, sorted by temporal validity.

func (GetEntityEndpoint) Auth

func (e GetEntityEndpoint) Auth() bool

func (GetEntityEndpoint) Handle

func (GetEntityEndpoint) Method

func (e GetEntityEndpoint) Method() string

func (GetEntityEndpoint) Path

func (e GetEntityEndpoint) Path() string

type GetEntityReq

type GetEntityReq struct {
	ID            string   `path:"id"`
	MinConfidence *float64 `query:"min_confidence"`
}

type GetEntityResp

type GetEntityResp struct {
	Entity    NodeResponse       `json:"entity"`
	Relations []RelationResponse `json:"relations"`
}

type GetEntityTimelineEndpoint

type GetEntityTimelineEndpoint struct{}

GetEntityTimelineEndpoint returns all relations of an entity sorted chronologically by valid_from.

func (GetEntityTimelineEndpoint) Auth

func (GetEntityTimelineEndpoint) Handle

func (GetEntityTimelineEndpoint) Method

func (e GetEntityTimelineEndpoint) Method() string

func (GetEntityTimelineEndpoint) Path

type GetEntityTimelineReq

type GetEntityTimelineReq struct {
	ID string `path:"id"`
}

type GetEntityTimelineResp

type GetEntityTimelineResp struct {
	Relations []RelationResponse `json:"relations"`
}

type GetNodeContentEndpoint

type GetNodeContentEndpoint struct{}

GetNodeContentEndpoint returns the raw content bytes of a node. Serves from Postgres cache if available, otherwise proxies from S3.

func (GetNodeContentEndpoint) Auth

func (e GetNodeContentEndpoint) Auth() bool

func (GetNodeContentEndpoint) HandleRaw

func (GetNodeContentEndpoint) Method

func (e GetNodeContentEndpoint) Method() string

func (GetNodeContentEndpoint) Path

func (e GetNodeContentEndpoint) Path() string

type GetNodeEdgesEndpoint

type GetNodeEdgesEndpoint struct{}

GetNodeEdgesEndpoint returns edges connected to a node, filterable by direction and type.

func (GetNodeEdgesEndpoint) Auth

func (e GetNodeEdgesEndpoint) Auth() bool

func (GetNodeEdgesEndpoint) Handle

func (GetNodeEdgesEndpoint) Method

func (e GetNodeEdgesEndpoint) Method() string

func (GetNodeEdgesEndpoint) Path

func (e GetNodeEdgesEndpoint) Path() string

type GetNodeEdgesReq

type GetNodeEdgesReq struct {
	ID        string  `path:"id"`
	Direction *string `query:"direction"` // incoming, outgoing, both
	Type      *string `query:"type"`      // provenance/input, provenance/worker, relation/head, relation/tail
	Limit     int     `query:"limit"`
	Offset    int     `query:"offset"`
}

type GetNodeEdgesResp

type GetNodeEdgesResp struct {
	Edges []EdgeResponse `json:"edges"`
}

type GetNodeEndpoint

type GetNodeEndpoint struct{}

GetNodeEndpoint returns a node by ID with full metadata and inline content.

func (GetNodeEndpoint) Auth

func (e GetNodeEndpoint) Auth() bool

func (GetNodeEndpoint) Handle

func (GetNodeEndpoint) Method

func (e GetNodeEndpoint) Method() string

func (GetNodeEndpoint) Path

func (e GetNodeEndpoint) Path() string

type GetNodeProvenanceEndpoint

type GetNodeProvenanceEndpoint struct{}

GetNodeProvenanceEndpoint returns the upstream provenance chain from a node back to L0 roots.

func (GetNodeProvenanceEndpoint) Auth

func (GetNodeProvenanceEndpoint) Handle

func (GetNodeProvenanceEndpoint) Method

func (e GetNodeProvenanceEndpoint) Method() string

func (GetNodeProvenanceEndpoint) Path

type GetNodeProvenanceReq

type GetNodeProvenanceReq struct {
	ID string `path:"id"`
}

type GetNodeReq

type GetNodeReq struct {
	ID string `path:"id"`
}

type GetQueueEndpoint

type GetQueueEndpoint struct{}

GetQueueEndpoint returns unprocessed nodes for a given worker type.

func (GetQueueEndpoint) Auth

func (e GetQueueEndpoint) Auth() bool

func (GetQueueEndpoint) Handle

func (GetQueueEndpoint) Method

func (e GetQueueEndpoint) Method() string

func (GetQueueEndpoint) Path

func (e GetQueueEndpoint) Path() string

type GetQueueReq

type GetQueueReq struct {
	ContentClass  string  `query:"content_class"`
	ContentType   string  `query:"content_type"`
	NotConsumedBy *string `query:"not_consumed_by"`
	Limit         int     `query:"limit"`
}

type GetQueueResp

type GetQueueResp struct {
	Nodes []NodeResponse `json:"nodes"`
}

type ListNodesEndpoint

type ListNodesEndpoint struct{}

ListNodesEndpoint returns a filtered, paginated list of nodes.

func (ListNodesEndpoint) Auth

func (e ListNodesEndpoint) Auth() bool

func (ListNodesEndpoint) Handle

func (ListNodesEndpoint) Method

func (e ListNodesEndpoint) Method() string

func (ListNodesEndpoint) Path

func (e ListNodesEndpoint) Path() string

type ListNodesReq

type ListNodesReq struct {
	Level        *int    `query:"level"`
	ContentClass *string `query:"content_class"`
	ContentType  *string `query:"content_type"`
	Limit        int     `query:"limit"`
	Offset       int     `query:"offset"`
}

type ListNodesResp

type ListNodesResp struct {
	Nodes []NodeResponse `json:"nodes"`
}

type ListRelationsEndpoint

type ListRelationsEndpoint struct{}

ListRelationsEndpoint returns filtered relation nodes.

func (ListRelationsEndpoint) Auth

func (e ListRelationsEndpoint) Auth() bool

func (ListRelationsEndpoint) Handle

func (ListRelationsEndpoint) Method

func (e ListRelationsEndpoint) Method() string

func (ListRelationsEndpoint) Path

func (e ListRelationsEndpoint) Path() string

type ListRelationsReq

type ListRelationsReq struct {
	Unresolved *bool   `query:"unresolved"`
	Type       *string `query:"type"` // e.g. alias, has_role
	Limit      int     `query:"limit"`
	Offset     int     `query:"offset"`
}

type ListRelationsResp

type ListRelationsResp struct {
	Relations []RelationResponse `json:"relations"`
}

type NodeResponse

type NodeResponse struct {
	ID                    string   `json:"id"`
	Level                 int      `json:"level"`
	ContentClass          string   `json:"content_class"`
	ContentType           string   `json:"content_type"`
	EncodingClass         string   `json:"encoding_class"`
	EncodingFormat        string   `json:"encoding_format"`
	ContentSha256         string   `json:"content_sha256"`
	ContentLen            int64    `json:"content_len"`
	Content               *string  `json:"content,omitempty"`
	CreatedAt             string   `json:"created_at"`
	ArtifactCreatedAt     *string  `json:"artifact_created_at,omitempty"`
	ArtifactCreatedAtBlur *string  `json:"artifact_created_at_blur,omitempty"`
	Origin                *string  `json:"origin,omitempty"`
	OriginalName          *string  `json:"original_name,omitempty"`
	ValidFrom             *string  `json:"valid_from,omitempty"`
	ValidFromBlur         *string  `json:"valid_from_blur,omitempty"`
	ValidUntil            *string  `json:"valid_until,omitempty"`
	ValidUntilBlur        *string  `json:"valid_until_blur,omitempty"`
	Confidence            *float64 `json:"confidence,omitempty"`
}

NodeResponse is the API representation of a graph node.

type PaginationParams

type PaginationParams struct {
	Limit  int `query:"limit"`
	Offset int `query:"offset"`
}

Pagination helpers

type ProvenanceSubgraph

type ProvenanceSubgraph struct {
	Nodes []NodeResponse `json:"nodes"`
	Edges []EdgeResponse `json:"edges"`
}

ProvenanceSubgraph is a set of nodes and edges forming a provenance chain.

type RelationResponse

type RelationResponse struct {
	Node      NodeResponse   `json:"node"`
	HeadEdges []EdgeResponse `json:"head_edges"`
	TailEdges []EdgeResponse `json:"tail_edges"`
}

RelationResponse is a relation node with its head and tail edges.

type SearchEntitiesEndpoint

type SearchEntitiesEndpoint struct{}

SearchEntitiesEndpoint searches entities by full-text query over names and aliases.

func (SearchEntitiesEndpoint) Auth

func (e SearchEntitiesEndpoint) Auth() bool

func (SearchEntitiesEndpoint) Handle

func (SearchEntitiesEndpoint) Method

func (e SearchEntitiesEndpoint) Method() string

func (SearchEntitiesEndpoint) Path

func (e SearchEntitiesEndpoint) Path() string

type SearchEntitiesReq

type SearchEntitiesReq struct {
	Q      *string `query:"q"`
	Type   *string `query:"type"` // e.g. person, organization
	Limit  int     `query:"limit"`
	Offset int     `query:"offset"`
}

type SearchEntitiesResp

type SearchEntitiesResp struct {
	Entities []NodeResponse `json:"entities"`
}

Jump to

Keyboard shortcuts

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