api

package
v0.0.0-...-32bb601 Latest Latest
Warning

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

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

Documentation

Overview

Package api exposes the engine over HTTP: apply, diff, list, get, delete, status, the sealer public key, token auth, and a Gitea webhook that triggers a reconcile.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sealer

type Sealer interface{ PublicKey() string }

Sealer is the subset of *seal.Sealer the API needs.

type Server

type Server struct {
	Engine *engine.Engine
	Source source.Source
	State  engine.State
	Sealer Sealer
	Logger *slog.Logger

	// Trigger requests a full reconcile of the source (used by the webhook).
	Trigger func()

	// Auth (token-based; disabled when AuthEnabled is false).
	AuthEnabled bool
	AuthUser    string
	AuthPass    string
	AuthSecret  []byte
	AuthTTL     time.Duration

	WebhookSecret string
	GitBranch     string
	// contains filtered or unexported fields
}

Server serves the CraneOps HTTP API.

func (*Server) ReconcileSource

func (s *Server) ReconcileSource(ctx context.Context) ([]engine.Result, error)

ReconcileSource loads the source and reconciles the whole desired set (with prune).

func (*Server) Routes

func (s *Server) Routes() http.Handler

Routes builds the HTTP handler.

func (*Server) SetReady

func (s *Server) SetReady(v bool)

SetReady toggles the readiness flag.

Jump to

Keyboard shortcuts

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