Documentation
¶
Overview ¶
Package gen provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.
Index ¶
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, m ServeMux) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler
- type Assignment
- type BadRequest
- type CatalogEntry
- type CatalogList
- type DownloadStatus
- type Earnings
- type EnrollNodeJSONRequestBody
- type EnrollRequest
- type EnrollResponse
- type Error
- type GetCatalogParams
- type GetLogsParams
- type Gpu
- type Hardware
- type Health
- type InvalidParamFormatError
- type Limits
- type LogEntry
- type LogList
- type MiddlewareFunc
- type ModelID
- type ModelList
- type ModelRow
- type NotFound
- type Ok
- type PinModelJSONRequestBody
- type PinRequest
- type RequiredHeaderError
- type RequiredParamError
- type ServeMux
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) CancelModelDownload(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteModel(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) EnrollNode(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetCatalog(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetEarnings(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetHealth(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetLimits(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetLogs(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetStatus(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListModels(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) LoadModel(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PinModel(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) SetDefaultModel(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) StartModelDownload(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) UnloadModel(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) UpdateLimits(w http.ResponseWriter, r *http.Request)
- type Stats
- type Status
- type StdHTTPServerOptions
- type TooManyValuesForParamError
- type Unauthorized
- type UnescapedCookieParamError
- type UnmarshalingParamError
- type Unsupported
- type UpdateLimitsJSONRequestBody
- type Upstream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
func Handler(si ServerInterface) http.Handler
Handler creates http.Handler with routing matching OpenAPI spec.
func HandlerFromMux ¶
func HandlerFromMux(si ServerInterface, m ServeMux) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerFromMuxWithBaseURL ¶
func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
Types ¶
type Assignment ¶
type Assignment struct {
// Error Why it was declined or failed.
Error *string `json:"error,omitempty"`
Since time.Time `json:"since"`
// State assigned | downloading | ready | declined | failed | evicted
State string `json:"state"`
}
Assignment Coordinator placement status for this model, when the mesh asked for it. Failures and refusals stay visible for ten minutes.
type CatalogEntry ¶
type CatalogEntry struct {
ArtifactUrl string `json:"artifact_url"`
ContextLength int64 `json:"context_length"`
Default bool `json:"default"`
// DisplayName Human-readable name incl. quant ("Qwen3.8 27B · Q4_K_M") — show this, not the id: ids are ambiguous now that model lines carry point versions (qwen3-8b vs qwen3.8-27b). Optional: absent when the daemon's catalog predates the field.
DisplayName *string `json:"display_name,omitempty"`
Embeddings bool `json:"embeddings"`
Family string `json:"family"`
Id string `json:"id"`
Installed bool `json:"installed"`
License string `json:"license"`
Loaded bool `json:"loaded"`
MinRamMb int64 `json:"min_ram_mb"`
MinVramMb int64 `json:"min_vram_mb"`
ParamsB float64 `json:"params_b"`
PayoutClass string `json:"payout_class"`
Quant string `json:"quant"`
ReceivedBytes *int64 `json:"received_bytes,omitempty"`
Sha256 string `json:"sha256"`
SizeBytes int64 `json:"size_bytes"`
// State downloading | ready; present when the artifact is local.
State *string `json:"state,omitempty"`
}
CatalogEntry A catalog model merged with this node's local state.
type CatalogList ¶
type CatalogList struct {
Models []CatalogEntry `json:"models"`
}
CatalogList defines model for CatalogList.
type DownloadStatus ¶
type DownloadStatus struct {
Ok bool `json:"ok"`
// State downloading | ready
State string `json:"state"`
}
DownloadStatus defines model for DownloadStatus.
type Earnings ¶
type Earnings struct {
EarnedCredits float64 `json:"earned_credits"`
EarnedMicrocredits int64 `json:"earned_microcredits"`
EscrowCredits float64 `json:"escrow_credits"`
EstUsd float64 `json:"est_usd"`
EstUsdPerDay float64 `json:"est_usd_per_day"`
LifetimeTokens int64 `json:"lifetime_tokens"`
Note string `json:"note"`
}
Earnings defines model for Earnings.
type EnrollNodeJSONRequestBody ¶
type EnrollNodeJSONRequestBody = EnrollRequest
EnrollNodeJSONRequestBody defines body for EnrollNode for application/json ContentType.
type EnrollRequest ¶
type EnrollRequest struct {
ClaimCode string `json:"claim_code"`
}
EnrollRequest defines model for EnrollRequest.
type EnrollResponse ¶
type EnrollResponse struct {
CertExpiresAt time.Time `json:"cert_expires_at"`
NodeId string `json:"node_id"`
Ok bool `json:"ok"`
}
EnrollResponse defines model for EnrollResponse.
type Error ¶
type Error struct {
Error struct {
Message string `json:"message"`
Type string `json:"type"`
} `json:"error"`
}
Error defines model for Error.
type GetCatalogParams ¶
type GetCatalogParams struct {
// Refresh Force a refetch instead of the cached copy (15 min TTL).
Refresh *bool `form:"refresh,omitempty" json:"refresh,omitempty"`
}
GetCatalogParams defines parameters for GetCatalog.
type GetLogsParams ¶
type GetLogsParams struct {
// N Max entries to return (default 200). `limit` is an accepted alias.
N *int `form:"n,omitempty" json:"n,omitempty"`
// Limit Alias for `n`.
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
}
GetLogsParams defines parameters for GetLogs.
type Gpu ¶
type Gpu struct {
Accel string `json:"accel"`
Model string `json:"model"`
UnifiedMemory bool `json:"unified_memory"`
Vendor string `json:"vendor"`
VramMb int64 `json:"vram_mb"`
}
Gpu defines model for Gpu.
type Hardware ¶
type Hardware struct {
Arch string `json:"arch"`
CpuCores int64 `json:"cpu_cores"`
CpuModel string `json:"cpu_model"`
Gpus []Gpu `json:"gpus"`
Os string `json:"os"`
RamMb int64 `json:"ram_mb"`
}
Hardware defines model for Hardware.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type Limits ¶
type Limits struct {
IdleAfterSeconds int `json:"idle_after_seconds"`
MaxTempCelsius float64 `json:"max_temp_celsius"`
// MeshManaged Let the mesh place models on this node (download, load, and evict what it placed) inside `models.max_disk_mb`, minus your pinned and excluded models. Off means the node serves only what you installed. Omitted on PUT = unchanged.
MeshManaged *bool `json:"mesh_managed,omitempty"`
// Schedule Windows like "22:00-08:00" (overnight wraps).
Schedule []string `json:"schedule"`
ServeOnBattery bool `json:"serve_on_battery"`
// ServePolicy always | idle-only | scheduled
ServePolicy string `json:"serve_policy"`
YieldGraceSeconds int `json:"yield_grace_seconds"`
}
Limits defines model for Limits.
type LogEntry ¶
type LogEntry struct {
Attrs *string `json:"attrs,omitempty"`
Level string `json:"level"`
Message string `json:"message"`
Time time.Time `json:"time"`
}
LogEntry defines model for LogEntry.
type LogList ¶
type LogList struct {
Logs []LogEntry `json:"logs"`
}
LogList defines model for LogList.
type ModelList ¶
type ModelList struct {
Models []ModelRow `json:"models"`
}
ModelList defines model for ModelList.
type ModelRow ¶
type ModelRow struct {
// Assignment Coordinator placement status for this model, when the mesh asked for it. Failures and refusals stay visible for ten minutes.
Assignment *Assignment `json:"assignment,omitempty"`
Default bool `json:"default"`
Id string `json:"id"`
LastUsed time.Time `json:"last_used"`
Loaded bool `json:"loaded"`
// Origin Who installed it: `operator` (you, via the app/CLI/config) or `mesh` (coordinator placement). The mesh can only evict its own; yours are never touched.
Origin string `json:"origin"`
Pinned bool `json:"pinned"`
// ReceivedBytes Live progress; present only while downloading.
ReceivedBytes *int64 `json:"received_bytes,omitempty"`
SizeBytes int64 `json:"size_bytes"`
// State assigned | downloading | ready. `assigned` is a coordinator placement queued behind other work (nothing on disk yet).
State string `json:"state"`
}
ModelRow defines model for ModelRow.
type PinModelJSONRequestBody ¶
type PinModelJSONRequestBody = PinRequest
PinModelJSONRequestBody defines body for PinModel for application/json ContentType.
type PinRequest ¶
type PinRequest struct {
Pinned bool `json:"pinned"`
}
PinRequest defines model for PinRequest.
type RequiredHeaderError ¶
func (*RequiredHeaderError) Error ¶
func (e *RequiredHeaderError) Error() string
func (*RequiredHeaderError) Unwrap ¶
func (e *RequiredHeaderError) Unwrap() error
type RequiredParamError ¶
type RequiredParamError struct {
ParamName string
}
func (*RequiredParamError) Error ¶
func (e *RequiredParamError) Error() string
type ServeMux ¶
type ServeMux interface {
HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
http.Handler
}
ServeMux is an abstraction of http.ServeMux.
type ServerInterface ¶
type ServerInterface interface {
// GetCatalog Model catalog merged with local state
// (GET /api/v1/catalog)
GetCatalog(w http.ResponseWriter, r *http.Request, params GetCatalogParams)
// GetEarnings Node earnings (simulated until enrolled with a real ledger)
// (GET /api/v1/earnings)
GetEarnings(w http.ResponseWriter, r *http.Request)
// EnrollNode Enroll (or re-enroll) this node with the coordinator
// (POST /api/v1/enroll)
EnrollNode(w http.ResponseWriter, r *http.Request)
// GetHealth Liveness probe
// (GET /api/v1/health)
GetHealth(w http.ResponseWriter, r *http.Request)
// GetLimits Live governor limits
// (GET /api/v1/limits)
GetLimits(w http.ResponseWriter, r *http.Request)
// UpdateLimits Update governor limits
// (PUT /api/v1/limits)
UpdateLimits(w http.ResponseWriter, r *http.Request)
// GetLogs Recent daemon log entries (ring buffer)
// (GET /api/v1/logs)
GetLogs(w http.ResponseWriter, r *http.Request, params GetLogsParams)
// ListModels Locally installed models
// (GET /api/v1/models)
ListModels(w http.ResponseWriter, r *http.Request)
// DeleteModel Delete a model from disk (and unload it if loaded)
// (DELETE /api/v1/models/{id})
DeleteModel(w http.ResponseWriter, r *http.Request, id ModelID)
// SetDefaultModel Serve this model when a request names none (must be loaded)
// (POST /api/v1/models/{id}/default)
SetDefaultModel(w http.ResponseWriter, r *http.Request, id ModelID)
// CancelModelDownload Cancel an in-flight download (the .partial file is kept for resume)
// (DELETE /api/v1/models/{id}/download)
CancelModelDownload(w http.ResponseWriter, r *http.Request, id ModelID)
// StartModelDownload Start downloading a catalog model in the background
// (POST /api/v1/models/{id}/download)
StartModelDownload(w http.ResponseWriter, r *http.Request, id ModelID)
// LoadModel Load a model into the serving runtime
// (POST /api/v1/models/{id}/load)
LoadModel(w http.ResponseWriter, r *http.Request, id ModelID)
// PinModel Pin or unpin a model (pinned models are never LRU-evicted)
// (POST /api/v1/models/{id}/pin)
PinModel(w http.ResponseWriter, r *http.Request, id ModelID)
// UnloadModel Unload a model from the runtime (the artifact stays cached)
// (POST /api/v1/models/{id}/unload)
UnloadModel(w http.ResponseWriter, r *http.Request, id ModelID)
// GetStatus Node status snapshot
// (GET /api/v1/status)
GetStatus(w http.ResponseWriter, r *http.Request)
}
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) CancelModelDownload ¶
func (siw *ServerInterfaceWrapper) CancelModelDownload(w http.ResponseWriter, r *http.Request)
CancelModelDownload operation middleware
func (*ServerInterfaceWrapper) DeleteModel ¶
func (siw *ServerInterfaceWrapper) DeleteModel(w http.ResponseWriter, r *http.Request)
DeleteModel operation middleware
func (*ServerInterfaceWrapper) EnrollNode ¶
func (siw *ServerInterfaceWrapper) EnrollNode(w http.ResponseWriter, r *http.Request)
EnrollNode operation middleware
func (*ServerInterfaceWrapper) GetCatalog ¶
func (siw *ServerInterfaceWrapper) GetCatalog(w http.ResponseWriter, r *http.Request)
GetCatalog operation middleware
func (*ServerInterfaceWrapper) GetEarnings ¶
func (siw *ServerInterfaceWrapper) GetEarnings(w http.ResponseWriter, r *http.Request)
GetEarnings operation middleware
func (*ServerInterfaceWrapper) GetHealth ¶
func (siw *ServerInterfaceWrapper) GetHealth(w http.ResponseWriter, r *http.Request)
GetHealth operation middleware
func (*ServerInterfaceWrapper) GetLimits ¶
func (siw *ServerInterfaceWrapper) GetLimits(w http.ResponseWriter, r *http.Request)
GetLimits operation middleware
func (*ServerInterfaceWrapper) GetLogs ¶
func (siw *ServerInterfaceWrapper) GetLogs(w http.ResponseWriter, r *http.Request)
GetLogs operation middleware
func (*ServerInterfaceWrapper) GetStatus ¶
func (siw *ServerInterfaceWrapper) GetStatus(w http.ResponseWriter, r *http.Request)
GetStatus operation middleware
func (*ServerInterfaceWrapper) ListModels ¶
func (siw *ServerInterfaceWrapper) ListModels(w http.ResponseWriter, r *http.Request)
ListModels operation middleware
func (*ServerInterfaceWrapper) LoadModel ¶
func (siw *ServerInterfaceWrapper) LoadModel(w http.ResponseWriter, r *http.Request)
LoadModel operation middleware
func (*ServerInterfaceWrapper) PinModel ¶
func (siw *ServerInterfaceWrapper) PinModel(w http.ResponseWriter, r *http.Request)
PinModel operation middleware
func (*ServerInterfaceWrapper) SetDefaultModel ¶
func (siw *ServerInterfaceWrapper) SetDefaultModel(w http.ResponseWriter, r *http.Request)
SetDefaultModel operation middleware
func (*ServerInterfaceWrapper) StartModelDownload ¶
func (siw *ServerInterfaceWrapper) StartModelDownload(w http.ResponseWriter, r *http.Request)
StartModelDownload operation middleware
func (*ServerInterfaceWrapper) UnloadModel ¶
func (siw *ServerInterfaceWrapper) UnloadModel(w http.ResponseWriter, r *http.Request)
UnloadModel operation middleware
func (*ServerInterfaceWrapper) UpdateLimits ¶
func (siw *ServerInterfaceWrapper) UpdateLimits(w http.ResponseWriter, r *http.Request)
UpdateLimits operation middleware
type Stats ¶
type Stats struct {
EarnedMicrocredits int64 `json:"earned_microcredits"`
Inflight int `json:"inflight"`
RequestsPerMin float64 `json:"requests_per_min"`
TokensPerSec1m float64 `json:"tokens_per_sec_1m"`
TotalRequests int64 `json:"total_requests"`
TotalTokens int64 `json:"total_tokens"`
}
Stats defines model for Stats.
type Status ¶
type Status struct {
// CertExpiresAt Client-certificate expiry; present when enrolled.
CertExpiresAt *time.Time `json:"cert_expires_at,omitempty"`
DefaultModel string `json:"default_model"`
Enrolled bool `json:"enrolled"`
Hardware *Hardware `json:"hardware,omitempty"`
Inflight int `json:"inflight"`
ModelsLoaded int `json:"models_loaded"`
// NodeId Key fingerprint until enrolled; coordinator-assigned id after.
NodeId string `json:"node_id"`
OnBattery bool `json:"on_battery"`
Standalone bool `json:"standalone"`
// State serving | yielded | paused-battery | paused-thermal | outside-schedule
State string `json:"state"`
Stats Stats `json:"stats"`
TempCelsius float64 `json:"temp_celsius"`
UptimeSeconds int64 `json:"uptime_seconds"`
Version string `json:"version"`
}
Status defines model for Status.
type StdHTTPServerOptions ¶
type StdHTTPServerOptions struct {
BaseURL string
BaseRouter ServeMux
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error
type UpdateLimitsJSONRequestBody ¶
type UpdateLimitsJSONRequestBody = Limits
UpdateLimitsJSONRequestBody defines body for UpdateLimits for application/json ContentType.