rest_http

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

package: rest_http / transport type: logic job: extract the request's auth credential from the wire and carry it to the handlers limits: extraction only; core resolves it and applies grants (-> internal/core)

package: rest_http / transport type: logic job: the write endpoint — POST /contribute limits: translation only; the merge runs behind core.Handle (-> internal/core)

package: rest_http / transport type: logic job: the read endpoints — POST /query and the cacheable by-id GET reads — with wire→RQL query mapping limits: translation only; the language is ranke-go's, the reads core's (-> internal/core)

package: rest_http / transport type: logic job: the operational endpoints — GET /health and GET /system/layers limits: translation only; the values come from core.Handle (-> internal/core)

package: rest_http / transport type: logic job: the verification run endpoints under /system/verification, and config mapping limits: translation only; runs are managed behind core.Handle (-> internal/core)

package: rest_http / transport type: adapter job: the HTTP envelope — content-type + status + body copy, and error → status mapping limits: framing/rendering live in core's Stream; this sets headers/status and copies (-> internal/core)

package: rest_http / transport type: adapter job: REST/HTTP endpoint backend — the Endpoints port and its server lifecycle limits: transport + translation only; all capability lives behind core.Core (-> internal/core)

Package rest_http implements the generated openapi.ServerInterface: it lifts the raw credential off the wire, builds a core.Request, and renders what core.Handle answers. Auth and access live in core; this is pure transport.

By topic: auth.go (wire credential), respond.go (writers, error → status), endpoints_read.go, endpoints_contribute.go, endpoints_system.go, endpoints_verification.go — the Server's own lifecycle here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is a running REST/HTTP endpoint driving core.Handle.

func New

func New(ctx context.Context, cfg scope.Section, c *core.Core) (*Server, error)

New builds the endpoint from its config section; "addr" listens (default ":8080").

func (*Server) CancelVerification

func (s *Server) CancelVerification(w http.ResponseWriter, r *http.Request, reportId string)

CancelVerification serves POST /system/verification/{id}/cancel.

func (*Server) Close

func (s *Server) Close() error

Close shuts the endpoint down.

func (*Server) Contribute

func (s *Server) Contribute(w http.ResponseWriter, r *http.Request)

Contribute serves POST /contribute. The body names the branch each claim joins, so core reads them from it and checks the C right on each.

func (*Server) DeleteVerification

func (s *Server) DeleteVerification(w http.ResponseWriter, r *http.Request, reportId string)

DeleteVerification serves DELETE /system/verification/{id}.

func (*Server) GetBranchClaim

func (s *Server) GetBranchClaim(w http.ResponseWriter, r *http.Request, branch string, idParam string)

GetBranchClaim serves GET /{branch}/claim/{id}.

func (*Server) GetBranchClaimContent

func (s *Server) GetBranchClaimContent(w http.ResponseWriter, r *http.Request, branch string, idParam string)

GetBranchClaimContent serves GET /{branch}/claim/{id}/content — the content of claim {id} within branch {name}'s closure (inline or blob, resolved by core).

func (*Server) GetBranchHead

func (s *Server) GetBranchHead(w http.ResponseWriter, r *http.Request, branch string)

GetBranchHead serves GET /{branch}/head.

func (*Server) GetUniverseClaim

func (s *Server) GetUniverseClaim(w http.ResponseWriter, r *http.Request, idParam string)

GetUniverseClaim serves GET /$universe/claim/{id}.

func (*Server) GetUniverseClaimContent

func (s *Server) GetUniverseClaimContent(w http.ResponseWriter, r *http.Request, idParam string)

GetUniverseClaimContent serves GET /$universe/claim/{id}/content — the content of claim {id}, privileged.

func (*Server) GetVerification

func (s *Server) GetVerification(w http.ResponseWriter, r *http.Request, reportId string)

GetVerification serves GET /system/verification/{id}.

func (*Server) Health

func (s *Server) Health(w http.ResponseWriter, r *http.Request)

Health serves GET /health.

func (*Server) ListStorageLayers

func (s *Server) ListStorageLayers(w http.ResponseWriter, r *http.Request)

ListStorageLayers serves GET /system/layers.

func (*Server) ListVerifications

func (s *Server) ListVerifications(w http.ResponseWriter, r *http.Request)

ListVerifications serves GET /system/verification.

func (*Server) Query

func (s *Server) Query(w http.ResponseWriter, r *http.Request)

Query serves POST /query: it runs the declarative query and streams the results.

func (*Server) Serve

func (s *Server) Serve(ctx context.Context) error

Serve runs the endpoint until ctx is cancelled, then shuts down gracefully.

func (*Server) StartVerification

func (s *Server) StartVerification(w http.ResponseWriter, r *http.Request)

StartVerification serves POST /system/verification.

Jump to

Keyboard shortcuts

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