Documentation
¶
Overview ¶
Package agentwire provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.1-0.20260620164211-2ed9ad814b45 DO NOT EDIT.
Index ¶
- Constants
- func NewCancelAgentOperationRequest(server string, id OperationID) (*http.Request, error)
- func NewDiscoverAgentRequest(server string) (*http.Request, error)
- func NewGetAgentOperationRequest(server string, id OperationID) (*http.Request, error)
- func NewSubmitAgentOperationRequest(server string, body SubmitAgentOperationJSONRequestBody) (*http.Request, error)
- func NewSubmitAgentOperationRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewWaitForAgentOperationRequest(server string, id OperationID, params *WaitForAgentOperationParams) (*http.Request, error)
- func RegisterHandlers(router EchoRouter, si ServerInterface)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
- func RegisterHandlersWithOptions(router EchoRouter, si ServerInterface, options RegisterHandlersOptions)
- type CancelAgentOperationResponse
- func (r CancelAgentOperationResponse) ContentType() string
- func (r CancelAgentOperationResponse) GetBody() []byte
- func (r CancelAgentOperationResponse) GetJSON200() *Operation
- func (r CancelAgentOperationResponse) GetJSONDefault() *ErrorResponse
- func (r CancelAgentOperationResponse) Status() string
- func (r CancelAgentOperationResponse) StatusCode() int
- type Client
- func (c *Client) CancelAgentOperation(ctx context.Context, id OperationID, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) DiscoverAgent(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetAgentOperation(ctx context.Context, id OperationID, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) SubmitAgentOperation(ctx context.Context, body SubmitAgentOperationJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) SubmitAgentOperationWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) WaitForAgentOperation(ctx context.Context, id OperationID, params *WaitForAgentOperationParams, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) CancelAgentOperationWithResponse(ctx context.Context, id OperationID, reqEditors ...RequestEditorFn) (*CancelAgentOperationResponse, error)
- func (c *ClientWithResponses) DiscoverAgentWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*DiscoverAgentResponse, error)
- func (c *ClientWithResponses) GetAgentOperationWithResponse(ctx context.Context, id OperationID, reqEditors ...RequestEditorFn) (*GetAgentOperationResponse, error)
- func (c *ClientWithResponses) SubmitAgentOperationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*SubmitAgentOperationResponse, error)
- func (c *ClientWithResponses) SubmitAgentOperationWithResponse(ctx context.Context, body SubmitAgentOperationJSONRequestBody, ...) (*SubmitAgentOperationResponse, error)
- func (c *ClientWithResponses) WaitForAgentOperationWithResponse(ctx context.Context, id OperationID, params *WaitForAgentOperationParams, ...) (*WaitForAgentOperationResponse, error)
- type ClientWithResponsesInterface
- type Descriptor
- type DescriptorApiVersion
- type DiscoverAgentResponse
- func (r DiscoverAgentResponse) ContentType() string
- func (r DiscoverAgentResponse) GetBody() []byte
- func (r DiscoverAgentResponse) GetJSON200() *Descriptor
- func (r DiscoverAgentResponse) GetJSONDefault() *ErrorResponse
- func (r DiscoverAgentResponse) Status() string
- func (r DiscoverAgentResponse) StatusCode() int
- type EchoRouter
- type ErrorEnvelope
- type ErrorResponse
- type GetAgentOperationResponse
- func (r GetAgentOperationResponse) ContentType() string
- func (r GetAgentOperationResponse) GetBody() []byte
- func (r GetAgentOperationResponse) GetJSON200() *Operation
- func (r GetAgentOperationResponse) GetJSONDefault() *ErrorResponse
- func (r GetAgentOperationResponse) Status() string
- func (r GetAgentOperationResponse) StatusCode() int
- type HttpRequestDoer
- type Operation
- type OperationApiVersion
- type OperationError
- type OperationID
- type Presentation
- type RegisterHandlersOptions
- type RequestEditorFn
- type ServerInterface
- type ServerInterfaceWrapper
- func (w *ServerInterfaceWrapper) CancelAgentOperation(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) DiscoverAgent(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetAgentOperation(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) SubmitAgentOperation(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) WaitForAgentOperation(ctx echo.Context) error
- type State
- type SubmitAgentOperationJSONRequestBody
- type SubmitAgentOperationResponse
- func (r SubmitAgentOperationResponse) ContentType() string
- func (r SubmitAgentOperationResponse) GetBody() []byte
- func (r SubmitAgentOperationResponse) GetJSON200() *Operation
- func (r SubmitAgentOperationResponse) GetJSON202() *Operation
- func (r SubmitAgentOperationResponse) GetJSONDefault() *ErrorResponse
- func (r SubmitAgentOperationResponse) Status() string
- func (r SubmitAgentOperationResponse) StatusCode() int
- type SubmitRequest
- type WaitForAgentOperationParams
- type WaitForAgentOperationResponse
- func (r WaitForAgentOperationResponse) ContentType() string
- func (r WaitForAgentOperationResponse) GetBody() []byte
- func (r WaitForAgentOperationResponse) GetJSON200() *Operation
- func (r WaitForAgentOperationResponse) GetJSONDefault() *ErrorResponse
- func (r WaitForAgentOperationResponse) Status() string
- func (r WaitForAgentOperationResponse) StatusCode() int
Constants ¶
const (
AgentBearerScopes agentBearerContextKey = "agentBearer.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
func NewCancelAgentOperationRequest ¶
func NewCancelAgentOperationRequest(server string, id OperationID) (*http.Request, error)
NewCancelAgentOperationRequest constructs an http.Request for the CancelAgentOperation method
func NewDiscoverAgentRequest ¶
NewDiscoverAgentRequest constructs an http.Request for the DiscoverAgent method
func NewGetAgentOperationRequest ¶
func NewGetAgentOperationRequest(server string, id OperationID) (*http.Request, error)
NewGetAgentOperationRequest constructs an http.Request for the GetAgentOperation method
func NewSubmitAgentOperationRequest ¶
func NewSubmitAgentOperationRequest(server string, body SubmitAgentOperationJSONRequestBody) (*http.Request, error)
NewSubmitAgentOperationRequest calls the generic SubmitAgentOperation builder with application/json body
func NewSubmitAgentOperationRequestWithBody ¶
func NewSubmitAgentOperationRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewSubmitAgentOperationRequestWithBody constructs an http.Request for the SubmitAgentOperation method, with any body, and a specified content type
func NewWaitForAgentOperationRequest ¶
func NewWaitForAgentOperationRequest(server string, id OperationID, params *WaitForAgentOperationParams) (*http.Request, error)
NewWaitForAgentOperationRequest constructs an http.Request for the WaitForAgentOperation method
func RegisterHandlers ¶
func RegisterHandlers(router EchoRouter, si ServerInterface)
RegisterHandlers adds each server route to the EchoRouter.
func RegisterHandlersWithBaseURL ¶
func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
RegisterHandlersWithBaseURL registers handlers and prepends BaseURL to the paths so the API can be served under a prefix.
func RegisterHandlersWithOptions ¶
func RegisterHandlersWithOptions(router EchoRouter, si ServerInterface, options RegisterHandlersOptions)
RegisterHandlersWithOptions registers handlers using the supplied options, including any per-operation middleware.
Types ¶
type CancelAgentOperationResponse ¶
type CancelAgentOperationResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Operation
// JSONDefault the response for an HTTP default `application/json` response
JSONDefault *ErrorResponse
}
func ParseCancelAgentOperationResponse ¶
func ParseCancelAgentOperationResponse(rsp *http.Response) (*CancelAgentOperationResponse, error)
ParseCancelAgentOperationResponse parses an HTTP response from a CancelAgentOperationWithResponse call
func (CancelAgentOperationResponse) ContentType ¶
func (r CancelAgentOperationResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (CancelAgentOperationResponse) GetBody ¶
func (r CancelAgentOperationResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (CancelAgentOperationResponse) GetJSON200 ¶
func (r CancelAgentOperationResponse) GetJSON200() *Operation
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (CancelAgentOperationResponse) GetJSONDefault ¶
func (r CancelAgentOperationResponse) GetJSONDefault() *ErrorResponse
GetJSONDefault returns the response for an HTTP default `application/json` response
func (CancelAgentOperationResponse) Status ¶
func (r CancelAgentOperationResponse) Status() string
Status returns HTTPResponse.Status
func (CancelAgentOperationResponse) StatusCode ¶
func (r CancelAgentOperationResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type Client ¶
type Client struct {
// The endpoint of the server conforming to this interface, with scheme,
// https://api.deepmap.com for example. This can contain a path relative
// to the server, such as https://api.deepmap.com/dev-test, and all the
// paths in the swagger spec will be appended to the server.
Server string
// Doer for performing requests, typically a *http.Client with any
// customized settings, such as certificate chains.
Client HttpRequestDoer
// A list of callbacks for modifying requests which are generated before sending over
// the network.
RequestEditors []RequestEditorFn
}
Client which conforms to the OpenAPI3 specification for this service.
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) CancelAgentOperation ¶
func (c *Client) CancelAgentOperation(ctx context.Context, id OperationID, reqEditors ...RequestEditorFn) (*http.Response, error)
CancelAgentOperation performs a POST /api/agent/v1/operations/{id}/cancel (the `CancelAgentOperation` operationId) request.
func (*Client) DiscoverAgent ¶
func (c *Client) DiscoverAgent(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
DiscoverAgent performs a GET /.well-known/brokerkit-agent (the `DiscoverAgent` operationId) request.
func (*Client) GetAgentOperation ¶
func (c *Client) GetAgentOperation(ctx context.Context, id OperationID, reqEditors ...RequestEditorFn) (*http.Response, error)
GetAgentOperation performs a GET /api/agent/v1/operations/{id} (the `GetAgentOperation` operationId) request.
func (*Client) SubmitAgentOperation ¶
func (c *Client) SubmitAgentOperation(ctx context.Context, body SubmitAgentOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
SubmitAgentOperation performs a POST /api/agent/v1/operations (the `SubmitAgentOperation` operationId) request. Takes a body of the `application/json` content type.
func (*Client) SubmitAgentOperationWithBody ¶
func (c *Client) SubmitAgentOperationWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
SubmitAgentOperationWithBody performs a POST /api/agent/v1/operations (the `SubmitAgentOperation` operationId) request, with any type of body and a specified content type.
func (*Client) WaitForAgentOperation ¶
func (c *Client) WaitForAgentOperation(ctx context.Context, id OperationID, params *WaitForAgentOperationParams, reqEditors ...RequestEditorFn) (*http.Response, error)
WaitForAgentOperation performs a GET /api/agent/v1/operations/{id}/events (the `WaitForAgentOperation` operationId) request.
type ClientInterface ¶
type ClientInterface interface {
// DiscoverAgent performs a GET /.well-known/brokerkit-agent (the `DiscoverAgent` operationId) request.
DiscoverAgent(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// SubmitAgentOperationWithBody performs a POST /api/agent/v1/operations (the `SubmitAgentOperation` operationId) request,
// with any type of body and a specified content type.
SubmitAgentOperationWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// SubmitAgentOperation performs a POST /api/agent/v1/operations (the `SubmitAgentOperation` operationId) request.
// Takes a body of the `application/json` content type.
SubmitAgentOperation(ctx context.Context, body SubmitAgentOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetAgentOperation performs a GET /api/agent/v1/operations/{id} (the `GetAgentOperation` operationId) request.
GetAgentOperation(ctx context.Context, id OperationID, reqEditors ...RequestEditorFn) (*http.Response, error)
// CancelAgentOperation performs a POST /api/agent/v1/operations/{id}/cancel (the `CancelAgentOperation` operationId) request.
CancelAgentOperation(ctx context.Context, id OperationID, reqEditors ...RequestEditorFn) (*http.Response, error)
// WaitForAgentOperation performs a GET /api/agent/v1/operations/{id}/events (the `WaitForAgentOperation` operationId) request.
WaitForAgentOperation(ctx context.Context, id OperationID, params *WaitForAgentOperationParams, reqEditors ...RequestEditorFn) (*http.Response, error)
}
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) CancelAgentOperationWithResponse ¶
func (c *ClientWithResponses) CancelAgentOperationWithResponse(ctx context.Context, id OperationID, reqEditors ...RequestEditorFn) (*CancelAgentOperationResponse, error)
CancelAgentOperationWithResponse performs a POST /api/agent/v1/operations/{id}/cancel (the `CancelAgentOperation` operationId) request.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) DiscoverAgentWithResponse ¶
func (c *ClientWithResponses) DiscoverAgentWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*DiscoverAgentResponse, error)
DiscoverAgentWithResponse performs a GET /.well-known/brokerkit-agent (the `DiscoverAgent` operationId) request.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) GetAgentOperationWithResponse ¶
func (c *ClientWithResponses) GetAgentOperationWithResponse(ctx context.Context, id OperationID, reqEditors ...RequestEditorFn) (*GetAgentOperationResponse, error)
GetAgentOperationWithResponse performs a GET /api/agent/v1/operations/{id} (the `GetAgentOperation` operationId) request.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) SubmitAgentOperationWithBodyWithResponse ¶
func (c *ClientWithResponses) SubmitAgentOperationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SubmitAgentOperationResponse, error)
SubmitAgentOperationWithBodyWithResponse performs a POST /api/agent/v1/operations (the `SubmitAgentOperation` operationId) request, with any type of body and a specified content type.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) SubmitAgentOperationWithResponse ¶
func (c *ClientWithResponses) SubmitAgentOperationWithResponse(ctx context.Context, body SubmitAgentOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*SubmitAgentOperationResponse, error)
SubmitAgentOperationWithResponse performs a POST /api/agent/v1/operations (the `SubmitAgentOperation` operationId) request. Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) WaitForAgentOperationWithResponse ¶
func (c *ClientWithResponses) WaitForAgentOperationWithResponse(ctx context.Context, id OperationID, params *WaitForAgentOperationParams, reqEditors ...RequestEditorFn) (*WaitForAgentOperationResponse, error)
WaitForAgentOperationWithResponse performs a GET /api/agent/v1/operations/{id}/events (the `WaitForAgentOperation` operationId) request.
Returns a wrapper object for the known response body format(s).
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// DiscoverAgentWithResponse performs a GET /.well-known/brokerkit-agent (the `DiscoverAgent` operationId) request.
//
// Returns a wrapper object for the known response body format(s).
DiscoverAgentWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*DiscoverAgentResponse, error)
// SubmitAgentOperationWithBodyWithResponse performs a POST /api/agent/v1/operations (the `SubmitAgentOperation` operationId) request,
// with any type of body and a specified content type.
//
// Returns a wrapper object for the known response body format(s).
SubmitAgentOperationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SubmitAgentOperationResponse, error)
// SubmitAgentOperationWithResponse performs a POST /api/agent/v1/operations (the `SubmitAgentOperation` operationId) request.
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
SubmitAgentOperationWithResponse(ctx context.Context, body SubmitAgentOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*SubmitAgentOperationResponse, error)
// GetAgentOperationWithResponse performs a GET /api/agent/v1/operations/{id} (the `GetAgentOperation` operationId) request.
//
// Returns a wrapper object for the known response body format(s).
GetAgentOperationWithResponse(ctx context.Context, id OperationID, reqEditors ...RequestEditorFn) (*GetAgentOperationResponse, error)
// CancelAgentOperationWithResponse performs a POST /api/agent/v1/operations/{id}/cancel (the `CancelAgentOperation` operationId) request.
//
// Returns a wrapper object for the known response body format(s).
CancelAgentOperationWithResponse(ctx context.Context, id OperationID, reqEditors ...RequestEditorFn) (*CancelAgentOperationResponse, error)
// WaitForAgentOperationWithResponse performs a GET /api/agent/v1/operations/{id}/events (the `WaitForAgentOperation` operationId) request.
//
// Returns a wrapper object for the known response body format(s).
WaitForAgentOperationWithResponse(ctx context.Context, id OperationID, params *WaitForAgentOperationParams, reqEditors ...RequestEditorFn) (*WaitForAgentOperationResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type Descriptor ¶
type Descriptor struct {
ApiVersion DescriptorApiVersion `json:"api_version"`
}
Descriptor defines model for Descriptor.
type DescriptorApiVersion ¶
type DescriptorApiVersion string
DescriptorApiVersion defines model for Descriptor.ApiVersion.
const (
DescriptorApiVersionBrokerkitIoagentv1 DescriptorApiVersion = "brokerkit.io/agent/v1"
)
Defines values for DescriptorApiVersion.
func (DescriptorApiVersion) Valid ¶
func (e DescriptorApiVersion) Valid() bool
Valid indicates whether the value is a known member of the DescriptorApiVersion enum.
type DiscoverAgentResponse ¶
type DiscoverAgentResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Descriptor
// JSONDefault the response for an HTTP default `application/json` response
JSONDefault *ErrorResponse
}
func ParseDiscoverAgentResponse ¶
func ParseDiscoverAgentResponse(rsp *http.Response) (*DiscoverAgentResponse, error)
ParseDiscoverAgentResponse parses an HTTP response from a DiscoverAgentWithResponse call
func (DiscoverAgentResponse) ContentType ¶
func (r DiscoverAgentResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (DiscoverAgentResponse) GetBody ¶
func (r DiscoverAgentResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (DiscoverAgentResponse) GetJSON200 ¶
func (r DiscoverAgentResponse) GetJSON200() *Descriptor
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (DiscoverAgentResponse) GetJSONDefault ¶
func (r DiscoverAgentResponse) GetJSONDefault() *ErrorResponse
GetJSONDefault returns the response for an HTTP default `application/json` response
func (DiscoverAgentResponse) Status ¶
func (r DiscoverAgentResponse) Status() string
Status returns HTTPResponse.Status
func (DiscoverAgentResponse) StatusCode ¶
func (r DiscoverAgentResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type EchoRouter ¶
type EchoRouter interface {
CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}
This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration
type ErrorEnvelope ¶
type ErrorEnvelope struct {
Error OperationError `json:"error"`
}
ErrorEnvelope defines model for ErrorEnvelope.
type ErrorResponse ¶
type ErrorResponse = ErrorEnvelope
ErrorResponse defines model for ErrorResponse.
type GetAgentOperationResponse ¶
type GetAgentOperationResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Operation
// JSONDefault the response for an HTTP default `application/json` response
JSONDefault *ErrorResponse
}
func ParseGetAgentOperationResponse ¶
func ParseGetAgentOperationResponse(rsp *http.Response) (*GetAgentOperationResponse, error)
ParseGetAgentOperationResponse parses an HTTP response from a GetAgentOperationWithResponse call
func (GetAgentOperationResponse) ContentType ¶
func (r GetAgentOperationResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (GetAgentOperationResponse) GetBody ¶
func (r GetAgentOperationResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (GetAgentOperationResponse) GetJSON200 ¶
func (r GetAgentOperationResponse) GetJSON200() *Operation
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (GetAgentOperationResponse) GetJSONDefault ¶
func (r GetAgentOperationResponse) GetJSONDefault() *ErrorResponse
GetJSONDefault returns the response for an HTTP default `application/json` response
func (GetAgentOperationResponse) Status ¶
func (r GetAgentOperationResponse) Status() string
Status returns HTTPResponse.Status
func (GetAgentOperationResponse) StatusCode ¶
func (r GetAgentOperationResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type Operation ¶
type Operation struct {
ApiVersion OperationApiVersion `json:"api_version"`
ApprovalId *string `json:"approval_id,omitempty"`
Arguments map[string]interface{} `json:"arguments"`
Broker string `json:"broker"`
ClientId string `json:"client_id"`
CreatedAt time.Time `json:"created_at"`
Error *OperationError `json:"error,omitempty"`
Id string `json:"id"`
IdempotencyKey string `json:"idempotency_key"`
Operation string `json:"operation"`
PlanDigest *string `json:"plan_digest,omitempty"`
Presentation Presentation `json:"presentation"`
Reason string `json:"reason"`
Result *map[string]interface{} `json:"result,omitempty"`
Revision int `json:"revision"`
State State `json:"state"`
Target map[string]interface{} `json:"target"`
TerminalAt *time.Time `json:"terminal_at,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
}
Operation defines model for Operation.
type OperationApiVersion ¶
type OperationApiVersion string
OperationApiVersion defines model for Operation.ApiVersion.
const (
OperationApiVersionBrokerkitIoagentv1 OperationApiVersion = "brokerkit.io/agent/v1"
)
Defines values for OperationApiVersion.
func (OperationApiVersion) Valid ¶
func (e OperationApiVersion) Valid() bool
Valid indicates whether the value is a known member of the OperationApiVersion enum.
type OperationError ¶
OperationError defines model for OperationError.
type Presentation ¶
Presentation defines model for Presentation.
type RegisterHandlersOptions ¶
type RegisterHandlersOptions struct {
// BaseURL is prepended to every registered path so the API can be served
// under a prefix.
BaseURL string
// OperationMiddlewares lets the caller attach per-operation middleware at
// registration time. The map key is the OpenAPI `operationId` value as it
// appears in the spec (the raw, un-normalized form). Operations that have
// no entry are registered with no extra middleware. A nil map disables
// per-operation middleware entirely.
OperationMiddlewares map[string][]echo.MiddlewareFunc
}
RegisterHandlersOptions configures RegisterHandlersWithOptions.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type ServerInterface ¶
type ServerInterface interface {
// (GET /.well-known/brokerkit-agent)
DiscoverAgent(ctx echo.Context) error
// (POST /api/agent/v1/operations)
SubmitAgentOperation(ctx echo.Context) error
// (GET /api/agent/v1/operations/{id})
GetAgentOperation(ctx echo.Context, id OperationID) error
// (POST /api/agent/v1/operations/{id}/cancel)
CancelAgentOperation(ctx echo.Context, id OperationID) error
// (GET /api/agent/v1/operations/{id}/events)
WaitForAgentOperation(ctx echo.Context, id OperationID, params WaitForAgentOperationParams) error
}
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) CancelAgentOperation ¶
func (w *ServerInterfaceWrapper) CancelAgentOperation(ctx echo.Context) error
CancelAgentOperation converts echo context to params.
func (*ServerInterfaceWrapper) DiscoverAgent ¶
func (w *ServerInterfaceWrapper) DiscoverAgent(ctx echo.Context) error
DiscoverAgent converts echo context to params.
func (*ServerInterfaceWrapper) GetAgentOperation ¶
func (w *ServerInterfaceWrapper) GetAgentOperation(ctx echo.Context) error
GetAgentOperation converts echo context to params.
func (*ServerInterfaceWrapper) SubmitAgentOperation ¶
func (w *ServerInterfaceWrapper) SubmitAgentOperation(ctx echo.Context) error
SubmitAgentOperation converts echo context to params.
func (*ServerInterfaceWrapper) WaitForAgentOperation ¶
func (w *ServerInterfaceWrapper) WaitForAgentOperation(ctx echo.Context) error
WaitForAgentOperation converts echo context to params.
type State ¶
type State string
State defines model for State.
type SubmitAgentOperationJSONRequestBody ¶
type SubmitAgentOperationJSONRequestBody = SubmitRequest
SubmitAgentOperationJSONRequestBody defines body for SubmitAgentOperation for application/json ContentType.
type SubmitAgentOperationResponse ¶
type SubmitAgentOperationResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Operation
// JSON202 the response for an HTTP 202 `application/json` response
JSON202 *Operation
// JSONDefault the response for an HTTP default `application/json` response
JSONDefault *ErrorResponse
}
func ParseSubmitAgentOperationResponse ¶
func ParseSubmitAgentOperationResponse(rsp *http.Response) (*SubmitAgentOperationResponse, error)
ParseSubmitAgentOperationResponse parses an HTTP response from a SubmitAgentOperationWithResponse call
func (SubmitAgentOperationResponse) ContentType ¶
func (r SubmitAgentOperationResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (SubmitAgentOperationResponse) GetBody ¶
func (r SubmitAgentOperationResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (SubmitAgentOperationResponse) GetJSON200 ¶
func (r SubmitAgentOperationResponse) GetJSON200() *Operation
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (SubmitAgentOperationResponse) GetJSON202 ¶
func (r SubmitAgentOperationResponse) GetJSON202() *Operation
GetJSON202 returns the response for an HTTP 202 `application/json` response
func (SubmitAgentOperationResponse) GetJSONDefault ¶
func (r SubmitAgentOperationResponse) GetJSONDefault() *ErrorResponse
GetJSONDefault returns the response for an HTTP default `application/json` response
func (SubmitAgentOperationResponse) Status ¶
func (r SubmitAgentOperationResponse) Status() string
Status returns HTTPResponse.Status
func (SubmitAgentOperationResponse) StatusCode ¶
func (r SubmitAgentOperationResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type SubmitRequest ¶
type SubmitRequest struct {
Arguments map[string]interface{} `json:"arguments"`
IdempotencyKey string `json:"idempotency_key"`
Operation string `json:"operation"`
Reason string `json:"reason"`
Target map[string]interface{} `json:"target"`
}
SubmitRequest defines model for SubmitRequest.
type WaitForAgentOperationParams ¶
type WaitForAgentOperationParams struct {
AfterRevision *int `form:"after_revision,omitempty" json:"after_revision,omitempty"`
WaitSeconds *int `form:"wait_seconds,omitempty" json:"wait_seconds,omitempty"`
}
WaitForAgentOperationParams defines parameters for WaitForAgentOperation.
type WaitForAgentOperationResponse ¶
type WaitForAgentOperationResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Operation
// JSONDefault the response for an HTTP default `application/json` response
JSONDefault *ErrorResponse
}
func ParseWaitForAgentOperationResponse ¶
func ParseWaitForAgentOperationResponse(rsp *http.Response) (*WaitForAgentOperationResponse, error)
ParseWaitForAgentOperationResponse parses an HTTP response from a WaitForAgentOperationWithResponse call
func (WaitForAgentOperationResponse) ContentType ¶
func (r WaitForAgentOperationResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (WaitForAgentOperationResponse) GetBody ¶
func (r WaitForAgentOperationResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (WaitForAgentOperationResponse) GetJSON200 ¶
func (r WaitForAgentOperationResponse) GetJSON200() *Operation
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (WaitForAgentOperationResponse) GetJSONDefault ¶
func (r WaitForAgentOperationResponse) GetJSONDefault() *ErrorResponse
GetJSONDefault returns the response for an HTTP default `application/json` response
func (WaitForAgentOperationResponse) Status ¶
func (r WaitForAgentOperationResponse) Status() string
Status returns HTTPResponse.Status
func (WaitForAgentOperationResponse) StatusCode ¶
func (r WaitForAgentOperationResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode