operatorwire

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package operatorwire 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

View Source
const (
	OperatorBearerScopes operatorBearerContextKey = "operatorBearer.Scopes"
)

Variables

This section is empty.

Functions

func NewDecideOperatorRequestRequest

func NewDecideOperatorRequestRequest(server string, id RequestID, action Action, body DecideOperatorRequestJSONRequestBody) (*http.Request, error)

NewDecideOperatorRequestRequest calls the generic DecideOperatorRequest builder with application/json body

func NewDecideOperatorRequestRequestWithBody

func NewDecideOperatorRequestRequestWithBody(server string, id RequestID, action Action, contentType string, body io.Reader) (*http.Request, error)

NewDecideOperatorRequestRequestWithBody constructs an http.Request for the DecideOperatorRequest method, with any body, and a specified content type

func NewDiscoverOperatorRequest

func NewDiscoverOperatorRequest(server string) (*http.Request, error)

NewDiscoverOperatorRequest constructs an http.Request for the DiscoverOperator method

func NewGetOperatorRequestRequest

func NewGetOperatorRequestRequest(server string, id RequestID) (*http.Request, error)

NewGetOperatorRequestRequest constructs an http.Request for the GetOperatorRequest method

func NewListOperatorRequestsRequest

func NewListOperatorRequestsRequest(server string, params *ListOperatorRequestsParams) (*http.Request, error)

NewListOperatorRequestsRequest constructs an http.Request for the ListOperatorRequests method

func NewOperatorHealthRequest

func NewOperatorHealthRequest(server string) (*http.Request, error)

NewOperatorHealthRequest constructs an http.Request for the OperatorHealth method

func NewOperatorReadyRequest

func NewOperatorReadyRequest(server string) (*http.Request, error)

NewOperatorReadyRequest constructs an http.Request for the OperatorReady method

func NewStreamOperatorEventsRequest

func NewStreamOperatorEventsRequest(server string, params *StreamOperatorEventsParams) (*http.Request, error)

NewStreamOperatorEventsRequest constructs an http.Request for the StreamOperatorEvents 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 Action

type Action string

Action defines model for Action.

const (
	Approve Action = "approve"
	Deny    Action = "deny"
	Revoke  Action = "revoke"
)

Defines values for Action.

func (Action) Valid

func (e Action) Valid() bool

Valid indicates whether the value is a known member of the Action enum.

type ApprovalBounds

type ApprovalBounds struct {
	MaxDurationSeconds int                    `json:"max_duration_seconds"`
	MaxUses            nullable.Nullable[int] `json:"max_uses"`
}

ApprovalBounds defines model for ApprovalBounds.

type BrokerEvent

type BrokerEvent struct {
	Cursor     string          `json:"cursor"`
	Kind       BrokerEventKind `json:"kind"`
	OccurredAt time.Time       `json:"occurred_at"`
	RequestId  string          `json:"request_id"`
	Revision   int             `json:"revision"`
	Status     Status          `json:"status"`
	UsedCount  int             `json:"used_count"`
}

BrokerEvent defines model for BrokerEvent.

type BrokerEventKind

type BrokerEventKind string

BrokerEventKind defines model for BrokerEvent.Kind.

const (
	ExecutionAmbiguous BrokerEventKind = "execution.ambiguous"
	ExecutionFailed    BrokerEventKind = "execution.failed"
	ExecutionSucceeded BrokerEventKind = "execution.succeeded"
	GrantConsumed      BrokerEventKind = "grant.consumed"
	GrantReleased      BrokerEventKind = "grant.released"
	GrantReserved      BrokerEventKind = "grant.reserved"
	GrantRevoked       BrokerEventKind = "grant.revoked"
	RequestApproved    BrokerEventKind = "request.approved"
	RequestCanceled    BrokerEventKind = "request.canceled"
	RequestCreated     BrokerEventKind = "request.created"
	RequestDenied      BrokerEventKind = "request.denied"
	RequestExpired     BrokerEventKind = "request.expired"
)

Defines values for BrokerEventKind.

func (BrokerEventKind) Valid

func (e BrokerEventKind) Valid() bool

Valid indicates whether the value is a known member of the BrokerEventKind enum.

type BrokerRequest

type BrokerRequest struct {
	ActiveExpiresAt          *time.Time             `json:"active_expires_at,omitempty"`
	AllowedActions           []Action               `json:"allowed_actions"`
	ApprovalBounds           *ApprovalBounds        `json:"approval_bounds,omitempty"`
	DecidedAt                *time.Time             `json:"decided_at,omitempty"`
	DecidedBy                *string                `json:"decided_by,omitempty"`
	DecidedOnBehalfOf        *string                `json:"decided_on_behalf_of,omitempty"`
	GrantedMaxUses           nullable.Nullable[int] `json:"granted_max_uses"`
	Id                       string                 `json:"id"`
	Operation                string                 `json:"operation"`
	PendingExpiresAt         *time.Time             `json:"pending_expires_at,omitempty"`
	Presentation             Presentation           `json:"presentation"`
	PresentationUnavailable  *bool                  `json:"presentation_unavailable,omitempty"`
	RequestReason            *string                `json:"request_reason,omitempty"`
	RequestedAt              time.Time              `json:"requested_at"`
	RequestedDurationSeconds int                    `json:"requested_duration_seconds"`
	RequestedMaxUses         nullable.Nullable[int] `json:"requested_max_uses"`
	Requester                string                 `json:"requester"`
	Revision                 int                    `json:"revision"`
	Status                   Status                 `json:"status"`
	UsedCount                int                    `json:"used_count"`
}

BrokerRequest defines model for BrokerRequest.

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) DecideOperatorRequest

func (c *Client) DecideOperatorRequest(ctx context.Context, id RequestID, action Action, body DecideOperatorRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

DecideOperatorRequest performs a POST /api/operator/v1/requests/{id}/{action} (the `DecideOperatorRequest` operationId) request. Takes a body of the `application/json` content type.

func (*Client) DecideOperatorRequestWithBody

func (c *Client) DecideOperatorRequestWithBody(ctx context.Context, id RequestID, action Action, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

DecideOperatorRequestWithBody performs a POST /api/operator/v1/requests/{id}/{action} (the `DecideOperatorRequest` operationId) request, with any type of body and a specified content type.

func (*Client) DiscoverOperator

func (c *Client) DiscoverOperator(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

DiscoverOperator performs a GET /.well-known/brokerkit-operator (the `DiscoverOperator` operationId) request.

func (*Client) GetOperatorRequest

func (c *Client) GetOperatorRequest(ctx context.Context, id RequestID, reqEditors ...RequestEditorFn) (*http.Response, error)

GetOperatorRequest performs a GET /api/operator/v1/requests/{id} (the `GetOperatorRequest` operationId) request.

func (*Client) ListOperatorRequests

func (c *Client) ListOperatorRequests(ctx context.Context, params *ListOperatorRequestsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListOperatorRequests performs a GET /api/operator/v1/requests (the `ListOperatorRequests` operationId) request.

Target fields use additional bounded query names with the target. prefix.

func (*Client) OperatorHealth

func (c *Client) OperatorHealth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

OperatorHealth performs a GET /healthz (the `OperatorHealth` operationId) request.

func (*Client) OperatorReady

func (c *Client) OperatorReady(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

OperatorReady performs a GET /readyz (the `OperatorReady` operationId) request.

func (*Client) StreamOperatorEvents

func (c *Client) StreamOperatorEvents(ctx context.Context, params *StreamOperatorEventsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

StreamOperatorEvents performs a GET /api/operator/v1/events (the `StreamOperatorEvents` operationId) request.

type ClientInterface

type ClientInterface interface {

	// DiscoverOperator performs a GET /.well-known/brokerkit-operator (the `DiscoverOperator` operationId) request.
	DiscoverOperator(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// StreamOperatorEvents performs a GET /api/operator/v1/events (the `StreamOperatorEvents` operationId) request.
	StreamOperatorEvents(ctx context.Context, params *StreamOperatorEventsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListOperatorRequests performs a GET /api/operator/v1/requests (the `ListOperatorRequests` operationId) request.
	//
	// Target fields use additional bounded query names with the target. prefix.
	ListOperatorRequests(ctx context.Context, params *ListOperatorRequestsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetOperatorRequest performs a GET /api/operator/v1/requests/{id} (the `GetOperatorRequest` operationId) request.
	GetOperatorRequest(ctx context.Context, id RequestID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DecideOperatorRequestWithBody performs a POST /api/operator/v1/requests/{id}/{action} (the `DecideOperatorRequest` operationId) request,
	// with any type of body and a specified content type.
	DecideOperatorRequestWithBody(ctx context.Context, id RequestID, action Action, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DecideOperatorRequest performs a POST /api/operator/v1/requests/{id}/{action} (the `DecideOperatorRequest` operationId) request.
	// Takes a body of the `application/json` content type.
	DecideOperatorRequest(ctx context.Context, id RequestID, action Action, body DecideOperatorRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// OperatorHealth performs a GET /healthz (the `OperatorHealth` operationId) request.
	OperatorHealth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// OperatorReady performs a GET /readyz (the `OperatorReady` operationId) request.
	OperatorReady(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

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) DecideOperatorRequestWithBodyWithResponse

func (c *ClientWithResponses) DecideOperatorRequestWithBodyWithResponse(ctx context.Context, id RequestID, action Action, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DecideOperatorRequestResponse, error)

DecideOperatorRequestWithBodyWithResponse performs a POST /api/operator/v1/requests/{id}/{action} (the `DecideOperatorRequest` 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) DecideOperatorRequestWithResponse

func (c *ClientWithResponses) DecideOperatorRequestWithResponse(ctx context.Context, id RequestID, action Action, body DecideOperatorRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*DecideOperatorRequestResponse, error)

DecideOperatorRequestWithResponse performs a POST /api/operator/v1/requests/{id}/{action} (the `DecideOperatorRequest` 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) DiscoverOperatorWithResponse

func (c *ClientWithResponses) DiscoverOperatorWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*DiscoverOperatorResponse, error)

DiscoverOperatorWithResponse performs a GET /.well-known/brokerkit-operator (the `DiscoverOperator` operationId) request.

Returns a wrapper object for the known response body format(s).

func (*ClientWithResponses) GetOperatorRequestWithResponse

func (c *ClientWithResponses) GetOperatorRequestWithResponse(ctx context.Context, id RequestID, reqEditors ...RequestEditorFn) (*GetOperatorRequestResponse, error)

GetOperatorRequestWithResponse performs a GET /api/operator/v1/requests/{id} (the `GetOperatorRequest` operationId) request.

Returns a wrapper object for the known response body format(s).

func (*ClientWithResponses) ListOperatorRequestsWithResponse

func (c *ClientWithResponses) ListOperatorRequestsWithResponse(ctx context.Context, params *ListOperatorRequestsParams, reqEditors ...RequestEditorFn) (*ListOperatorRequestsResponse, error)

ListOperatorRequestsWithResponse performs a GET /api/operator/v1/requests (the `ListOperatorRequests` operationId) request.

Target fields use additional bounded query names with the target. prefix.

Returns a wrapper object for the known response body format(s).

func (*ClientWithResponses) OperatorHealthWithResponse

func (c *ClientWithResponses) OperatorHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*OperatorHealthResponse, error)

OperatorHealthWithResponse performs a GET /healthz (the `OperatorHealth` operationId) request.

Returns a wrapper object for the known response body format(s).

func (*ClientWithResponses) OperatorReadyWithResponse

func (c *ClientWithResponses) OperatorReadyWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*OperatorReadyResponse, error)

OperatorReadyWithResponse performs a GET /readyz (the `OperatorReady` operationId) request.

Returns a wrapper object for the known response body format(s).

func (*ClientWithResponses) StreamOperatorEventsWithResponse

func (c *ClientWithResponses) StreamOperatorEventsWithResponse(ctx context.Context, params *StreamOperatorEventsParams, reqEditors ...RequestEditorFn) (*StreamOperatorEventsResponse, error)

StreamOperatorEventsWithResponse performs a GET /api/operator/v1/events (the `StreamOperatorEvents` operationId) request.

Returns a wrapper object for the known response body format(s).

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {

	// DiscoverOperatorWithResponse performs a GET /.well-known/brokerkit-operator (the `DiscoverOperator` operationId) request.
	//
	// Returns a wrapper object for the known response body format(s).
	DiscoverOperatorWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*DiscoverOperatorResponse, error)

	// StreamOperatorEventsWithResponse performs a GET /api/operator/v1/events (the `StreamOperatorEvents` operationId) request.
	//
	// Returns a wrapper object for the known response body format(s).
	StreamOperatorEventsWithResponse(ctx context.Context, params *StreamOperatorEventsParams, reqEditors ...RequestEditorFn) (*StreamOperatorEventsResponse, error)

	// ListOperatorRequestsWithResponse performs a GET /api/operator/v1/requests (the `ListOperatorRequests` operationId) request.
	//
	// Target fields use additional bounded query names with the target. prefix.
	//
	// Returns a wrapper object for the known response body format(s).
	ListOperatorRequestsWithResponse(ctx context.Context, params *ListOperatorRequestsParams, reqEditors ...RequestEditorFn) (*ListOperatorRequestsResponse, error)

	// GetOperatorRequestWithResponse performs a GET /api/operator/v1/requests/{id} (the `GetOperatorRequest` operationId) request.
	//
	// Returns a wrapper object for the known response body format(s).
	GetOperatorRequestWithResponse(ctx context.Context, id RequestID, reqEditors ...RequestEditorFn) (*GetOperatorRequestResponse, error)

	// DecideOperatorRequestWithBodyWithResponse performs a POST /api/operator/v1/requests/{id}/{action} (the `DecideOperatorRequest` operationId) request,
	// with any type of body and a specified content type.
	//
	// Returns a wrapper object for the known response body format(s).
	DecideOperatorRequestWithBodyWithResponse(ctx context.Context, id RequestID, action Action, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DecideOperatorRequestResponse, error)

	// DecideOperatorRequestWithResponse performs a POST /api/operator/v1/requests/{id}/{action} (the `DecideOperatorRequest` operationId) request.
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	DecideOperatorRequestWithResponse(ctx context.Context, id RequestID, action Action, body DecideOperatorRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*DecideOperatorRequestResponse, error)

	// OperatorHealthWithResponse performs a GET /healthz (the `OperatorHealth` operationId) request.
	//
	// Returns a wrapper object for the known response body format(s).
	OperatorHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*OperatorHealthResponse, error)

	// OperatorReadyWithResponse performs a GET /readyz (the `OperatorReady` operationId) request.
	//
	// Returns a wrapper object for the known response body format(s).
	OperatorReadyWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*OperatorReadyResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type Constraints

type Constraints struct {
	DurationSeconds *int                   `json:"duration_seconds,omitempty"`
	MaxUses         nullable.Nullable[int] `json:"max_uses,omitempty"`
}

Constraints defines model for Constraints.

type DecideOperatorRequestJSONRequestBody

type DecideOperatorRequestJSONRequestBody = Decision

DecideOperatorRequestJSONRequestBody defines body for DecideOperatorRequest for application/json ContentType.

type DecideOperatorRequestResponse

type DecideOperatorRequestResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *BrokerRequest
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *ErrorResponse
}

func ParseDecideOperatorRequestResponse

func ParseDecideOperatorRequestResponse(rsp *http.Response) (*DecideOperatorRequestResponse, error)

ParseDecideOperatorRequestResponse parses an HTTP response from a DecideOperatorRequestWithResponse call

func (DecideOperatorRequestResponse) ContentType

func (r DecideOperatorRequestResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (DecideOperatorRequestResponse) GetBody

func (r DecideOperatorRequestResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (DecideOperatorRequestResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (DecideOperatorRequestResponse) GetJSONDefault

func (r DecideOperatorRequestResponse) GetJSONDefault() *ErrorResponse

GetJSONDefault returns the response for an HTTP default `application/json` response

func (DecideOperatorRequestResponse) Status

Status returns HTTPResponse.Status

func (DecideOperatorRequestResponse) StatusCode

func (r DecideOperatorRequestResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Decision

type Decision struct {
	Constraints      *Constraints `json:"constraints,omitempty"`
	ExpectedRevision int          `json:"expected_revision"`
	IdempotencyKey   string       `json:"idempotency_key"`
	OnBehalfOf       *string      `json:"on_behalf_of,omitempty"`
}

Decision defines model for Decision.

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 (
	BrokerkitIooperatorv1 DescriptorApiVersion = "brokerkit.io/operator/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 DiscoverOperatorResponse

type DiscoverOperatorResponse 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 ParseDiscoverOperatorResponse

func ParseDiscoverOperatorResponse(rsp *http.Response) (*DiscoverOperatorResponse, error)

ParseDiscoverOperatorResponse parses an HTTP response from a DiscoverOperatorWithResponse call

func (DiscoverOperatorResponse) ContentType

func (r DiscoverOperatorResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (DiscoverOperatorResponse) GetBody

func (r DiscoverOperatorResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (DiscoverOperatorResponse) GetJSON200

func (r DiscoverOperatorResponse) GetJSON200() *Descriptor

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (DiscoverOperatorResponse) GetJSONDefault

func (r DiscoverOperatorResponse) GetJSONDefault() *ErrorResponse

GetJSONDefault returns the response for an HTTP default `application/json` response

func (DiscoverOperatorResponse) Status

func (r DiscoverOperatorResponse) Status() string

Status returns HTTPResponse.Status

func (DiscoverOperatorResponse) StatusCode

func (r DiscoverOperatorResponse) 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 Error

type Error struct {
	Code          ErrorCode      `json:"code"`
	CorrelationId string         `json:"correlation_id"`
	Current       *BrokerRequest `json:"current,omitempty"`
	Message       string         `json:"message"`
}

Error defines model for Error.

type ErrorCode

type ErrorCode string

ErrorCode defines model for Error.Code.

const (
	ConstraintExceeded     ErrorCode = "constraint_exceeded"
	CursorExpired          ErrorCode = "cursor_expired"
	Forbidden              ErrorCode = "forbidden"
	IdempotencyConflict    ErrorCode = "idempotency_conflict"
	InternalError          ErrorCode = "internal_error"
	InvalidRequest         ErrorCode = "invalid_request"
	InvalidTransition      ErrorCode = "invalid_transition"
	MethodNotAllowed       ErrorCode = "method_not_allowed"
	NotFound               ErrorCode = "not_found"
	RevisionConflict       ErrorCode = "revision_conflict"
	TemporarilyUnavailable ErrorCode = "temporarily_unavailable"
	Unauthorized           ErrorCode = "unauthorized"
)

Defines values for ErrorCode.

func (ErrorCode) Valid

func (e ErrorCode) Valid() bool

Valid indicates whether the value is a known member of the ErrorCode enum.

type ErrorEnvelope

type ErrorEnvelope struct {
	Error Error `json:"error"`
}

ErrorEnvelope defines model for ErrorEnvelope.

type ErrorResponse

type ErrorResponse = ErrorEnvelope

ErrorResponse defines model for ErrorResponse.

type Fact

type Fact struct {
	Label string `json:"label"`
	Value string `json:"value"`
}

Fact defines model for Fact.

type GetOperatorRequestResponse

type GetOperatorRequestResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *BrokerRequest
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *ErrorResponse
}

func ParseGetOperatorRequestResponse

func ParseGetOperatorRequestResponse(rsp *http.Response) (*GetOperatorRequestResponse, error)

ParseGetOperatorRequestResponse parses an HTTP response from a GetOperatorRequestWithResponse call

func (GetOperatorRequestResponse) ContentType

func (r GetOperatorRequestResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetOperatorRequestResponse) GetBody

func (r GetOperatorRequestResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetOperatorRequestResponse) GetJSON200

func (r GetOperatorRequestResponse) GetJSON200() *BrokerRequest

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetOperatorRequestResponse) GetJSONDefault

func (r GetOperatorRequestResponse) GetJSONDefault() *ErrorResponse

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetOperatorRequestResponse) Status

Status returns HTTPResponse.Status

func (GetOperatorRequestResponse) StatusCode

func (r GetOperatorRequestResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Health

type Health struct {
	Status string `json:"status"`
}

Health defines model for Health.

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type ListOperatorRequestsParams

type ListOperatorRequestsParams struct {
	Status     *StatusGroup `form:"status,omitempty" json:"status,omitempty"`
	Requester  *string      `form:"requester,omitempty" json:"requester,omitempty"`
	Operation  *string      `form:"operation,omitempty" json:"operation,omitempty"`
	TargetKind *string      `form:"target_kind,omitempty" json:"target_kind,omitempty"`
	Cursor     *string      `form:"cursor,omitempty" json:"cursor,omitempty"`
	Limit      *int         `form:"limit,omitempty" json:"limit,omitempty"`
}

ListOperatorRequestsParams defines parameters for ListOperatorRequests.

type ListOperatorRequestsResponse

type ListOperatorRequestsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *RequestPage
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *ErrorResponse
}

func ParseListOperatorRequestsResponse

func ParseListOperatorRequestsResponse(rsp *http.Response) (*ListOperatorRequestsResponse, error)

ParseListOperatorRequestsResponse parses an HTTP response from a ListOperatorRequestsWithResponse call

func (ListOperatorRequestsResponse) ContentType

func (r ListOperatorRequestsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListOperatorRequestsResponse) GetBody

func (r ListOperatorRequestsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListOperatorRequestsResponse) GetJSON200

func (r ListOperatorRequestsResponse) GetJSON200() *RequestPage

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListOperatorRequestsResponse) GetJSONDefault

func (r ListOperatorRequestsResponse) GetJSONDefault() *ErrorResponse

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListOperatorRequestsResponse) Status

Status returns HTTPResponse.Status

func (ListOperatorRequestsResponse) StatusCode

func (r ListOperatorRequestsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type OperatorHealthResponse

type OperatorHealthResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Health
}

func ParseOperatorHealthResponse

func ParseOperatorHealthResponse(rsp *http.Response) (*OperatorHealthResponse, error)

ParseOperatorHealthResponse parses an HTTP response from a OperatorHealthWithResponse call

func (OperatorHealthResponse) ContentType

func (r OperatorHealthResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (OperatorHealthResponse) GetBody

func (r OperatorHealthResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (OperatorHealthResponse) GetJSON200

func (r OperatorHealthResponse) GetJSON200() *Health

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (OperatorHealthResponse) Status

func (r OperatorHealthResponse) Status() string

Status returns HTTPResponse.Status

func (OperatorHealthResponse) StatusCode

func (r OperatorHealthResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type OperatorReadyResponse

type OperatorReadyResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Health
	// JSON503 the response for an HTTP 503 `application/json` response
	JSON503 *ErrorResponse
}

func ParseOperatorReadyResponse

func ParseOperatorReadyResponse(rsp *http.Response) (*OperatorReadyResponse, error)

ParseOperatorReadyResponse parses an HTTP response from a OperatorReadyWithResponse call

func (OperatorReadyResponse) ContentType

func (r OperatorReadyResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (OperatorReadyResponse) GetBody

func (r OperatorReadyResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (OperatorReadyResponse) GetJSON200

func (r OperatorReadyResponse) GetJSON200() *Health

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (OperatorReadyResponse) GetJSON503

func (r OperatorReadyResponse) GetJSON503() *ErrorResponse

GetJSON503 returns the response for an HTTP 503 `application/json` response

func (OperatorReadyResponse) Status

func (r OperatorReadyResponse) Status() string

Status returns HTTPResponse.Status

func (OperatorReadyResponse) StatusCode

func (r OperatorReadyResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Presentation

type Presentation struct {
	Facts   *[]Fact          `json:"facts,omitempty"`
	Risk    PresentationRisk `json:"risk"`
	Summary *string          `json:"summary,omitempty"`
	Title   string           `json:"title"`
}

Presentation defines model for Presentation.

type PresentationRisk

type PresentationRisk string

PresentationRisk defines model for Presentation.Risk.

const (
	Critical PresentationRisk = "critical"
	High     PresentationRisk = "high"
	Low      PresentationRisk = "low"
	Medium   PresentationRisk = "medium"
	Unknown  PresentationRisk = "unknown"
)

Defines values for PresentationRisk.

func (PresentationRisk) Valid

func (e PresentationRisk) Valid() bool

Valid indicates whether the value is a known member of the PresentationRisk enum.

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

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type RequestID

type RequestID = string

RequestID defines model for RequestID.

type RequestPage

type RequestPage struct {
	EventCursor *string         `json:"event_cursor,omitempty"`
	NextCursor  *string         `json:"next_cursor,omitempty"`
	Requests    []BrokerRequest `json:"requests"`
}

RequestPage defines model for RequestPage.

type ServerInterface

type ServerInterface interface {

	// (GET /.well-known/brokerkit-operator)
	DiscoverOperator(ctx echo.Context) error

	// (GET /api/operator/v1/events)
	StreamOperatorEvents(ctx echo.Context, params StreamOperatorEventsParams) error

	// (GET /api/operator/v1/requests)
	ListOperatorRequests(ctx echo.Context, params ListOperatorRequestsParams) error

	// (GET /api/operator/v1/requests/{id})
	GetOperatorRequest(ctx echo.Context, id RequestID) error

	// (POST /api/operator/v1/requests/{id}/{action})
	DecideOperatorRequest(ctx echo.Context, id RequestID, action Action) error

	// (GET /healthz)
	OperatorHealth(ctx echo.Context) error

	// (GET /readyz)
	OperatorReady(ctx echo.Context) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) DecideOperatorRequest

func (w *ServerInterfaceWrapper) DecideOperatorRequest(ctx echo.Context) error

DecideOperatorRequest converts echo context to params.

func (*ServerInterfaceWrapper) DiscoverOperator

func (w *ServerInterfaceWrapper) DiscoverOperator(ctx echo.Context) error

DiscoverOperator converts echo context to params.

func (*ServerInterfaceWrapper) GetOperatorRequest

func (w *ServerInterfaceWrapper) GetOperatorRequest(ctx echo.Context) error

GetOperatorRequest converts echo context to params.

func (*ServerInterfaceWrapper) ListOperatorRequests

func (w *ServerInterfaceWrapper) ListOperatorRequests(ctx echo.Context) error

ListOperatorRequests converts echo context to params.

func (*ServerInterfaceWrapper) OperatorHealth

func (w *ServerInterfaceWrapper) OperatorHealth(ctx echo.Context) error

OperatorHealth converts echo context to params.

func (*ServerInterfaceWrapper) OperatorReady

func (w *ServerInterfaceWrapper) OperatorReady(ctx echo.Context) error

OperatorReady converts echo context to params.

func (*ServerInterfaceWrapper) StreamOperatorEvents

func (w *ServerInterfaceWrapper) StreamOperatorEvents(ctx echo.Context) error

StreamOperatorEvents converts echo context to params.

type Status

type Status string

Status defines model for Status.

const (
	StatusActive   Status = "active"
	StatusCanceled Status = "canceled"
	StatusConsumed Status = "consumed"
	StatusDenied   Status = "denied"
	StatusExpired  Status = "expired"
	StatusPending  Status = "pending"
	StatusRevoked  Status = "revoked"
)

Defines values for Status.

func (Status) Valid

func (e Status) Valid() bool

Valid indicates whether the value is a known member of the Status enum.

type StatusGroup

type StatusGroup string

StatusGroup defines model for StatusGroup.

const (
	StatusGroupActive  StatusGroup = "active"
	StatusGroupAll     StatusGroup = "all"
	StatusGroupHistory StatusGroup = "history"
	StatusGroupPending StatusGroup = "pending"
)

Defines values for StatusGroup.

func (StatusGroup) Valid

func (e StatusGroup) Valid() bool

Valid indicates whether the value is a known member of the StatusGroup enum.

type StreamOperatorEventsParams

type StreamOperatorEventsParams struct {
	Cursor      *string `form:"cursor,omitempty" json:"cursor,omitempty"`
	LastEventID *string `json:"Last-Event-ID,omitempty"`
}

StreamOperatorEventsParams defines parameters for StreamOperatorEvents.

type StreamOperatorEventsResponse

type StreamOperatorEventsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *ErrorResponse
}

func ParseStreamOperatorEventsResponse

func ParseStreamOperatorEventsResponse(rsp *http.Response) (*StreamOperatorEventsResponse, error)

ParseStreamOperatorEventsResponse parses an HTTP response from a StreamOperatorEventsWithResponse call

func (StreamOperatorEventsResponse) ContentType

func (r StreamOperatorEventsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (StreamOperatorEventsResponse) GetBody

func (r StreamOperatorEventsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (StreamOperatorEventsResponse) GetJSONDefault

func (r StreamOperatorEventsResponse) GetJSONDefault() *ErrorResponse

GetJSONDefault returns the response for an HTTP default `application/json` response

func (StreamOperatorEventsResponse) Status

Status returns HTTPResponse.Status

func (StreamOperatorEventsResponse) StatusCode

func (r StreamOperatorEventsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type UIRequest

type UIRequest struct {
	Handle      string        `json:"handle"`
	Request     BrokerRequest `json:"request"`
	SourceId    string        `json:"source_id"`
	SourceLabel string        `json:"source_label"`
}

UIRequest defines model for UIRequest.

type UISnapshot

type UISnapshot struct {
	ApiVersion       UISnapshotApiVersion `json:"api_version"`
	Cursor           string               `json:"cursor"`
	DeliveryFailures *int                 `json:"delivery_failures,omitempty"`
	Requests         []UIRequest          `json:"requests"`
	Sources          []UISourceHealth     `json:"sources"`
	SynchronizedAt   time.Time            `json:"synchronized_at"`
}

UISnapshot defines model for UISnapshot.

type UISnapshotApiVersion

type UISnapshotApiVersion string

UISnapshotApiVersion defines model for UISnapshot.ApiVersion.

const (
	UISnapshotApiVersionBrokerkitIooperatorUiv1 UISnapshotApiVersion = "brokerkit.io/operator-ui/v1"
)

Defines values for UISnapshotApiVersion.

func (UISnapshotApiVersion) Valid

func (e UISnapshotApiVersion) Valid() bool

Valid indicates whether the value is a known member of the UISnapshotApiVersion enum.

type UISnapshotEvent

type UISnapshotEvent struct {
	ApiVersion UISnapshotEventApiVersion `json:"api_version"`
	Changed    bool                      `json:"changed"`
	Cursor     string                    `json:"cursor"`
}

UISnapshotEvent defines model for UISnapshotEvent.

type UISnapshotEventApiVersion

type UISnapshotEventApiVersion string

UISnapshotEventApiVersion defines model for UISnapshotEvent.ApiVersion.

const (
	UISnapshotEventApiVersionBrokerkitIooperatorUiv1 UISnapshotEventApiVersion = "brokerkit.io/operator-ui/v1"
)

Defines values for UISnapshotEventApiVersion.

func (UISnapshotEventApiVersion) Valid

func (e UISnapshotEventApiVersion) Valid() bool

Valid indicates whether the value is a known member of the UISnapshotEventApiVersion enum.

type UISourceHealth

type UISourceHealth struct {
	Error      *string    `json:"error,omitempty"`
	Healthy    bool       `json:"healthy"`
	Id         string     `json:"id"`
	Label      string     `json:"label"`
	LastSyncAt *time.Time `json:"last_sync_at,omitempty"`
}

UISourceHealth defines model for UISourceHealth.

type UISummary

type UISummary struct {
	ApiVersion UISummaryApiVersion `json:"api_version"`
	Cursor     string              `json:"cursor"`
	Healthy    bool                `json:"healthy"`
	Pending    int                 `json:"pending"`
}

UISummary defines model for UISummary.

type UISummaryApiVersion

type UISummaryApiVersion string

UISummaryApiVersion defines model for UISummary.ApiVersion.

const (
	UISummaryApiVersionBrokerkitIooperatorUiv1 UISummaryApiVersion = "brokerkit.io/operator-ui/v1"
)

Defines values for UISummaryApiVersion.

func (UISummaryApiVersion) Valid

func (e UISummaryApiVersion) Valid() bool

Valid indicates whether the value is a known member of the UISummaryApiVersion enum.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL