gitrestclient

package
v0.18.5 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: BSD-2-Clause Imports: 9 Imported by: 0 modules, 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitRestClient

type GitRestClient interface {
	// Get retrieves the current content of the file at relPath.
	Get(ctx context.Context, relPath string) ([]byte, error)
	// List returns relative paths matching the single-level glob pattern (e.g. "tasks/*.md").
	List(ctx context.Context, glob string) ([]string, error)
	// IsReady reports whether git-rest's /readiness returns 200.
	// Returns (false, nil) when git-rest returns 503 — that is a valid not-ready state, not an error.
	// Returns (false, err) only on network failure or unexpected response.
	IsReady(ctx context.Context) (bool, error)
}

GitRestClient is the HTTP client for git-rest's /api/v1/files REST API. All paths are relative to the repo root (e.g. "tasks/foo.md"). The executor uses only the read surface (List/Get/IsReady) — it never writes vault files through git-rest (spec 005 Security).

func NewGitRestClient

func NewGitRestClient(baseURL, gatewaySecret, gatewayInitiator string) GitRestClient

NewGitRestClient creates a GitRestClient targeting the git-rest instance at baseURL. gatewaySecret is the shared secret enforced by git-rest's gateway-secret auth; when empty, no auth headers are sent (backward-compat with auth-disabled git-rest). gatewayInitiator is the caller identity logged by git-rest on auth failure (pass a stable value, e.g. "agent-task-executor").

Jump to

Keyboard shortcuts

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