daemon

package
v0.1.40 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupRequest

type BackupRequest struct {
	Comment string `json:"comment,omitempty"`
}

type BackupResponse

type BackupResponse struct {
	BackupID   int       `json:"backupId"`
	BackupPath string    `json:"backupPath"`
	Size       int64     `json:"size"`
	Timestamp  time.Time `json:"timestamp"`
	Message    string    `json:"message"`
}

type CreateRDBMSRequest

type CreateRDBMSRequest struct {
	Name           string `json:"name"`
	Version        string `json:"version"`
	Image          string `json:"image"`
	Port           int    `json:"port"`
	CPUCores       int    `json:"cpuCores"`
	RAMMB          int    `json:"ramMb"`
	ParameterGroup string `json:"parameterGroup"`
}

Request/Response types for RDBMS operations

type CronPlanRequest

type CronPlanRequest struct {
	InstanceName      string `json:"instanceName"`
	UTCHour           int    `json:"utcHour"`
	CleanupLocalDays  int    `json:"cleanupLocalDays"`
	CleanupRemoteDays int    `json:"cleanupRemoteDays"`
}

type CronTaskTracker

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

CronTaskTracker manages sequential execution of cron tasks

func NewCronTaskTracker

func NewCronTaskTracker(opDeps *operations.Dependencies, executor *operations.Executor) *CronTaskTracker

NewCronTaskTracker creates a new cron task tracker

func (*CronTaskTracker) GetStatus

func (t *CronTaskTracker) GetStatus() (currentTask string, queueLength int, queuedTasks []string)

GetStatus returns the current status for debugging

func (*CronTaskTracker) RunTask

func (t *CronTaskTracker) RunTask(ctx context.Context, instanceName string) bool

RunTask runs a cron task sequentially - starts immediately if nothing running, queues if busy Returns true if the task was started or queued, false if it's a duplicate

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

ErrorResponse represents an API error response

type HealthHistory

type HealthHistory struct {
	Records   []*HealthRecord `json:"records"`
	Timestamp string          `json:"timestamp"`
}

HealthHistory represents the health history response

type HealthRecord

type HealthRecord struct {
	ID               int64    `json:"id"`
	Timestamp        string   `json:"timestamp"`
	TimestampUnix    int64    `json:"timestampUnix"`
	InProgress       bool     `json:"inProgress"`
	HealthyAll       bool     `json:"healthyAll"`
	HealthyHost      bool     `json:"healthyHost"`
	HealthyInstances []string `json:"healthyInstances"`
	BrokenInstances  []string `json:"brokenInstances"`
	FailDetails      string   `json:"failDetails"`
}

HealthRecord represents a single health check record for API response

type HealthScheduler

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

HealthScheduler manages the health check scheduling with process mutex

func NewHealthScheduler

func NewHealthScheduler(healthChecker *services.HealthChecker, intervalSec int) *HealthScheduler

func (*HealthScheduler) IsRunning

func (hs *HealthScheduler) IsRunning() bool

IsRunning returns whether a health check is currently running

func (*HealthScheduler) Pause

func (hs *HealthScheduler) Pause()

Pause pauses health checks (new ones won't start)

func (*HealthScheduler) Start

func (hs *HealthScheduler) Start(ctx context.Context)

func (*HealthScheduler) Unpause

func (hs *HealthScheduler) Unpause()

Unpause resumes health checks

func (*HealthScheduler) WaitForCompletion

func (hs *HealthScheduler) WaitForCompletion(timeout time.Duration) bool

WaitForCompletion waits for any running health check to complete

type HealthStatus

type HealthStatus struct {
	Overall      string        `json:"overall"` // "healthy", "degraded", "unhealthy"
	LastCheck    *HealthRecord `json:"lastCheck"`
	CheckRunning bool          `json:"checkRunning"`
	Timestamp    string        `json:"timestamp"`
}

HealthStatus represents the detailed health status response

type KVPair

type KVPair struct {
	Key       string `json:"key"`
	Value     string `json:"value"`
	UpdatedAt string `json:"updatedAt"`
}

KVPair represents a key-value pair for API responses

type KVSetRequest

type KVSetRequest struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

KVSetRequest represents the request body for setting a key-value pair

type PullImageRequest

type PullImageRequest struct {
	Version string `json:"version"`
	Image   string `json:"image"`
}

Request types for image operations

type ReconfigureRequest

type ReconfigureRequest struct {
	ParameterGroup string `json:"parameterGroup"`
}

type RestoreRequest

type RestoreRequest struct {
	BackupID     int    `json:"backupId,omitempty"`
	FilePath     string `json:"filePath,omitempty"`
	DatabaseName string `json:"databaseName"`
	RestoreAs    string `json:"restoreAs,omitempty"`
}

RestoreRequest represents the request body for restore

type RestoreResponse

type RestoreResponse struct {
	TargetDatabase string `json:"targetDatabase"`
	SourceBackup   string `json:"sourceBackup"`
	Message        string `json:"message"`
}

RestoreResponse represents the response from restore

type Server

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

func NewServer

func NewServer(port int, dataDir, backupDir string, healthCheckIntervalSec int, allowRemote bool) (*Server, error)

func (*Server) MintToken added in v0.1.40

func (s *Server) MintToken() (string, error)

MintToken creates a new CLI auth token and returns its plaintext. The daemon does not mint tokens on its own (see NewServer); this is the programmatic equivalent of `oddk auth mint`, used by tests to obtain a usable token.

func (*Server) Shutdown

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

Shutdown gracefully shuts down the server

func (*Server) Start

func (s *Server) Start() error

type SwitchRequest

type SwitchRequest struct {
	Image   string `json:"image"`
	Version string `json:"version"`
}

type UpdateStateRequest

type UpdateStateRequest struct {
	State string `json:"state"`
}

type UpgradeRequest

type UpgradeRequest struct {
	TargetVersion string `json:"targetVersion"`
	Image         string `json:"image"`
}

Jump to

Keyboard shortcuts

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