Documentation
¶
Overview ¶
Package v1 provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
Index ¶
- Constants
- func NewGetAddressBookRequest(server string) (*http.Request, error)
- func NewGetPeerDiagnosticsRequest(server string) (*http.Request, error)
- func NewGetTransactionPayloadRequest(server string, ref string) (*http.Request, error)
- func NewGetTransactionRequest(server string, ref string) (*http.Request, error)
- func NewListEventsRequest(server string) (*http.Request, error)
- func NewListTransactionsRequest(server string, params *ListTransactionsParams) (*http.Request, error)
- func NewRenderGraphRequest(server string, params *RenderGraphParams) (*http.Request, error)
- func NewReprocessRequest(server string, params *ReprocessParams) (*http.Request, error)
- func RegisterHandlers(router EchoRouter, si ServerInterface)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
- type Client
- func (c *Client) GetAddressBook(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetPeerDiagnostics(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetTransaction(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetTransactionPayload(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListEvents(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListTransactions(ctx context.Context, params *ListTransactionsParams, ...) (*http.Response, error)
- func (c *Client) RenderGraph(ctx context.Context, params *RenderGraphParams, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) Reprocess(ctx context.Context, params *ReprocessParams, reqEditors ...RequestEditorFn) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) GetAddressBookWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAddressBookResponse, error)
- func (c *ClientWithResponses) GetPeerDiagnosticsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetPeerDiagnosticsResponse, error)
- func (c *ClientWithResponses) GetTransactionPayloadWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetTransactionPayloadResponse, error)
- func (c *ClientWithResponses) GetTransactionWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetTransactionResponse, error)
- func (c *ClientWithResponses) ListEventsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListEventsResponse, error)
- func (c *ClientWithResponses) ListTransactionsWithResponse(ctx context.Context, params *ListTransactionsParams, ...) (*ListTransactionsResponse, error)
- func (c *ClientWithResponses) RenderGraphWithResponse(ctx context.Context, params *RenderGraphParams, reqEditors ...RequestEditorFn) (*RenderGraphResponse, error)
- func (c *ClientWithResponses) ReprocessWithResponse(ctx context.Context, params *ReprocessParams, reqEditors ...RequestEditorFn) (*ReprocessResponse, error)
- type ClientWithResponsesInterface
- type Contact
- type EchoRouter
- type Event
- type EventSubscriber
- type GetAddressBook200JSONResponse
- type GetAddressBookRequestObject
- type GetAddressBookResponse
- type GetAddressBookResponseObject
- type GetPeerDiagnostics200JSONResponse
- type GetPeerDiagnosticsRequestObject
- type GetPeerDiagnosticsResponse
- type GetPeerDiagnosticsResponseObject
- type GetPeerDiagnosticsdefaultApplicationProblemPlusJSONResponse
- type GetTransaction200ApplicationjoseResponse
- type GetTransactionPayload200ApplicationoctetStreamResponse
- type GetTransactionPayloadRequestObject
- type GetTransactionPayloadResponse
- type GetTransactionPayloadResponseObject
- type GetTransactionPayloaddefaultApplicationProblemPlusJSONResponse
- type GetTransactionRequestObject
- type GetTransactionResponse
- type GetTransactionResponseObject
- type GetTransactiondefaultApplicationProblemPlusJSONResponse
- type HTTPClient
- func (hb HTTPClient) GetPeerDiagnostics() (map[transport.PeerID]PeerDiagnostics, error)
- func (hb HTTPClient) GetTransaction(transactionRef hash.SHA256Hash) (dag.Transaction, error)
- func (hb HTTPClient) GetTransactionPayload(transactionRef hash.SHA256Hash) ([]byte, error)
- func (hb HTTPClient) ListTransactions(params *ListTransactionsParams) ([]dag.Transaction, error)
- func (hb HTTPClient) Reprocess(contentType string) error
- type HttpRequestDoer
- type ListEvents200JSONResponse
- type ListEventsRequestObject
- type ListEventsResponse
- type ListEventsResponseObject
- type ListEventsdefaultApplicationProblemPlusJSONResponse
- type ListTransactions200JSONResponse
- type ListTransactionsParams
- type ListTransactionsRequestObject
- type ListTransactionsResponse
- type ListTransactionsResponseObject
- type ListTransactionsdefaultApplicationProblemPlusJSONResponse
- type PeerDiagnostics
- type RenderGraph200TextvndGraphvizResponse
- type RenderGraphParams
- type RenderGraphRequestObject
- type RenderGraphResponse
- type RenderGraphResponseObject
- type RenderGraphdefaultApplicationProblemPlusJSONResponse
- type Reprocess202Response
- type ReprocessParams
- type ReprocessRequestObject
- type ReprocessResponse
- type ReprocessResponseObject
- type RequestEditorFn
- type ServerInterface
- type ServerInterfaceWrapper
- func (w *ServerInterfaceWrapper) GetAddressBook(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetPeerDiagnostics(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetTransaction(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetTransactionPayload(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) ListEvents(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) ListTransactions(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) RenderGraph(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) Reprocess(ctx echo.Context) error
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type Wrapper
- func (a *Wrapper) GetAddressBook(_ context.Context, _ GetAddressBookRequestObject) (GetAddressBookResponseObject, error)
- func (a *Wrapper) GetPeerDiagnostics(_ context.Context, _ GetPeerDiagnosticsRequestObject) (GetPeerDiagnosticsResponseObject, error)
- func (a *Wrapper) GetTransaction(_ context.Context, request GetTransactionRequestObject) (GetTransactionResponseObject, error)
- func (a *Wrapper) GetTransactionPayload(_ context.Context, request GetTransactionPayloadRequestObject) (GetTransactionPayloadResponseObject, error)
- func (a Wrapper) ListEvents(_ context.Context, _ ListEventsRequestObject) (ListEventsResponseObject, error)
- func (a *Wrapper) ListTransactions(_ context.Context, request ListTransactionsRequestObject) (ListTransactionsResponseObject, error)
- func (a Wrapper) RenderGraph(_ context.Context, request RenderGraphRequestObject) (RenderGraphResponseObject, error)
- func (a Wrapper) Reprocess(_ context.Context, request ReprocessRequestObject) (ReprocessResponseObject, error)
- func (a *Wrapper) Routes(router core.EchoRouter)
Constants ¶
const (
JwtBearerAuthScopes = "jwtBearerAuth.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
func NewGetAddressBookRequest ¶
NewGetAddressBookRequest generates requests for GetAddressBook
func NewGetPeerDiagnosticsRequest ¶
NewGetPeerDiagnosticsRequest generates requests for GetPeerDiagnostics
func NewGetTransactionPayloadRequest ¶
NewGetTransactionPayloadRequest generates requests for GetTransactionPayload
func NewGetTransactionRequest ¶
NewGetTransactionRequest generates requests for GetTransaction
func NewListEventsRequest ¶
NewListEventsRequest generates requests for ListEvents
func NewListTransactionsRequest ¶
func NewListTransactionsRequest(server string, params *ListTransactionsParams) (*http.Request, error)
NewListTransactionsRequest generates requests for ListTransactions
func NewRenderGraphRequest ¶
func NewRenderGraphRequest(server string, params *RenderGraphParams) (*http.Request, error)
NewRenderGraphRequest generates requests for RenderGraph
func NewReprocessRequest ¶
func NewReprocessRequest(server string, params *ReprocessParams) (*http.Request, error)
NewReprocessRequest generates requests for Reprocess
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)
Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.
Types ¶
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) GetAddressBook ¶
func (*Client) GetPeerDiagnostics ¶
func (*Client) GetTransaction ¶
func (*Client) GetTransactionPayload ¶
func (*Client) ListEvents ¶
func (*Client) ListTransactions ¶
func (c *Client) ListTransactions(ctx context.Context, params *ListTransactionsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) RenderGraph ¶
func (c *Client) RenderGraph(ctx context.Context, params *RenderGraphParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) Reprocess ¶
func (c *Client) Reprocess(ctx context.Context, params *ReprocessParams, reqEditors ...RequestEditorFn) (*http.Response, error)
type ClientInterface ¶
type ClientInterface interface {
// GetAddressBook request
GetAddressBook(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// RenderGraph request
RenderGraph(ctx context.Context, params *RenderGraphParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetPeerDiagnostics request
GetPeerDiagnostics(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListEvents request
ListEvents(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// Reprocess request
Reprocess(ctx context.Context, params *ReprocessParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListTransactions request
ListTransactions(ctx context.Context, params *ListTransactionsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetTransaction request
GetTransaction(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetTransactionPayload request
GetTransactionPayload(ctx context.Context, ref string, 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) GetAddressBookWithResponse ¶
func (c *ClientWithResponses) GetAddressBookWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAddressBookResponse, error)
GetAddressBookWithResponse request returning *GetAddressBookResponse
func (*ClientWithResponses) GetPeerDiagnosticsWithResponse ¶
func (c *ClientWithResponses) GetPeerDiagnosticsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetPeerDiagnosticsResponse, error)
GetPeerDiagnosticsWithResponse request returning *GetPeerDiagnosticsResponse
func (*ClientWithResponses) GetTransactionPayloadWithResponse ¶
func (c *ClientWithResponses) GetTransactionPayloadWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetTransactionPayloadResponse, error)
GetTransactionPayloadWithResponse request returning *GetTransactionPayloadResponse
func (*ClientWithResponses) GetTransactionWithResponse ¶
func (c *ClientWithResponses) GetTransactionWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetTransactionResponse, error)
GetTransactionWithResponse request returning *GetTransactionResponse
func (*ClientWithResponses) ListEventsWithResponse ¶
func (c *ClientWithResponses) ListEventsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListEventsResponse, error)
ListEventsWithResponse request returning *ListEventsResponse
func (*ClientWithResponses) ListTransactionsWithResponse ¶
func (c *ClientWithResponses) ListTransactionsWithResponse(ctx context.Context, params *ListTransactionsParams, reqEditors ...RequestEditorFn) (*ListTransactionsResponse, error)
ListTransactionsWithResponse request returning *ListTransactionsResponse
func (*ClientWithResponses) RenderGraphWithResponse ¶
func (c *ClientWithResponses) RenderGraphWithResponse(ctx context.Context, params *RenderGraphParams, reqEditors ...RequestEditorFn) (*RenderGraphResponse, error)
RenderGraphWithResponse request returning *RenderGraphResponse
func (*ClientWithResponses) ReprocessWithResponse ¶
func (c *ClientWithResponses) ReprocessWithResponse(ctx context.Context, params *ReprocessParams, reqEditors ...RequestEditorFn) (*ReprocessResponse, error)
ReprocessWithResponse request returning *ReprocessResponse
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// GetAddressBookWithResponse request
GetAddressBookWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAddressBookResponse, error)
// RenderGraphWithResponse request
RenderGraphWithResponse(ctx context.Context, params *RenderGraphParams, reqEditors ...RequestEditorFn) (*RenderGraphResponse, error)
// GetPeerDiagnosticsWithResponse request
GetPeerDiagnosticsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetPeerDiagnosticsResponse, error)
// ListEventsWithResponse request
ListEventsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListEventsResponse, error)
// ReprocessWithResponse request
ReprocessWithResponse(ctx context.Context, params *ReprocessParams, reqEditors ...RequestEditorFn) (*ReprocessResponse, error)
// ListTransactionsWithResponse request
ListTransactionsWithResponse(ctx context.Context, params *ListTransactionsParams, reqEditors ...RequestEditorFn) (*ListTransactionsResponse, error)
// GetTransactionWithResponse request
GetTransactionWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetTransactionResponse, error)
// GetTransactionPayloadWithResponse request
GetTransactionPayloadWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetTransactionPayloadResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type Contact ¶
type Contact struct {
// Address Address of the node.
Address string `json:"address"`
// Attempts Number of connection attempts since the node has (re-)started. It is reset to 0 when the connection succeeds.
Attempts int `json:"attempts"`
// Did DID of the node.
Did *string `json:"did,omitempty"`
// Error Error message of the last connection attempt.
Error *string `json:"error,omitempty"`
// LastAttempt Timestamp of the last attempt to contact the address.
LastAttempt *time.Time `json:"lastAttempt,omitempty"`
// NextAttempt Timestamp of the next attempt to contact the address.
NextAttempt *time.Time `json:"nextAttempt,omitempty"`
}
Contact Describes the contact information of a node.
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 Event ¶
type Event struct {
// Error Lists the last error if the event processing failed due to an error.
Error *string `json:"error,omitempty"`
// Hash Hash is the ID of the Event, usually the same as the transaction reference.
Hash string `json:"hash"`
// LatestNotificationAttempt Timestamp of the most recent notification attempt. Formatted according to RFC3339. Note: calculation of the next attempt does not use this timestamp.
LatestNotificationAttempt *string `json:"latest_notification_attempt,omitempty"`
// Retries Number of times the event has been retried.
Retries int `json:"retries"`
// Transaction The transaction reference
Transaction string `json:"transaction"`
// Type 'transaction' or 'payload'
Type *string `json:"type,omitempty"`
}
Event Non-completed event. An event represents a transaction that is of interest to a specific part of the Nuts node.
type EventSubscriber ¶
type EventSubscriber struct {
Events []Event `json:"events"`
// Name Name of the subscriber component
Name string `json:"name"`
}
EventSubscriber Non-completed events for a subscriber
type GetAddressBook200JSONResponse ¶
type GetAddressBook200JSONResponse []Contact
func (GetAddressBook200JSONResponse) VisitGetAddressBookResponse ¶
func (response GetAddressBook200JSONResponse) VisitGetAddressBookResponse(w http.ResponseWriter) error
type GetAddressBookRequestObject ¶
type GetAddressBookRequestObject struct {
}
type GetAddressBookResponse ¶
func ParseGetAddressBookResponse ¶
func ParseGetAddressBookResponse(rsp *http.Response) (*GetAddressBookResponse, error)
ParseGetAddressBookResponse parses an HTTP response from a GetAddressBookWithResponse call
func (GetAddressBookResponse) Status ¶
func (r GetAddressBookResponse) Status() string
Status returns HTTPResponse.Status
func (GetAddressBookResponse) StatusCode ¶
func (r GetAddressBookResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetAddressBookResponseObject ¶
type GetAddressBookResponseObject interface {
VisitGetAddressBookResponse(w http.ResponseWriter) error
}
type GetPeerDiagnostics200JSONResponse ¶
type GetPeerDiagnostics200JSONResponse map[string]PeerDiagnostics
func (GetPeerDiagnostics200JSONResponse) VisitGetPeerDiagnosticsResponse ¶
func (response GetPeerDiagnostics200JSONResponse) VisitGetPeerDiagnosticsResponse(w http.ResponseWriter) error
type GetPeerDiagnosticsRequestObject ¶
type GetPeerDiagnosticsRequestObject struct {
}
type GetPeerDiagnosticsResponse ¶
type GetPeerDiagnosticsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *map[string]PeerDiagnostics
ApplicationproblemJSONDefault *struct {
// Detail A human-readable explanation specific to this occurrence of the problem.
Detail string `json:"detail"`
// Status HTTP statuscode
Status float32 `json:"status"`
// Title A short, human-readable summary of the problem type.
Title string `json:"title"`
}
}
func ParseGetPeerDiagnosticsResponse ¶
func ParseGetPeerDiagnosticsResponse(rsp *http.Response) (*GetPeerDiagnosticsResponse, error)
ParseGetPeerDiagnosticsResponse parses an HTTP response from a GetPeerDiagnosticsWithResponse call
func (GetPeerDiagnosticsResponse) Status ¶
func (r GetPeerDiagnosticsResponse) Status() string
Status returns HTTPResponse.Status
func (GetPeerDiagnosticsResponse) StatusCode ¶
func (r GetPeerDiagnosticsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetPeerDiagnosticsResponseObject ¶
type GetPeerDiagnosticsResponseObject interface {
VisitGetPeerDiagnosticsResponse(w http.ResponseWriter) error
}
type GetPeerDiagnosticsdefaultApplicationProblemPlusJSONResponse ¶ added in v5.4.40
type GetPeerDiagnosticsdefaultApplicationProblemPlusJSONResponse struct {
Body struct {
// Detail A human-readable explanation specific to this occurrence of the problem.
Detail string `json:"detail"`
// Status HTTP statuscode
Status float32 `json:"status"`
// Title A short, human-readable summary of the problem type.
Title string `json:"title"`
}
StatusCode int
}
func (GetPeerDiagnosticsdefaultApplicationProblemPlusJSONResponse) VisitGetPeerDiagnosticsResponse ¶ added in v5.4.40
func (response GetPeerDiagnosticsdefaultApplicationProblemPlusJSONResponse) VisitGetPeerDiagnosticsResponse(w http.ResponseWriter) error
type GetTransaction200ApplicationjoseResponse ¶
func (GetTransaction200ApplicationjoseResponse) VisitGetTransactionResponse ¶
func (response GetTransaction200ApplicationjoseResponse) VisitGetTransactionResponse(w http.ResponseWriter) error
type GetTransactionPayload200ApplicationoctetStreamResponse ¶
type GetTransactionPayload200ApplicationoctetStreamResponse struct {
Body io.Reader
ContentLength int64
}
func (GetTransactionPayload200ApplicationoctetStreamResponse) VisitGetTransactionPayloadResponse ¶
func (response GetTransactionPayload200ApplicationoctetStreamResponse) VisitGetTransactionPayloadResponse(w http.ResponseWriter) error
type GetTransactionPayloadRequestObject ¶
type GetTransactionPayloadRequestObject struct {
Ref string `json:"ref"`
}
type GetTransactionPayloadResponse ¶
type GetTransactionPayloadResponse struct {
Body []byte
HTTPResponse *http.Response
ApplicationproblemJSONDefault *struct {
// Detail A human-readable explanation specific to this occurrence of the problem.
Detail string `json:"detail"`
// Status HTTP statuscode
Status float32 `json:"status"`
// Title A short, human-readable summary of the problem type.
Title string `json:"title"`
}
}
func ParseGetTransactionPayloadResponse ¶
func ParseGetTransactionPayloadResponse(rsp *http.Response) (*GetTransactionPayloadResponse, error)
ParseGetTransactionPayloadResponse parses an HTTP response from a GetTransactionPayloadWithResponse call
func (GetTransactionPayloadResponse) Status ¶
func (r GetTransactionPayloadResponse) Status() string
Status returns HTTPResponse.Status
func (GetTransactionPayloadResponse) StatusCode ¶
func (r GetTransactionPayloadResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetTransactionPayloadResponseObject ¶
type GetTransactionPayloadResponseObject interface {
VisitGetTransactionPayloadResponse(w http.ResponseWriter) error
}
type GetTransactionPayloaddefaultApplicationProblemPlusJSONResponse ¶ added in v5.4.40
type GetTransactionPayloaddefaultApplicationProblemPlusJSONResponse struct {
Body struct {
// Detail A human-readable explanation specific to this occurrence of the problem.
Detail string `json:"detail"`
// Status HTTP statuscode
Status float32 `json:"status"`
// Title A short, human-readable summary of the problem type.
Title string `json:"title"`
}
StatusCode int
}
func (GetTransactionPayloaddefaultApplicationProblemPlusJSONResponse) VisitGetTransactionPayloadResponse ¶ added in v5.4.40
func (response GetTransactionPayloaddefaultApplicationProblemPlusJSONResponse) VisitGetTransactionPayloadResponse(w http.ResponseWriter) error
type GetTransactionRequestObject ¶
type GetTransactionRequestObject struct {
Ref string `json:"ref"`
}
type GetTransactionResponse ¶
type GetTransactionResponse struct {
Body []byte
HTTPResponse *http.Response
ApplicationproblemJSONDefault *struct {
// Detail A human-readable explanation specific to this occurrence of the problem.
Detail string `json:"detail"`
// Status HTTP statuscode
Status float32 `json:"status"`
// Title A short, human-readable summary of the problem type.
Title string `json:"title"`
}
}
func ParseGetTransactionResponse ¶
func ParseGetTransactionResponse(rsp *http.Response) (*GetTransactionResponse, error)
ParseGetTransactionResponse parses an HTTP response from a GetTransactionWithResponse call
func (GetTransactionResponse) Status ¶
func (r GetTransactionResponse) Status() string
Status returns HTTPResponse.Status
func (GetTransactionResponse) StatusCode ¶
func (r GetTransactionResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetTransactionResponseObject ¶
type GetTransactionResponseObject interface {
VisitGetTransactionResponse(w http.ResponseWriter) error
}
type GetTransactiondefaultApplicationProblemPlusJSONResponse ¶ added in v5.4.40
type GetTransactiondefaultApplicationProblemPlusJSONResponse struct {
Body struct {
// Detail A human-readable explanation specific to this occurrence of the problem.
Detail string `json:"detail"`
// Status HTTP statuscode
Status float32 `json:"status"`
// Title A short, human-readable summary of the problem type.
Title string `json:"title"`
}
StatusCode int
}
func (GetTransactiondefaultApplicationProblemPlusJSONResponse) VisitGetTransactionResponse ¶ added in v5.4.40
func (response GetTransactiondefaultApplicationProblemPlusJSONResponse) VisitGetTransactionResponse(w http.ResponseWriter) error
type HTTPClient ¶
type HTTPClient struct {
core.ClientConfig
TokenGenerator core.AuthorizationTokenGenerator
}
HTTPClient holds the server address and other basic settings for the http client
func (HTTPClient) GetPeerDiagnostics ¶
func (hb HTTPClient) GetPeerDiagnostics() (map[transport.PeerID]PeerDiagnostics, error)
GetPeerDiagnostics retrieves diagnostic information on the node's peers.
func (HTTPClient) GetTransaction ¶
func (hb HTTPClient) GetTransaction(transactionRef hash.SHA256Hash) (dag.Transaction, error)
GetTransaction retrieves the transaction for the given reference. If the transaction is not known, an error is returned.
func (HTTPClient) GetTransactionPayload ¶
func (hb HTTPClient) GetTransactionPayload(transactionRef hash.SHA256Hash) ([]byte, error)
GetTransactionPayload retrieves the transaction payload for the given transaction. If the transaction or payload is not found nil is returned.
func (HTTPClient) ListTransactions ¶
func (hb HTTPClient) ListTransactions(params *ListTransactionsParams) ([]dag.Transaction, error)
ListTransactions returns all transactions known to this network instance. TODO: This is potentially an expensive operation without pagination
func (HTTPClient) Reprocess ¶
func (hb HTTPClient) Reprocess(contentType string) error
Reprocess triggers reprocessing of transactions with the given content type
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type ListEvents200JSONResponse ¶
type ListEvents200JSONResponse []EventSubscriber
func (ListEvents200JSONResponse) VisitListEventsResponse ¶
func (response ListEvents200JSONResponse) VisitListEventsResponse(w http.ResponseWriter) error
type ListEventsRequestObject ¶
type ListEventsRequestObject struct {
}
type ListEventsResponse ¶
type ListEventsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]EventSubscriber
ApplicationproblemJSONDefault *struct {
// Detail A human-readable explanation specific to this occurrence of the problem.
Detail string `json:"detail"`
// Status HTTP statuscode
Status float32 `json:"status"`
// Title A short, human-readable summary of the problem type.
Title string `json:"title"`
}
}
func ParseListEventsResponse ¶
func ParseListEventsResponse(rsp *http.Response) (*ListEventsResponse, error)
ParseListEventsResponse parses an HTTP response from a ListEventsWithResponse call
func (ListEventsResponse) Status ¶
func (r ListEventsResponse) Status() string
Status returns HTTPResponse.Status
func (ListEventsResponse) StatusCode ¶
func (r ListEventsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ListEventsResponseObject ¶
type ListEventsResponseObject interface {
VisitListEventsResponse(w http.ResponseWriter) error
}
type ListEventsdefaultApplicationProblemPlusJSONResponse ¶ added in v5.4.40
type ListEventsdefaultApplicationProblemPlusJSONResponse struct {
Body struct {
// Detail A human-readable explanation specific to this occurrence of the problem.
Detail string `json:"detail"`
// Status HTTP statuscode
Status float32 `json:"status"`
// Title A short, human-readable summary of the problem type.
Title string `json:"title"`
}
StatusCode int
}
func (ListEventsdefaultApplicationProblemPlusJSONResponse) VisitListEventsResponse ¶ added in v5.4.40
func (response ListEventsdefaultApplicationProblemPlusJSONResponse) VisitListEventsResponse(w http.ResponseWriter) error
type ListTransactions200JSONResponse ¶
type ListTransactions200JSONResponse []string
func (ListTransactions200JSONResponse) VisitListTransactionsResponse ¶
func (response ListTransactions200JSONResponse) VisitListTransactionsResponse(w http.ResponseWriter) error
type ListTransactionsParams ¶
type ListTransactionsParams struct {
// Start Inclusive start of range (in lamport clock); default=0
Start *int `form:"start,omitempty" json:"start,omitempty"`
// End Exclusive stop of range (in lamport clock); default=∞
End *int `form:"end,omitempty" json:"end,omitempty"`
}
ListTransactionsParams defines parameters for ListTransactions.
type ListTransactionsRequestObject ¶
type ListTransactionsRequestObject struct {
Params ListTransactionsParams
}
type ListTransactionsResponse ¶
type ListTransactionsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]string
ApplicationproblemJSONDefault *struct {
// Detail A human-readable explanation specific to this occurrence of the problem.
Detail string `json:"detail"`
// Status HTTP statuscode
Status float32 `json:"status"`
// Title A short, human-readable summary of the problem type.
Title string `json:"title"`
}
}
func ParseListTransactionsResponse ¶
func ParseListTransactionsResponse(rsp *http.Response) (*ListTransactionsResponse, error)
ParseListTransactionsResponse parses an HTTP response from a ListTransactionsWithResponse call
func (ListTransactionsResponse) Status ¶
func (r ListTransactionsResponse) Status() string
Status returns HTTPResponse.Status
func (ListTransactionsResponse) StatusCode ¶
func (r ListTransactionsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ListTransactionsResponseObject ¶
type ListTransactionsResponseObject interface {
VisitListTransactionsResponse(w http.ResponseWriter) error
}
type ListTransactionsdefaultApplicationProblemPlusJSONResponse ¶ added in v5.4.40
type ListTransactionsdefaultApplicationProblemPlusJSONResponse struct {
Body struct {
// Detail A human-readable explanation specific to this occurrence of the problem.
Detail string `json:"detail"`
// Status HTTP statuscode
Status float32 `json:"status"`
// Title A short, human-readable summary of the problem type.
Title string `json:"title"`
}
StatusCode int
}
func (ListTransactionsdefaultApplicationProblemPlusJSONResponse) VisitListTransactionsResponse ¶ added in v5.4.40
func (response ListTransactionsdefaultApplicationProblemPlusJSONResponse) VisitListTransactionsResponse(w http.ResponseWriter) error
type PeerDiagnostics ¶
type PeerDiagnostics transport.Diagnostics
PeerDiagnostics defines the type for diagnostics of a peer
func (PeerDiagnostics) MarshalJSON ¶
func (p PeerDiagnostics) MarshalJSON() ([]byte, error)
MarshalJSON is the custom JSON marshaler for PeerDiagnostics
func (*PeerDiagnostics) UnmarshalJSON ¶
func (p *PeerDiagnostics) UnmarshalJSON(bytes []byte) error
UnmarshalJSON is the custom JSON unmarshaler for PeerDiagnostics
type RenderGraph200TextvndGraphvizResponse ¶
func (RenderGraph200TextvndGraphvizResponse) VisitRenderGraphResponse ¶
func (response RenderGraph200TextvndGraphvizResponse) VisitRenderGraphResponse(w http.ResponseWriter) error
type RenderGraphParams ¶
type RenderGraphParams struct {
// Start Lamport Clock value from where to start rendering (inclusive). If omitted, rendering starts at the root.
Start *int `form:"start,omitempty" json:"start,omitempty"`
// End Lamport Clock value where to stop rendering (exclusive). If omitted, renders the remainder of the graph. Must be larger than the `start` parameter.
End *int `form:"end,omitempty" json:"end,omitempty"`
}
RenderGraphParams defines parameters for RenderGraph.
type RenderGraphRequestObject ¶
type RenderGraphRequestObject struct {
Params RenderGraphParams
}
type RenderGraphResponse ¶
type RenderGraphResponse struct {
Body []byte
HTTPResponse *http.Response
ApplicationproblemJSONDefault *struct {
// Detail A human-readable explanation specific to this occurrence of the problem.
Detail string `json:"detail"`
// Status HTTP statuscode
Status float32 `json:"status"`
// Title A short, human-readable summary of the problem type.
Title string `json:"title"`
}
}
func ParseRenderGraphResponse ¶
func ParseRenderGraphResponse(rsp *http.Response) (*RenderGraphResponse, error)
ParseRenderGraphResponse parses an HTTP response from a RenderGraphWithResponse call
func (RenderGraphResponse) Status ¶
func (r RenderGraphResponse) Status() string
Status returns HTTPResponse.Status
func (RenderGraphResponse) StatusCode ¶
func (r RenderGraphResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type RenderGraphResponseObject ¶
type RenderGraphResponseObject interface {
VisitRenderGraphResponse(w http.ResponseWriter) error
}
type RenderGraphdefaultApplicationProblemPlusJSONResponse ¶ added in v5.4.40
type RenderGraphdefaultApplicationProblemPlusJSONResponse struct {
Body struct {
// Detail A human-readable explanation specific to this occurrence of the problem.
Detail string `json:"detail"`
// Status HTTP statuscode
Status float32 `json:"status"`
// Title A short, human-readable summary of the problem type.
Title string `json:"title"`
}
StatusCode int
}
func (RenderGraphdefaultApplicationProblemPlusJSONResponse) VisitRenderGraphResponse ¶ added in v5.4.40
func (response RenderGraphdefaultApplicationProblemPlusJSONResponse) VisitRenderGraphResponse(w http.ResponseWriter) error
type Reprocess202Response ¶
type Reprocess202Response struct {
}
func (Reprocess202Response) VisitReprocessResponse ¶
func (response Reprocess202Response) VisitReprocessResponse(w http.ResponseWriter) error
type ReprocessParams ¶
type ReprocessParams struct {
// Type the transaction content-type that must be reprocessed
Type *string `form:"type,omitempty" json:"type,omitempty"`
}
ReprocessParams defines parameters for Reprocess.
type ReprocessRequestObject ¶
type ReprocessRequestObject struct {
Params ReprocessParams
}
type ReprocessResponse ¶
func ParseReprocessResponse ¶
func ParseReprocessResponse(rsp *http.Response) (*ReprocessResponse, error)
ParseReprocessResponse parses an HTTP response from a ReprocessWithResponse call
func (ReprocessResponse) Status ¶
func (r ReprocessResponse) Status() string
Status returns HTTPResponse.Status
func (ReprocessResponse) StatusCode ¶
func (r ReprocessResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ReprocessResponseObject ¶
type ReprocessResponseObject interface {
VisitReprocessResponse(w http.ResponseWriter) error
}
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type ServerInterface ¶
type ServerInterface interface {
// Get the address book, listing which nodes will be connected to.
// (GET /internal/network/v1/addressbook)
GetAddressBook(ctx echo.Context) error
// Visualizes the DAG as a graph
// (GET /internal/network/v1/diagnostics/graph)
RenderGraph(ctx echo.Context, params RenderGraphParams) error
// Gets diagnostic information about the node's peers
// (GET /internal/network/v1/diagnostics/peers)
GetPeerDiagnostics(ctx echo.Context) error
// Lists the state of the internal events
// (GET /internal/network/v1/events)
ListEvents(ctx echo.Context) error
// Reprocess all transactions of the given type, verify and process
// (POST /internal/network/v1/reprocess)
Reprocess(ctx echo.Context, params ReprocessParams) error
// Lists transactions on the DAG
// (GET /internal/network/v1/transaction)
ListTransactions(ctx echo.Context, params ListTransactionsParams) error
// Retrieves a transaction
// (GET /internal/network/v1/transaction/{ref})
GetTransaction(ctx echo.Context, ref string) error
// Gets the transaction payload
// (GET /internal/network/v1/transaction/{ref}/payload)
GetTransactionPayload(ctx echo.Context, ref string) error
}
ServerInterface represents all server handlers.
func NewStrictHandler ¶
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) GetAddressBook ¶
func (w *ServerInterfaceWrapper) GetAddressBook(ctx echo.Context) error
GetAddressBook converts echo context to params.
func (*ServerInterfaceWrapper) GetPeerDiagnostics ¶
func (w *ServerInterfaceWrapper) GetPeerDiagnostics(ctx echo.Context) error
GetPeerDiagnostics converts echo context to params.
func (*ServerInterfaceWrapper) GetTransaction ¶
func (w *ServerInterfaceWrapper) GetTransaction(ctx echo.Context) error
GetTransaction converts echo context to params.
func (*ServerInterfaceWrapper) GetTransactionPayload ¶
func (w *ServerInterfaceWrapper) GetTransactionPayload(ctx echo.Context) error
GetTransactionPayload converts echo context to params.
func (*ServerInterfaceWrapper) ListEvents ¶
func (w *ServerInterfaceWrapper) ListEvents(ctx echo.Context) error
ListEvents converts echo context to params.
func (*ServerInterfaceWrapper) ListTransactions ¶
func (w *ServerInterfaceWrapper) ListTransactions(ctx echo.Context) error
ListTransactions converts echo context to params.
func (*ServerInterfaceWrapper) RenderGraph ¶
func (w *ServerInterfaceWrapper) RenderGraph(ctx echo.Context) error
RenderGraph converts echo context to params.
type StrictHandlerFunc ¶
type StrictHandlerFunc = strictecho.StrictEchoHandlerFunc
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc = strictecho.StrictEchoMiddlewareFunc
type StrictServerInterface ¶
type StrictServerInterface interface {
// Get the address book, listing which nodes will be connected to.
// (GET /internal/network/v1/addressbook)
GetAddressBook(ctx context.Context, request GetAddressBookRequestObject) (GetAddressBookResponseObject, error)
// Visualizes the DAG as a graph
// (GET /internal/network/v1/diagnostics/graph)
RenderGraph(ctx context.Context, request RenderGraphRequestObject) (RenderGraphResponseObject, error)
// Gets diagnostic information about the node's peers
// (GET /internal/network/v1/diagnostics/peers)
GetPeerDiagnostics(ctx context.Context, request GetPeerDiagnosticsRequestObject) (GetPeerDiagnosticsResponseObject, error)
// Lists the state of the internal events
// (GET /internal/network/v1/events)
ListEvents(ctx context.Context, request ListEventsRequestObject) (ListEventsResponseObject, error)
// Reprocess all transactions of the given type, verify and process
// (POST /internal/network/v1/reprocess)
Reprocess(ctx context.Context, request ReprocessRequestObject) (ReprocessResponseObject, error)
// Lists transactions on the DAG
// (GET /internal/network/v1/transaction)
ListTransactions(ctx context.Context, request ListTransactionsRequestObject) (ListTransactionsResponseObject, error)
// Retrieves a transaction
// (GET /internal/network/v1/transaction/{ref})
GetTransaction(ctx context.Context, request GetTransactionRequestObject) (GetTransactionResponseObject, error)
// Gets the transaction payload
// (GET /internal/network/v1/transaction/{ref}/payload)
GetTransactionPayload(ctx context.Context, request GetTransactionPayloadRequestObject) (GetTransactionPayloadResponseObject, error)
}
StrictServerInterface represents all server handlers.
type Wrapper ¶
type Wrapper struct {
Service network.Transactions
}
Wrapper implements the ServerInterface for the network API.
func (*Wrapper) GetAddressBook ¶
func (a *Wrapper) GetAddressBook(_ context.Context, _ GetAddressBookRequestObject) (GetAddressBookResponseObject, error)
func (*Wrapper) GetPeerDiagnostics ¶
func (a *Wrapper) GetPeerDiagnostics(_ context.Context, _ GetPeerDiagnosticsRequestObject) (GetPeerDiagnosticsResponseObject, error)
GetPeerDiagnostics returns the diagnostics of the node's peers
func (*Wrapper) GetTransaction ¶
func (a *Wrapper) GetTransaction(_ context.Context, request GetTransactionRequestObject) (GetTransactionResponseObject, error)
GetTransaction returns a specific transaction
func (*Wrapper) GetTransactionPayload ¶
func (a *Wrapper) GetTransactionPayload(_ context.Context, request GetTransactionPayloadRequestObject) (GetTransactionPayloadResponseObject, error)
GetTransactionPayload returns the payload of a specific transaction
func (Wrapper) ListEvents ¶
func (a Wrapper) ListEvents(_ context.Context, _ ListEventsRequestObject) (ListEventsResponseObject, error)
func (*Wrapper) ListTransactions ¶
func (a *Wrapper) ListTransactions(_ context.Context, request ListTransactionsRequestObject) (ListTransactionsResponseObject, error)
ListTransactions lists all transactions
func (Wrapper) RenderGraph ¶
func (a Wrapper) RenderGraph(_ context.Context, request RenderGraphRequestObject) (RenderGraphResponseObject, error)
RenderGraph visualizes the DAG as Graphviz/dot graph
func (Wrapper) Reprocess ¶
func (a Wrapper) Reprocess(_ context.Context, request ReprocessRequestObject) (ReprocessResponseObject, error)
func (*Wrapper) Routes ¶
func (a *Wrapper) Routes(router core.EchoRouter)