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.5.1 DO NOT EDIT.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- 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
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func SPAHandler(fsys fs.FS) http.Handler
- type ErrorResponse
- type GetHealth200JSONResponse
- type GetHealthRequestObject
- type GetHealthResponseObject
- type GetRun200JSONResponse
- type GetRun404JSONResponse
- type GetRunRequestObject
- type GetRunResponseObject
- type Handlers
- func (h *Handlers) GetHealth(_ context.Context, _ GetHealthRequestObject) (GetHealthResponseObject, error)
- func (h *Handlers) GetRun(_ context.Context, request GetRunRequestObject) (GetRunResponseObject, error)
- func (h *Handlers) ListRuns(_ context.Context, request ListRunsRequestObject) (ListRunsResponseObject, error)
- type HealthResponse
- type InvalidParamFormatError
- type ListRuns200JSONResponse
- type ListRunsParams
- type ListRunsRequestObject
- type ListRunsResponseObject
- type MiddlewareFunc
- type RequiredHeaderError
- type RequiredParamError
- type Run
- type RunList
- type RunStatus
- type SSEHub
- type ServeMux
- type Server
- type ServerInterface
- type ServerInterfaceWrapper
- type StdHTTPServerOptions
- type StepState
- type StepStatus
- type StrictHTTPServerOptions
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type UnmarshalingParamError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
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
func PathToRawSpec ¶
Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
Types ¶
type ErrorResponse ¶
ErrorResponse defines model for ErrorResponse.
type GetHealth200JSONResponse ¶
type GetHealth200JSONResponse HealthResponse
func (GetHealth200JSONResponse) VisitGetHealthResponse ¶
func (response GetHealth200JSONResponse) VisitGetHealthResponse(w http.ResponseWriter) error
type GetHealthRequestObject ¶
type GetHealthRequestObject struct {
}
type GetHealthResponseObject ¶
type GetHealthResponseObject interface {
VisitGetHealthResponse(w http.ResponseWriter) error
}
type GetRun200JSONResponse ¶
type GetRun200JSONResponse Run
func (GetRun200JSONResponse) VisitGetRunResponse ¶
func (response GetRun200JSONResponse) VisitGetRunResponse(w http.ResponseWriter) error
type GetRun404JSONResponse ¶
type GetRun404JSONResponse ErrorResponse
func (GetRun404JSONResponse) VisitGetRunResponse ¶
func (response GetRun404JSONResponse) VisitGetRunResponse(w http.ResponseWriter) error
type GetRunRequestObject ¶
type GetRunRequestObject struct {
Id string `json:"id"`
}
type GetRunResponseObject ¶
type GetRunResponseObject interface {
VisitGetRunResponse(w http.ResponseWriter) error
}
type Handlers ¶
type Handlers struct {
Version string
StartTime time.Time
Logger *slog.Logger
MultiRepo bool // when true, aggregate runs from all registered repos
}
Handlers implements the generated StrictServerInterface.
func (*Handlers) GetHealth ¶
func (h *Handlers) GetHealth(_ context.Context, _ GetHealthRequestObject) (GetHealthResponseObject, error)
func (*Handlers) GetRun ¶
func (h *Handlers) GetRun(_ context.Context, request GetRunRequestObject) (GetRunResponseObject, error)
func (*Handlers) ListRuns ¶
func (h *Handlers) ListRuns(_ context.Context, request ListRunsRequestObject) (ListRunsResponseObject, error)
type HealthResponse ¶
type HealthResponse struct {
Status string `json:"status"`
UptimeSeconds int `json:"uptime_seconds"`
Version string `json:"version"`
}
HealthResponse defines model for HealthResponse.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type ListRuns200JSONResponse ¶
type ListRuns200JSONResponse RunList
func (ListRuns200JSONResponse) VisitListRunsResponse ¶
func (response ListRuns200JSONResponse) VisitListRunsResponse(w http.ResponseWriter) error
type ListRunsParams ¶
type ListRunsParams struct {
Status *RunStatus `form:"status,omitempty" json:"status,omitempty"`
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
Offset *int `form:"offset,omitempty" json:"offset,omitempty"`
}
ListRunsParams defines parameters for ListRuns.
type ListRunsRequestObject ¶
type ListRunsRequestObject struct {
Params ListRunsParams
}
type ListRunsResponseObject ¶
type ListRunsResponseObject interface {
VisitListRunsResponse(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 Run ¶
type Run struct {
Branch *string `json:"branch,omitempty"`
CrFeedback *string `json:"cr_feedback,omitempty"`
CrFixSummary *string `json:"cr_fix_summary,omitempty"`
CreatedAt time.Time `json:"created_at"`
Id string `json:"id"`
IssueKey *string `json:"issue_key,omitempty"`
IssueUrl *string `json:"issue_url,omitempty"`
Mode *string `json:"mode,omitempty"`
PlanPath string `json:"plan_path"`
PlanTitle *string `json:"plan_title,omitempty"`
PrNumber *int `json:"pr_number,omitempty"`
PrUrl *string `json:"pr_url,omitempty"`
SourceIssue *int `json:"source_issue,omitempty"`
Status RunStatus `json:"status"`
Steps []StepState `json:"steps"`
UpdatedAt time.Time `json:"updated_at"`
WorktreePath *string `json:"worktree_path,omitempty"`
}
Run defines model for Run.
type SSEHub ¶
type SSEHub struct {
// contains filtered or unexported fields
}
SSEHub fans out run-state change events to connected SSE clients.
type ServeMux ¶
type ServeMux interface {
HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
ServeHTTP(w http.ResponseWriter, r *http.Request)
}
ServeMux is an abstraction of http.ServeMux.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the forge dashboard HTTP server.
func (*Server) RegisterLogStream ¶
RegisterLogStream adds the log streaming endpoint to the given mux.
func (*Server) SetMultiRepo ¶
SetMultiRepo enables aggregation of runs from all registered repos.
type ServerInterface ¶
type ServerInterface interface {
// Health check
// (GET /health)
GetHealth(w http.ResponseWriter, r *http.Request)
// List pipeline runs
// (GET /runs)
ListRuns(w http.ResponseWriter, r *http.Request, params ListRunsParams)
// Get run detail
// (GET /runs/{id})
GetRun(w http.ResponseWriter, r *http.Request, id string)
}
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) GetHealth ¶
func (siw *ServerInterfaceWrapper) GetHealth(w http.ResponseWriter, r *http.Request)
GetHealth operation middleware
func (*ServerInterfaceWrapper) GetRun ¶
func (siw *ServerInterfaceWrapper) GetRun(w http.ResponseWriter, r *http.Request)
GetRun operation middleware
func (*ServerInterfaceWrapper) ListRuns ¶
func (siw *ServerInterfaceWrapper) ListRuns(w http.ResponseWriter, r *http.Request)
ListRuns operation middleware
type StdHTTPServerOptions ¶
type StdHTTPServerOptions struct {
BaseURL string
BaseRouter ServeMux
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type StepState ¶
type StepState struct {
Error *string `json:"error,omitempty"`
Name string `json:"name"`
Status StepStatus `json:"status"`
}
StepState defines model for StepState.
type StepStatus ¶
type StepStatus string
StepStatus defines model for StepStatus.
const ( StepStatusCompleted StepStatus = "completed" StepStatusFailed StepStatus = "failed" StepStatusPending StepStatus = "pending" StepStatusRunning StepStatus = "running" )
Defines values for StepStatus.
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 StrictHandlerFunc = strictnethttp.StrictHTTPHandlerFunc
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc = strictnethttp.StrictHTTPMiddlewareFunc
type StrictServerInterface ¶
type StrictServerInterface interface {
// Health check
// (GET /health)
GetHealth(ctx context.Context, request GetHealthRequestObject) (GetHealthResponseObject, error)
// List pipeline runs
// (GET /runs)
ListRuns(ctx context.Context, request ListRunsRequestObject) (ListRunsResponseObject, error)
// Get run detail
// (GET /runs/{id})
GetRun(ctx context.Context, request GetRunRequestObject) (GetRunResponseObject, 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 UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error