server

package
v0.0.0-...-f6f694c Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package server is a RESTful API server for managing resources in a cluster. It supports various operations such as listing, creating, updating, and deleting resources, as well as authentication and authorization.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Scheme        *runtime.Scheme
	Store         *runtime.Store
	Status        *runtime.StatusStore
	Git           *gitops.Repo // optional
	Manifests     string
	WebhookSecret string // optional
	SealerPubKey  string // published to clients

	// Auth
	AuthEnabled bool
	AuthUser    string
	AuthPass    string
	AuthSecret  []byte
	AuthTTL     time.Duration

	// Reconcile loop options
	ResyncInterval   time.Duration
	AutoReconcile    bool
	ReconcileOnStart bool
	// contains filtered or unexported fields
}

Server is a RESTful API server for managing resources in a cluster. It supports various operations such as listing, creating, updating, and deleting resources, as well as authentication and authorization.

func New

func New(scheme *runtime.Scheme, store *runtime.Store, status *runtime.StatusStore, repo *gitops.Repo, manifests string) *Server

New Server creates a new server instance with the given scheme, store, and repo. It also sets up the server's routes and background loops. The server is ready to start serving requests.

func (*Server) Ready

func (s *Server) Ready() bool

Ready returns true if the server is ready to accept requests, false otherwise. The function returns nothing.

func (*Server) ReconcileAll

func (s *Server) ReconcileAll(ctx context.Context)

ReconcileAll scans desired manifests, computes drift/sync, and (optionally) reconciles.

func (*Server) Routes

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

Routes returns the server's routes. The function returns a http.Handler that can be used to serve the server's API. The function returns nothing.

func (*Server) SetReady

func (s *Server) SetReady(v bool)

SetReady sets the server's readiness status. This is used to indicate whether the server is ready to accept requests. The server is ready if the value is true, otherwise it is not ready. The function returns nothing.

func (*Server) StartBackgroundLoops

func (s *Server) StartBackgroundLoops(ctx context.Context)

StartBackgroundLoops launches a periodic resync loop and an optional one-shot reconcile at startup.

Jump to

Keyboard shortcuts

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