Documentation
¶
Index ¶
- func DeleteFunctionEntry(functionName string) error
- func DeletePipelineEntry(pipelineID string) error
- func EnableService(serviceName string) error
- func EnableServiceHandler(w http.ResponseWriter, r *http.Request)
- func GetAllFunctionEntries() (map[string]FunctionEntry, error)
- func GetAllPipelineEntries() (map[string]PipelineEntry, error)
- func GetServiceStatusHandler(w http.ResponseWriter, r *http.Request)
- func InitializeServiceLedger() error
- func IsServiceEnabled(serviceName string) (bool, error)
- func SyncFunctions() error
- func SyncFunctionsHandler(w http.ResponseWriter, r *http.Request)
- func SyncPipelines() error
- func SyncPipelinesHandler(w http.ResponseWriter, r *http.Request)
- func UpdateFunctionEntry(functionName, runtime, trigger, schedule, content string) error
- func UpdatePipelineEntry(pipelineID, name, description, code, branch, status, createdAt string) error
- func WriteServiceLedger(ledger ServiceLedger) error
- type FunctionEntry
- type FunctionLog
- type PipelineEntry
- type ServiceLedger
- type ServiceStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteFunctionEntry ¶
DeleteFunctionEntry removes a function entry from the Functions service ledger
func DeletePipelineEntry ¶
DeletePipelineEntry removes a pipeline entry from the pipelines service ledger
func EnableService ¶
EnableService enables a specific service in the ledger
func EnableServiceHandler ¶
func EnableServiceHandler(w http.ResponseWriter, r *http.Request)
EnableServiceHandler is an HTTP handler that enables a service
func GetAllFunctionEntries ¶
func GetAllFunctionEntries() (map[string]FunctionEntry, error)
GetAllFunctionEntries retrieves all function entries from the Functions service ledger
func GetAllPipelineEntries ¶
func GetAllPipelineEntries() (map[string]PipelineEntry, error)
GetAllPipelineEntries retrieves all pipeline entries from the pipelines service ledger
func GetServiceStatusHandler ¶
func GetServiceStatusHandler(w http.ResponseWriter, r *http.Request)
GetServiceStatusHandler is an HTTP handler that returns the status of a service
func InitializeServiceLedger ¶
func InitializeServiceLedger() error
InitializeServiceLedger ensures the service ledger file exists with default services
func IsServiceEnabled ¶
IsServiceEnabled checks if a specific service is enabled
func SyncFunctions ¶
func SyncFunctions() error
SyncFunctions scans the ~/.opencloud/functions/ directory and updates the service ledger with any functions that exist on disk but are not yet tracked in the ledger
func SyncFunctionsHandler ¶
func SyncFunctionsHandler(w http.ResponseWriter, r *http.Request)
SyncFunctionsHandler is an HTTP handler that syncs functions from disk to the service ledger
func SyncPipelines ¶
func SyncPipelines() error
SyncPipelines scans the ~/.opencloud/pipelines/ directory and updates the service ledger with any pipelines that exist on disk but are not yet tracked in the ledger
func SyncPipelinesHandler ¶
func SyncPipelinesHandler(w http.ResponseWriter, r *http.Request)
SyncPipelinesHandler is an HTTP handler that syncs pipelines from disk to the service ledger
func UpdateFunctionEntry ¶
UpdateFunctionEntry updates a specific function entry in the Functions service ledger
func UpdatePipelineEntry ¶
func UpdatePipelineEntry(pipelineID, name, description, code, branch, status, createdAt string) error
UpdatePipelineEntry updates a specific pipeline entry in the pipelines service ledger
func WriteServiceLedger ¶
func WriteServiceLedger(ledger ServiceLedger) error
WriteServiceLedger writes the service ledger to the JSON file
Types ¶
type FunctionEntry ¶
type FunctionEntry struct {
Runtime string `json:"runtime"`
Trigger string `json:"trigger,omitempty"`
Schedule string `json:"schedule,omitempty"`
Content string `json:"content"`
Logs []FunctionLog `json:"logs,omitempty"`
}
FunctionEntry represents an individual function's metadata in the ledger
func GetFunctionEntry ¶
func GetFunctionEntry(functionName string) (*FunctionEntry, error)
GetFunctionEntry retrieves a specific function entry from the Functions service ledger
type FunctionLog ¶
type FunctionLog struct {
Timestamp string `json:"timestamp"`
Output string `json:"output"`
Error string `json:"error,omitempty"`
Status string `json:"status"` // "success" or "error"
}
FunctionLog represents a single function execution log
type PipelineEntry ¶
type PipelineEntry struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Code string `json:"code"`
Branch string `json:"branch"`
Status string `json:"status"`
CreatedAt string `json:"createdAt"`
}
PipelineEntry represents an individual pipeline's metadata in the ledger
func GetPipelineEntry ¶
func GetPipelineEntry(pipelineID string) (*PipelineEntry, error)
GetPipelineEntry retrieves a specific pipeline entry from the pipelines service ledger
type ServiceLedger ¶
type ServiceLedger map[string]ServiceStatus
ServiceLedger represents the complete service ledger
func ReadServiceLedger ¶
func ReadServiceLedger() (ServiceLedger, error)
ReadServiceLedger reads and parses the service ledger JSON file
type ServiceStatus ¶
type ServiceStatus struct {
Enabled bool `json:"enabled"`
Functions map[string]FunctionEntry `json:"functions,omitempty"`
Pipelines map[string]PipelineEntry `json:"pipelines,omitempty"`
}
ServiceStatus represents the status of a single service