Documentation
¶
Overview ¶
Package knowlapi contains generated public HTTP transport bindings for Knowl.
Package knowlapi 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 ¶
- Constants
- 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 Citation
- type CitationKind
- type ErrorResponse
- type EvidenceItem
- type Failure
- type GetHealth200JSONResponse
- type GetHealthRequestObject
- type GetHealthResponseObject
- type GetOperation200JSONResponse
- type GetOperation400JSONResponse
- type GetOperation401JSONResponse
- type GetOperation403JSONResponse
- type GetOperation404JSONResponse
- type GetOperation422JSONResponse
- type GetOperation503JSONResponse
- type GetOperationRequestObject
- type GetOperationResponseObject
- type GetReady200JSONResponse
- type GetReady503JSONResponse
- type GetReadyRequestObject
- type GetReadyResponseObject
- type HealthResponse
- type HealthResponseStatus
- type IngestKnowledge200JSONResponse
- type IngestKnowledge400JSONResponse
- type IngestKnowledge401JSONResponse
- type IngestKnowledge403JSONResponse
- type IngestKnowledge422JSONResponse
- type IngestKnowledge503JSONResponse
- type IngestKnowledgeJSONRequestBody
- type IngestKnowledgeRequestObject
- type IngestKnowledgeResponseObject
- type IngestRequest
- type IngestResult
- type IngestResultStatus
- type InvalidParamFormatError
- type JSONBodyBadRequest
- type JSONBodyBadRequestJSONResponse
- type MiddlewareFunc
- type NotFound
- type NotFoundJSONResponse
- type OperationFailed
- type OperationFailedJSONResponse
- type OperationID
- type OperationIDBadRequest
- type OperationIDBadRequestJSONResponse
- type OperationResult
- type OperationResultStatus
- type QueryStringBadRequest
- type QueryStringBadRequestJSONResponse
- type ReadyResponse
- type ReadyResponseStatus
- type RequiredHeaderError
- type RequiredParamError
- type RetrieveKnowledge200JSONResponse
- type RetrieveKnowledge400JSONResponse
- type RetrieveKnowledge401JSONResponse
- type RetrieveKnowledge403JSONResponse
- type RetrieveKnowledge422JSONResponse
- type RetrieveKnowledge503JSONResponse
- type RetrieveKnowledgeParams
- type RetrieveKnowledgeRequestObject
- type RetrieveKnowledgeResponseObject
- type RetrieveQuery
- type RetrieveResult
- type ScopeOverrideForbidden
- type ScopeOverrideForbiddenJSONResponse
- type ServeMux
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) GetHealth(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetOperation(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetReady(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) IngestKnowledge(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) RetrieveKnowledge(w http.ResponseWriter, r *http.Request)
- type StdHTTPServerOptions
- type StrictHTTPServerOptions
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type TooManyValuesForParamError
- type Unauthorized
- type UnauthorizedJSONResponse
- type UnauthorizedResponseHeaders
- type UnavailableError
- type UnavailableErrorJSONResponse
- type UnescapedCookieParamError
- type UnmarshalingParamError
Constants ¶
const (
BearerAuthScopes = "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, 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 Citation ¶
type Citation struct {
Kind CitationKind `json:"kind"`
PageId *string `json:"page_id,omitempty"`
Path *string `json:"path,omitempty"`
Reference string `json:"reference"`
SourceRef *string `json:"source_ref,omitempty"`
Untrusted bool `json:"untrusted"`
}
Citation defines model for Citation.
type CitationKind ¶
type CitationKind string
CitationKind defines model for Citation.Kind.
const ( Raw CitationKind = "raw" Wiki CitationKind = "wiki" )
Defines values for CitationKind.
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
ErrorResponse defines model for ErrorResponse.
type EvidenceItem ¶
type EvidenceItem struct {
PageId string `json:"page_id"`
Snippet string `json:"snippet"`
SourceRefs *[]string `json:"source_refs,omitempty"`
Title string `json:"title"`
Untrusted bool `json:"untrusted"`
}
EvidenceItem defines model for EvidenceItem.
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 GetOperation200JSONResponse ¶
type GetOperation200JSONResponse OperationResult
func (GetOperation200JSONResponse) VisitGetOperationResponse ¶
func (response GetOperation200JSONResponse) VisitGetOperationResponse(w http.ResponseWriter) error
type GetOperation400JSONResponse ¶
type GetOperation400JSONResponse struct {
OperationIDBadRequestJSONResponse
}
func (GetOperation400JSONResponse) VisitGetOperationResponse ¶
func (response GetOperation400JSONResponse) VisitGetOperationResponse(w http.ResponseWriter) error
type GetOperation401JSONResponse ¶
func (GetOperation401JSONResponse) VisitGetOperationResponse ¶
func (response GetOperation401JSONResponse) VisitGetOperationResponse(w http.ResponseWriter) error
type GetOperation403JSONResponse ¶
type GetOperation403JSONResponse struct {
ScopeOverrideForbiddenJSONResponse
}
func (GetOperation403JSONResponse) VisitGetOperationResponse ¶
func (response GetOperation403JSONResponse) VisitGetOperationResponse(w http.ResponseWriter) error
type GetOperation404JSONResponse ¶
type GetOperation404JSONResponse struct{ NotFoundJSONResponse }
func (GetOperation404JSONResponse) VisitGetOperationResponse ¶
func (response GetOperation404JSONResponse) VisitGetOperationResponse(w http.ResponseWriter) error
type GetOperation422JSONResponse ¶
type GetOperation422JSONResponse struct{ OperationFailedJSONResponse }
func (GetOperation422JSONResponse) VisitGetOperationResponse ¶
func (response GetOperation422JSONResponse) VisitGetOperationResponse(w http.ResponseWriter) error
type GetOperation503JSONResponse ¶
func (GetOperation503JSONResponse) VisitGetOperationResponse ¶
func (response GetOperation503JSONResponse) VisitGetOperationResponse(w http.ResponseWriter) error
type GetOperationRequestObject ¶
type GetOperationRequestObject struct {
OperationId OperationID `json:"operation_id"`
}
type GetOperationResponseObject ¶
type GetOperationResponseObject interface {
VisitGetOperationResponse(w http.ResponseWriter) error
}
type GetReady200JSONResponse ¶
type GetReady200JSONResponse ReadyResponse
func (GetReady200JSONResponse) VisitGetReadyResponse ¶
func (response GetReady200JSONResponse) VisitGetReadyResponse(w http.ResponseWriter) error
type GetReady503JSONResponse ¶
type GetReady503JSONResponse ReadyResponse
func (GetReady503JSONResponse) VisitGetReadyResponse ¶
func (response GetReady503JSONResponse) VisitGetReadyResponse(w http.ResponseWriter) error
type GetReadyRequestObject ¶
type GetReadyRequestObject struct {
}
type GetReadyResponseObject ¶
type GetReadyResponseObject interface {
VisitGetReadyResponse(w http.ResponseWriter) error
}
type HealthResponse ¶
type HealthResponse struct {
Service string `json:"service"`
Status HealthResponseStatus `json:"status"`
}
HealthResponse defines model for HealthResponse.
type HealthResponseStatus ¶
type HealthResponseStatus string
HealthResponseStatus defines model for HealthResponse.Status.
const (
Ok HealthResponseStatus = "ok"
)
Defines values for HealthResponseStatus.
type IngestKnowledge200JSONResponse ¶
type IngestKnowledge200JSONResponse IngestResult
func (IngestKnowledge200JSONResponse) VisitIngestKnowledgeResponse ¶
func (response IngestKnowledge200JSONResponse) VisitIngestKnowledgeResponse(w http.ResponseWriter) error
type IngestKnowledge400JSONResponse ¶
type IngestKnowledge400JSONResponse struct{ JSONBodyBadRequestJSONResponse }
func (IngestKnowledge400JSONResponse) VisitIngestKnowledgeResponse ¶
func (response IngestKnowledge400JSONResponse) VisitIngestKnowledgeResponse(w http.ResponseWriter) error
type IngestKnowledge401JSONResponse ¶
func (IngestKnowledge401JSONResponse) VisitIngestKnowledgeResponse ¶
func (response IngestKnowledge401JSONResponse) VisitIngestKnowledgeResponse(w http.ResponseWriter) error
type IngestKnowledge403JSONResponse ¶
type IngestKnowledge403JSONResponse struct {
ScopeOverrideForbiddenJSONResponse
}
func (IngestKnowledge403JSONResponse) VisitIngestKnowledgeResponse ¶
func (response IngestKnowledge403JSONResponse) VisitIngestKnowledgeResponse(w http.ResponseWriter) error
type IngestKnowledge422JSONResponse ¶
type IngestKnowledge422JSONResponse struct{ OperationFailedJSONResponse }
func (IngestKnowledge422JSONResponse) VisitIngestKnowledgeResponse ¶
func (response IngestKnowledge422JSONResponse) VisitIngestKnowledgeResponse(w http.ResponseWriter) error
type IngestKnowledge503JSONResponse ¶
func (IngestKnowledge503JSONResponse) VisitIngestKnowledgeResponse ¶
func (response IngestKnowledge503JSONResponse) VisitIngestKnowledgeResponse(w http.ResponseWriter) error
type IngestKnowledgeJSONRequestBody ¶
type IngestKnowledgeJSONRequestBody = IngestRequest
IngestKnowledgeJSONRequestBody defines body for IngestKnowledge for application/json ContentType.
type IngestKnowledgeRequestObject ¶
type IngestKnowledgeRequestObject struct {
Body *IngestKnowledgeJSONRequestBody
}
type IngestKnowledgeResponseObject ¶
type IngestKnowledgeResponseObject interface {
VisitIngestKnowledgeResponse(w http.ResponseWriter) error
}
type IngestRequest ¶
type IngestRequest struct {
// Content Raw source content.
Content *string `json:"content,omitempty"`
IdempotencyKey *string `json:"idempotency_key,omitempty"`
MediaType *string `json:"media_type,omitempty"`
Origin *string `json:"origin,omitempty"`
// Uri External source URI.
Uri *string `json:"uri,omitempty"`
}
IngestRequest defines model for IngestRequest.
type IngestResult ¶
type IngestResult struct {
OperationId string `json:"operation_id"`
Status IngestResultStatus `json:"status"`
}
IngestResult defines model for IngestResult.
type IngestResultStatus ¶
type IngestResultStatus string
IngestResultStatus defines model for IngestResult.Status.
const ( IngestResultStatusCompleted IngestResultStatus = "completed" IngestResultStatusFailed IngestResultStatus = "failed" IngestResultStatusQueued IngestResultStatus = "queued" IngestResultStatusRunning IngestResultStatus = "running" )
Defines values for IngestResultStatus.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type JSONBodyBadRequest ¶
type JSONBodyBadRequest = ErrorResponse
JSONBodyBadRequest defines model for JSONBodyBadRequest.
type JSONBodyBadRequestJSONResponse ¶
type JSONBodyBadRequestJSONResponse ErrorResponse
type NotFoundJSONResponse ¶
type NotFoundJSONResponse ErrorResponse
type OperationFailed ¶
type OperationFailed = ErrorResponse
OperationFailed defines model for OperationFailed.
type OperationFailedJSONResponse ¶
type OperationFailedJSONResponse ErrorResponse
type OperationIDBadRequest ¶
type OperationIDBadRequest = ErrorResponse
OperationIDBadRequest defines model for OperationIDBadRequest.
type OperationIDBadRequestJSONResponse ¶
type OperationIDBadRequestJSONResponse ErrorResponse
type OperationResult ¶
type OperationResult struct {
Failure *Failure `json:"failure,omitempty"`
Id string `json:"id"`
Status OperationResultStatus `json:"status"`
UpdatedAt time.Time `json:"updated_at"`
}
OperationResult defines model for OperationResult.
type OperationResultStatus ¶
type OperationResultStatus string
OperationResultStatus defines model for OperationResult.Status.
const ( OperationResultStatusCompleted OperationResultStatus = "completed" OperationResultStatusFailed OperationResultStatus = "failed" OperationResultStatusQueued OperationResultStatus = "queued" OperationResultStatusRunning OperationResultStatus = "running" )
Defines values for OperationResultStatus.
type QueryStringBadRequest ¶
type QueryStringBadRequest = ErrorResponse
QueryStringBadRequest defines model for QueryStringBadRequest.
type QueryStringBadRequestJSONResponse ¶
type QueryStringBadRequestJSONResponse ErrorResponse
type ReadyResponse ¶
type ReadyResponse struct {
// Scope Trusted scope reported only when the host is ready.
Scope *string `json:"scope,omitempty"`
Service string `json:"service"`
Status ReadyResponseStatus `json:"status"`
}
ReadyResponse defines model for ReadyResponse.
type ReadyResponseStatus ¶
type ReadyResponseStatus string
ReadyResponseStatus defines model for ReadyResponse.Status.
const ( NotReady ReadyResponseStatus = "not_ready" Ready ReadyResponseStatus = "ready" )
Defines values for ReadyResponseStatus.
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 RetrieveKnowledge200JSONResponse ¶
type RetrieveKnowledge200JSONResponse RetrieveResult
func (RetrieveKnowledge200JSONResponse) VisitRetrieveKnowledgeResponse ¶
func (response RetrieveKnowledge200JSONResponse) VisitRetrieveKnowledgeResponse(w http.ResponseWriter) error
type RetrieveKnowledge400JSONResponse ¶
type RetrieveKnowledge400JSONResponse struct {
QueryStringBadRequestJSONResponse
}
func (RetrieveKnowledge400JSONResponse) VisitRetrieveKnowledgeResponse ¶
func (response RetrieveKnowledge400JSONResponse) VisitRetrieveKnowledgeResponse(w http.ResponseWriter) error
type RetrieveKnowledge401JSONResponse ¶
func (RetrieveKnowledge401JSONResponse) VisitRetrieveKnowledgeResponse ¶
func (response RetrieveKnowledge401JSONResponse) VisitRetrieveKnowledgeResponse(w http.ResponseWriter) error
type RetrieveKnowledge403JSONResponse ¶
type RetrieveKnowledge403JSONResponse struct {
ScopeOverrideForbiddenJSONResponse
}
func (RetrieveKnowledge403JSONResponse) VisitRetrieveKnowledgeResponse ¶
func (response RetrieveKnowledge403JSONResponse) VisitRetrieveKnowledgeResponse(w http.ResponseWriter) error
type RetrieveKnowledge422JSONResponse ¶
type RetrieveKnowledge422JSONResponse struct{ OperationFailedJSONResponse }
func (RetrieveKnowledge422JSONResponse) VisitRetrieveKnowledgeResponse ¶
func (response RetrieveKnowledge422JSONResponse) VisitRetrieveKnowledgeResponse(w http.ResponseWriter) error
type RetrieveKnowledge503JSONResponse ¶
func (RetrieveKnowledge503JSONResponse) VisitRetrieveKnowledgeResponse ¶
func (response RetrieveKnowledge503JSONResponse) VisitRetrieveKnowledgeResponse(w http.ResponseWriter) error
type RetrieveKnowledgeParams ¶
type RetrieveKnowledgeParams struct {
// Query Free-text retrieval query.
Query RetrieveQuery `form:"query" json:"query"`
}
RetrieveKnowledgeParams defines parameters for RetrieveKnowledge.
type RetrieveKnowledgeRequestObject ¶
type RetrieveKnowledgeRequestObject struct {
Params RetrieveKnowledgeParams
}
type RetrieveKnowledgeResponseObject ¶
type RetrieveKnowledgeResponseObject interface {
VisitRetrieveKnowledgeResponse(w http.ResponseWriter) error
}
type RetrieveResult ¶
type RetrieveResult struct {
Citations *[]Citation `json:"citations,omitempty"`
Evidence []EvidenceItem `json:"evidence"`
Query string `json:"query"`
}
RetrieveResult defines model for RetrieveResult.
type ScopeOverrideForbidden ¶
type ScopeOverrideForbidden = ErrorResponse
ScopeOverrideForbidden defines model for ScopeOverrideForbidden.
type ScopeOverrideForbiddenJSONResponse ¶
type ScopeOverrideForbiddenJSONResponse ErrorResponse
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 ServerInterface ¶
type ServerInterface interface {
// Liveness probe
// (GET /healthz)
GetHealth(w http.ResponseWriter, r *http.Request)
// Readiness probe
// (GET /readyz)
GetReady(w http.ResponseWriter, r *http.Request)
// Submit one bounded source to the trusted Knowl ingest pipeline
// (POST /v1/ingest)
IngestKnowledge(w http.ResponseWriter, r *http.Request)
// Read one durable Knowl operation status
// (GET /v1/operations/{operation_id})
GetOperation(w http.ResponseWriter, r *http.Request, operationId OperationID)
// Retrieve bounded evidence from the trusted Knowl scope
// (GET /v1/retrieve)
RetrieveKnowledge(w http.ResponseWriter, r *http.Request, params RetrieveKnowledgeParams)
}
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) GetOperation ¶
func (siw *ServerInterfaceWrapper) GetOperation(w http.ResponseWriter, r *http.Request)
GetOperation operation middleware
func (*ServerInterfaceWrapper) GetReady ¶
func (siw *ServerInterfaceWrapper) GetReady(w http.ResponseWriter, r *http.Request)
GetReady operation middleware
func (*ServerInterfaceWrapper) IngestKnowledge ¶
func (siw *ServerInterfaceWrapper) IngestKnowledge(w http.ResponseWriter, r *http.Request)
IngestKnowledge operation middleware
func (*ServerInterfaceWrapper) RetrieveKnowledge ¶
func (siw *ServerInterfaceWrapper) RetrieveKnowledge(w http.ResponseWriter, r *http.Request)
RetrieveKnowledge operation middleware
type StdHTTPServerOptions ¶
type StdHTTPServerOptions struct {
BaseURL string
BaseRouter ServeMux
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
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 {
// Liveness probe
// (GET /healthz)
GetHealth(ctx context.Context, request GetHealthRequestObject) (GetHealthResponseObject, error)
// Readiness probe
// (GET /readyz)
GetReady(ctx context.Context, request GetReadyRequestObject) (GetReadyResponseObject, error)
// Submit one bounded source to the trusted Knowl ingest pipeline
// (POST /v1/ingest)
IngestKnowledge(ctx context.Context, request IngestKnowledgeRequestObject) (IngestKnowledgeResponseObject, error)
// Read one durable Knowl operation status
// (GET /v1/operations/{operation_id})
GetOperation(ctx context.Context, request GetOperationRequestObject) (GetOperationResponseObject, error)
// Retrieve bounded evidence from the trusted Knowl scope
// (GET /v1/retrieve)
RetrieveKnowledge(ctx context.Context, request RetrieveKnowledgeRequestObject) (RetrieveKnowledgeResponseObject, error)
}
StrictServerInterface represents all server handlers.
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type UnauthorizedJSONResponse ¶
type UnauthorizedJSONResponse struct {
}
type UnauthorizedResponseHeaders ¶
type UnauthorizedResponseHeaders struct {
}
type UnavailableError ¶
type UnavailableError = ErrorResponse
UnavailableError defines model for UnavailableError.
type UnavailableErrorJSONResponse ¶
type UnavailableErrorJSONResponse ErrorResponse
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