v1

package
v6.2.12 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: GPL-3.0 Imports: 20 Imported by: 0

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

View Source
const (
	JwtBearerAuthScopes = "jwtBearerAuth.Scopes"
)

Variables

This section is empty.

Functions

func NewGetAddressBookRequest

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

NewGetAddressBookRequest generates requests for GetAddressBook

func NewGetPeerDiagnosticsRequest

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

NewGetPeerDiagnosticsRequest generates requests for GetPeerDiagnostics

func NewGetTransactionPayloadRequest

func NewGetTransactionPayloadRequest(server string, ref string) (*http.Request, error)

NewGetTransactionPayloadRequest generates requests for GetTransactionPayload

func NewGetTransactionRequest

func NewGetTransactionRequest(server string, ref string) (*http.Request, error)

NewGetTransactionRequest generates requests for GetTransaction

func NewListEventsRequest

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

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 (c *Client) GetAddressBook(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetPeerDiagnostics

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

func (*Client) GetTransaction

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

func (*Client) GetTransactionPayload

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

func (*Client) ListEvents

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

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

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

type GetAddressBookResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]Contact
}

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

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

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

func (response GetPeerDiagnosticsdefaultApplicationProblemPlusJSONResponse) VisitGetPeerDiagnosticsResponse(w http.ResponseWriter) error

type GetTransaction200ApplicationjoseResponse

type GetTransaction200ApplicationjoseResponse struct {
	Body          io.Reader
	ContentLength int64
}

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

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

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

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

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

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

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

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

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

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

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

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

type RenderGraph200TextvndGraphvizResponse struct {
	Body          io.Reader
	ContentLength int64
}

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

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

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

type ReprocessResponse struct {
	Body         []byte
	HTTPResponse *http.Response
}

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

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

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.

func (*ServerInterfaceWrapper) Reprocess

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

Reprocess 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) GetPeerDiagnostics

GetPeerDiagnostics returns the diagnostics of the node's peers

func (*Wrapper) GetTransaction

GetTransaction returns a specific transaction

func (*Wrapper) GetTransactionPayload

GetTransactionPayload returns the payload of a specific transaction

func (*Wrapper) ListTransactions

ListTransactions lists all transactions

func (Wrapper) RenderGraph

RenderGraph visualizes the DAG as Graphviz/dot graph

func (Wrapper) Reprocess

func (*Wrapper) ResolveStatusCode

func (a *Wrapper) ResolveStatusCode(err error) int

ResolveStatusCode maps errors returned by this API to specific HTTP status codes.

func (*Wrapper) Routes

func (a *Wrapper) Routes(router core.EchoRouter)

Jump to

Keyboard shortcuts

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