Documentation
¶
Overview ¶
Package server provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.0 DO NOT EDIT.
Index ¶
- Constants
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
- type Agent
- type AgentCost
- type AgentHealthStatus
- type AgentHeartbeat200JSONResponse
- type AgentHeartbeat400ApplicationProblemPlusJSONResponse
- type AgentHeartbeat404ApplicationProblemPlusJSONResponse
- type AgentHeartbeatJSONRequestBody
- type AgentHeartbeatRequestObject
- type AgentHeartbeatResponseObject
- type AgentHeartbeatdefaultApplicationProblemPlusJSONResponse
- type AgentIdPath
- type AgentList
- type AgentRegistrationRequest
- type AgentRegistrationRequestCost
- type ChiServerOptions
- type CreateAgent200JSONResponse
- type CreateAgent201JSONResponse
- type CreateAgent400ApplicationProblemPlusJSONResponse
- type CreateAgent409ApplicationProblemPlusJSONResponse
- type CreateAgentJSONRequestBody
- type CreateAgentRequestObject
- type CreateAgentResponseObject
- type CreateAgentdefaultApplicationProblemPlusJSONResponse
- type Error
- type GetAgent200JSONResponse
- type GetAgent400ApplicationProblemPlusJSONResponse
- type GetAgent404ApplicationProblemPlusJSONResponse
- type GetAgentRequestObject
- type GetAgentResponseObject
- type GetAgentdefaultApplicationProblemPlusJSONResponse
- type HeartbeatRequest
- type InvalidParamFormatError
- type ListAgents200JSONResponse
- type ListAgents400ApplicationProblemPlusJSONResponse
- type ListAgentsParams
- type ListAgentsParamsHealthStatus
- type ListAgentsRequestObject
- type ListAgentsResponseObject
- type ListAgentsdefaultApplicationProblemPlusJSONResponse
- type MiddlewareFunc
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) AgentHeartbeat(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) CreateAgent(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetAgent(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListAgents(w http.ResponseWriter, r *http.Request)
- type StrictHTTPServerOptions
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type Unimplemented
- func (_ Unimplemented) AgentHeartbeat(w http.ResponseWriter, r *http.Request, agentId AgentIdPath)
- func (_ Unimplemented) CreateAgent(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) GetAgent(w http.ResponseWriter, r *http.Request, agentId AgentIdPath)
- func (_ Unimplemented) ListAgents(w http.ResponseWriter, r *http.Request, params ListAgentsParams)
- type UnmarshalingParamError
Constants ¶
const (
BearerAuthScopes bearerAuthContextKey = "bearerAuth.Scopes"
)
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, r chi.Router) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
Types ¶
type Agent ¶
type Agent struct {
// AgentId Server-generated unique identifier
AgentId *string `json:"agent_id,omitempty"`
// Cost Relative cost weight for placement decisions
Cost *AgentCost `json:"cost,omitempty"`
// CreateTime Timestamp when the agent was first registered
CreateTime *time.Time `json:"create_time,omitempty"`
// Environment Environment label for the agent
Environment *string `json:"environment,omitempty"`
// HealthStatus Current health status of the agent
HealthStatus *AgentHealthStatus `json:"health_status,omitempty"`
// LastHeartbeat Timestamp of last heartbeat received
LastHeartbeat *time.Time `json:"last_heartbeat,omitempty"`
// Name Unique name of the agent
Name *string `json:"name,omitempty"`
// ServiceTypes List of service types this agent can provide
ServiceTypes *[]string `json:"service_types,omitempty"`
// TopicName NATS topic name for this agent
TopicName *string `json:"topic_name,omitempty"`
// UpdateTime Timestamp when the agent was last updated
UpdateTime *time.Time `json:"update_time,omitempty"`
}
Agent Full agent resource representation
type AgentCost ¶
type AgentCost string
AgentCost Relative cost weight for placement decisions
type AgentHealthStatus ¶
type AgentHealthStatus string
AgentHealthStatus Current health status of the agent
const ( AgentHealthStatusCongested AgentHealthStatus = "congested" AgentHealthStatusReady AgentHealthStatus = "ready" )
Defines values for AgentHealthStatus.
func (AgentHealthStatus) Valid ¶
func (e AgentHealthStatus) Valid() bool
Valid indicates whether the value is a known member of the AgentHealthStatus enum.
type AgentHeartbeat200JSONResponse ¶
type AgentHeartbeat200JSONResponse Agent
func (AgentHeartbeat200JSONResponse) VisitAgentHeartbeatResponse ¶
func (response AgentHeartbeat200JSONResponse) VisitAgentHeartbeatResponse(w http.ResponseWriter) error
type AgentHeartbeat400ApplicationProblemPlusJSONResponse ¶
type AgentHeartbeat400ApplicationProblemPlusJSONResponse Error
func (AgentHeartbeat400ApplicationProblemPlusJSONResponse) VisitAgentHeartbeatResponse ¶
func (response AgentHeartbeat400ApplicationProblemPlusJSONResponse) VisitAgentHeartbeatResponse(w http.ResponseWriter) error
type AgentHeartbeat404ApplicationProblemPlusJSONResponse ¶
type AgentHeartbeat404ApplicationProblemPlusJSONResponse Error
func (AgentHeartbeat404ApplicationProblemPlusJSONResponse) VisitAgentHeartbeatResponse ¶
func (response AgentHeartbeat404ApplicationProblemPlusJSONResponse) VisitAgentHeartbeatResponse(w http.ResponseWriter) error
type AgentHeartbeatJSONRequestBody ¶
type AgentHeartbeatJSONRequestBody = HeartbeatRequest
AgentHeartbeatJSONRequestBody defines body for AgentHeartbeat for application/json ContentType.
type AgentHeartbeatRequestObject ¶
type AgentHeartbeatRequestObject struct {
AgentId AgentIdPath `json:"agentId"`
Body *AgentHeartbeatJSONRequestBody
}
type AgentHeartbeatResponseObject ¶
type AgentHeartbeatResponseObject interface {
VisitAgentHeartbeatResponse(w http.ResponseWriter) error
}
type AgentHeartbeatdefaultApplicationProblemPlusJSONResponse ¶
func (AgentHeartbeatdefaultApplicationProblemPlusJSONResponse) VisitAgentHeartbeatResponse ¶
func (response AgentHeartbeatdefaultApplicationProblemPlusJSONResponse) VisitAgentHeartbeatResponse(w http.ResponseWriter) error
type AgentList ¶
type AgentList struct {
Agents *[]Agent `json:"agents,omitempty"`
// NextPageToken Token for retrieving the next page of results
NextPageToken *string `json:"next_page_token,omitempty"`
}
AgentList Paginated list of agents
type AgentRegistrationRequest ¶
type AgentRegistrationRequest struct {
// Cost Relative cost weight for placement decisions
Cost AgentRegistrationRequestCost `json:"cost"`
// Environment Environment label for the agent
Environment string `json:"environment"`
// Name Unique name of the agent
Name string `json:"name"`
// ServiceTypes List of service types this agent can provide
ServiceTypes []string `json:"service_types"`
// TopicName NATS topic name for this agent (must start with dcm.agent.)
TopicName string `json:"topic_name"`
}
AgentRegistrationRequest Request body for agent registration
type AgentRegistrationRequestCost ¶
type AgentRegistrationRequestCost string
AgentRegistrationRequestCost Relative cost weight for placement decisions
const ( AgentRegistrationRequestCostHigh AgentRegistrationRequestCost = "high" AgentRegistrationRequestCostLow AgentRegistrationRequestCost = "low" AgentRegistrationRequestCostMedium AgentRegistrationRequestCost = "medium" AgentRegistrationRequestCostMediumHigh AgentRegistrationRequestCost = "medium-high" AgentRegistrationRequestCostMediumLow AgentRegistrationRequestCost = "medium-low" )
Defines values for AgentRegistrationRequestCost.
func (AgentRegistrationRequestCost) Valid ¶
func (e AgentRegistrationRequestCost) Valid() bool
Valid indicates whether the value is a known member of the AgentRegistrationRequestCost enum.
type ChiServerOptions ¶
type ChiServerOptions struct {
BaseURL string
BaseRouter chi.Router
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type CreateAgent200JSONResponse ¶
type CreateAgent200JSONResponse Agent
func (CreateAgent200JSONResponse) VisitCreateAgentResponse ¶
func (response CreateAgent200JSONResponse) VisitCreateAgentResponse(w http.ResponseWriter) error
type CreateAgent201JSONResponse ¶
type CreateAgent201JSONResponse Agent
func (CreateAgent201JSONResponse) VisitCreateAgentResponse ¶
func (response CreateAgent201JSONResponse) VisitCreateAgentResponse(w http.ResponseWriter) error
type CreateAgent400ApplicationProblemPlusJSONResponse ¶
type CreateAgent400ApplicationProblemPlusJSONResponse Error
func (CreateAgent400ApplicationProblemPlusJSONResponse) VisitCreateAgentResponse ¶
func (response CreateAgent400ApplicationProblemPlusJSONResponse) VisitCreateAgentResponse(w http.ResponseWriter) error
type CreateAgent409ApplicationProblemPlusJSONResponse ¶
type CreateAgent409ApplicationProblemPlusJSONResponse Error
func (CreateAgent409ApplicationProblemPlusJSONResponse) VisitCreateAgentResponse ¶
func (response CreateAgent409ApplicationProblemPlusJSONResponse) VisitCreateAgentResponse(w http.ResponseWriter) error
type CreateAgentJSONRequestBody ¶
type CreateAgentJSONRequestBody = AgentRegistrationRequest
CreateAgentJSONRequestBody defines body for CreateAgent for application/json ContentType.
type CreateAgentRequestObject ¶
type CreateAgentRequestObject struct {
Body *CreateAgentJSONRequestBody
}
type CreateAgentResponseObject ¶
type CreateAgentResponseObject interface {
VisitCreateAgentResponse(w http.ResponseWriter) error
}
type CreateAgentdefaultApplicationProblemPlusJSONResponse ¶
func (CreateAgentdefaultApplicationProblemPlusJSONResponse) VisitCreateAgentResponse ¶
func (response CreateAgentdefaultApplicationProblemPlusJSONResponse) VisitCreateAgentResponse(w http.ResponseWriter) error
type Error ¶
type Error struct {
// Detail Human-readable explanation specific to this occurrence
Detail *string `json:"detail,omitempty"`
// Instance URI reference for this specific error occurrence
Instance *string `json:"instance,omitempty"`
// Status HTTP status code
Status *int `json:"status,omitempty"`
// Title Short human-readable summary of the problem
Title string `json:"title"`
// Type URI reference identifying the error type
Type string `json:"type"`
}
Error RFC 7807 compliant error response
type GetAgent200JSONResponse ¶
type GetAgent200JSONResponse Agent
func (GetAgent200JSONResponse) VisitGetAgentResponse ¶
func (response GetAgent200JSONResponse) VisitGetAgentResponse(w http.ResponseWriter) error
type GetAgent400ApplicationProblemPlusJSONResponse ¶
type GetAgent400ApplicationProblemPlusJSONResponse Error
func (GetAgent400ApplicationProblemPlusJSONResponse) VisitGetAgentResponse ¶
func (response GetAgent400ApplicationProblemPlusJSONResponse) VisitGetAgentResponse(w http.ResponseWriter) error
type GetAgent404ApplicationProblemPlusJSONResponse ¶
type GetAgent404ApplicationProblemPlusJSONResponse Error
func (GetAgent404ApplicationProblemPlusJSONResponse) VisitGetAgentResponse ¶
func (response GetAgent404ApplicationProblemPlusJSONResponse) VisitGetAgentResponse(w http.ResponseWriter) error
type GetAgentRequestObject ¶
type GetAgentRequestObject struct {
AgentId AgentIdPath `json:"agentId"`
}
type GetAgentResponseObject ¶
type GetAgentResponseObject interface {
VisitGetAgentResponse(w http.ResponseWriter) error
}
type GetAgentdefaultApplicationProblemPlusJSONResponse ¶
func (GetAgentdefaultApplicationProblemPlusJSONResponse) VisitGetAgentResponse ¶
func (response GetAgentdefaultApplicationProblemPlusJSONResponse) VisitGetAgentResponse(w http.ResponseWriter) error
type HeartbeatRequest ¶
type HeartbeatRequest struct {
// ConsumerLag Number of unprocessed messages in the agent's NATS consumer
ConsumerLag int64 `json:"consumer_lag"`
// Timestamp Timestamp of this heartbeat (used for monotonicity check)
Timestamp time.Time `json:"timestamp"`
}
HeartbeatRequest Request body for agent heartbeat
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type ListAgents200JSONResponse ¶
type ListAgents200JSONResponse AgentList
func (ListAgents200JSONResponse) VisitListAgentsResponse ¶
func (response ListAgents200JSONResponse) VisitListAgentsResponse(w http.ResponseWriter) error
type ListAgents400ApplicationProblemPlusJSONResponse ¶
type ListAgents400ApplicationProblemPlusJSONResponse Error
func (ListAgents400ApplicationProblemPlusJSONResponse) VisitListAgentsResponse ¶
func (response ListAgents400ApplicationProblemPlusJSONResponse) VisitListAgentsResponse(w http.ResponseWriter) error
type ListAgentsParams ¶
type ListAgentsParams struct {
// HealthStatus Filter agents by health status
HealthStatus *ListAgentsParamsHealthStatus `form:"health_status,omitempty" json:"health_status,omitempty"`
// MaxPageSize Maximum number of results per page
MaxPageSize *int `form:"max_page_size,omitempty" json:"max_page_size,omitempty"`
// PageToken Token for pagination
PageToken *string `form:"page_token,omitempty" json:"page_token,omitempty"`
}
ListAgentsParams defines parameters for ListAgents.
type ListAgentsParamsHealthStatus ¶
type ListAgentsParamsHealthStatus string
ListAgentsParamsHealthStatus defines parameters for ListAgents.
const ( ListAgentsParamsHealthStatusCongested ListAgentsParamsHealthStatus = "congested" ListAgentsParamsHealthStatusReady ListAgentsParamsHealthStatus = "ready" )
Defines values for ListAgentsParamsHealthStatus.
func (ListAgentsParamsHealthStatus) Valid ¶
func (e ListAgentsParamsHealthStatus) Valid() bool
Valid indicates whether the value is a known member of the ListAgentsParamsHealthStatus enum.
type ListAgentsRequestObject ¶
type ListAgentsRequestObject struct {
Params ListAgentsParams
}
type ListAgentsResponseObject ¶
type ListAgentsResponseObject interface {
VisitListAgentsResponse(w http.ResponseWriter) error
}
type ListAgentsdefaultApplicationProblemPlusJSONResponse ¶
func (ListAgentsdefaultApplicationProblemPlusJSONResponse) VisitListAgentsResponse ¶
func (response ListAgentsdefaultApplicationProblemPlusJSONResponse) VisitListAgentsResponse(w http.ResponseWriter) error
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 ServerInterface ¶
type ServerInterface interface {
// List all agents
// (GET /agents)
ListAgents(w http.ResponseWriter, r *http.Request, params ListAgentsParams)
// Register an agent
// (POST /agents)
CreateAgent(w http.ResponseWriter, r *http.Request)
// Get an agent
// (GET /agents/{agentId})
GetAgent(w http.ResponseWriter, r *http.Request, agentId AgentIdPath)
// Send agent heartbeat
// (PUT /agents/{agentId}/heartbeat)
AgentHeartbeat(w http.ResponseWriter, r *http.Request, agentId AgentIdPath)
}
ServerInterface represents all server handlers.
func NewStrictHandler ¶
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface
func NewStrictHandlerWithOptions ¶
func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface
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) AgentHeartbeat ¶
func (siw *ServerInterfaceWrapper) AgentHeartbeat(w http.ResponseWriter, r *http.Request)
AgentHeartbeat operation middleware
func (*ServerInterfaceWrapper) CreateAgent ¶
func (siw *ServerInterfaceWrapper) CreateAgent(w http.ResponseWriter, r *http.Request)
CreateAgent operation middleware
func (*ServerInterfaceWrapper) GetAgent ¶
func (siw *ServerInterfaceWrapper) GetAgent(w http.ResponseWriter, r *http.Request)
GetAgent operation middleware
func (*ServerInterfaceWrapper) ListAgents ¶
func (siw *ServerInterfaceWrapper) ListAgents(w http.ResponseWriter, r *http.Request)
ListAgents operation middleware
type StrictHTTPServerOptions ¶
type StrictHTTPServerOptions struct {
RequestErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type StrictHandlerFunc ¶
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc
type StrictServerInterface ¶
type StrictServerInterface interface {
// List all agents
// (GET /agents)
ListAgents(ctx context.Context, request ListAgentsRequestObject) (ListAgentsResponseObject, error)
// Register an agent
// (POST /agents)
CreateAgent(ctx context.Context, request CreateAgentRequestObject) (CreateAgentResponseObject, error)
// Get an agent
// (GET /agents/{agentId})
GetAgent(ctx context.Context, request GetAgentRequestObject) (GetAgentResponseObject, error)
// Send agent heartbeat
// (PUT /agents/{agentId}/heartbeat)
AgentHeartbeat(ctx context.Context, request AgentHeartbeatRequestObject) (AgentHeartbeatResponseObject, error)
}
StrictServerInterface represents all server handlers.
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 Unimplemented ¶
type Unimplemented struct{}
func (Unimplemented) AgentHeartbeat ¶
func (_ Unimplemented) AgentHeartbeat(w http.ResponseWriter, r *http.Request, agentId AgentIdPath)
Send agent heartbeat (PUT /agents/{agentId}/heartbeat)
func (Unimplemented) CreateAgent ¶
func (_ Unimplemented) CreateAgent(w http.ResponseWriter, r *http.Request)
Register an agent (POST /agents)
func (Unimplemented) GetAgent ¶
func (_ Unimplemented) GetAgent(w http.ResponseWriter, r *http.Request, agentId AgentIdPath)
Get an agent (GET /agents/{agentId})
func (Unimplemented) ListAgents ¶
func (_ Unimplemented) ListAgents(w http.ResponseWriter, r *http.Request, params ListAgentsParams)
List all agents (GET /agents)
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error