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 ¶
Ready returns true if the server is ready to accept requests, false otherwise. The function returns nothing.
func (*Server) ReconcileAll ¶
ReconcileAll scans desired manifests, computes drift/sync, and (optionally) reconciles.
func (*Server) Routes ¶
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 ¶
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 ¶
StartBackgroundLoops launches a periodic resync loop and an optional one-shot reconcile at startup.