v1

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: GPL-3.0 Imports: 20 Imported by: 4

Documentation

Overview

Package v1 provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.8.2 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAddCompoundServiceRequest

func NewAddCompoundServiceRequest(server string, did string, body AddCompoundServiceJSONRequestBody) (*http.Request, error)

NewAddCompoundServiceRequest calls the generic AddCompoundService builder with application/json body

func NewAddCompoundServiceRequestWithBody

func NewAddCompoundServiceRequestWithBody(server string, did string, contentType string, body io.Reader) (*http.Request, error)

NewAddCompoundServiceRequestWithBody generates requests for AddCompoundService with any type of body

func NewAddEndpointRequest

func NewAddEndpointRequest(server string, did string, body AddEndpointJSONRequestBody) (*http.Request, error)

NewAddEndpointRequest calls the generic AddEndpoint builder with application/json body

func NewAddEndpointRequestWithBody

func NewAddEndpointRequestWithBody(server string, did string, contentType string, body io.Reader) (*http.Request, error)

NewAddEndpointRequestWithBody generates requests for AddEndpoint with any type of body

func NewDeleteEndpointsByTypeRequest

func NewDeleteEndpointsByTypeRequest(server string, did string, pType string) (*http.Request, error)

NewDeleteEndpointsByTypeRequest generates requests for DeleteEndpointsByType

func NewDeleteServiceRequest

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

NewDeleteServiceRequest generates requests for DeleteService

func NewGetCompoundServiceEndpointRequest

func NewGetCompoundServiceEndpointRequest(server string, did string, compoundServiceType string, endpointType string, params *GetCompoundServiceEndpointParams) (*http.Request, error)

NewGetCompoundServiceEndpointRequest generates requests for GetCompoundServiceEndpoint

func NewGetCompoundServicesRequest

func NewGetCompoundServicesRequest(server string, did string) (*http.Request, error)

NewGetCompoundServicesRequest generates requests for GetCompoundServices

func NewGetContactInformationRequest

func NewGetContactInformationRequest(server string, did string) (*http.Request, error)

NewGetContactInformationRequest generates requests for GetContactInformation

func NewSearchOrganizationsRequest

func NewSearchOrganizationsRequest(server string, params *SearchOrganizationsParams) (*http.Request, error)

NewSearchOrganizationsRequest generates requests for SearchOrganizations

func NewUpdateContactInformationRequest

func NewUpdateContactInformationRequest(server string, did string, body UpdateContactInformationJSONRequestBody) (*http.Request, error)

NewUpdateContactInformationRequest calls the generic UpdateContactInformation builder with application/json body

func NewUpdateContactInformationRequestWithBody

func NewUpdateContactInformationRequestWithBody(server string, did string, contentType string, body io.Reader) (*http.Request, error)

NewUpdateContactInformationRequestWithBody generates requests for UpdateContactInformation with any type of body

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 AddCompoundServiceJSONBody

type AddCompoundServiceJSONBody CompoundServiceProperties

AddCompoundServiceJSONBody defines parameters for AddCompoundService.

type AddCompoundServiceJSONRequestBody

type AddCompoundServiceJSONRequestBody AddCompoundServiceJSONBody

AddCompoundServiceJSONRequestBody defines body for AddCompoundService for application/json ContentType.

type AddCompoundServiceResponse

type AddCompoundServiceResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *CompoundService
}

func ParseAddCompoundServiceResponse

func ParseAddCompoundServiceResponse(rsp *http.Response) (*AddCompoundServiceResponse, error)

ParseAddCompoundServiceResponse parses an HTTP response from a AddCompoundServiceWithResponse call

func (AddCompoundServiceResponse) Status

Status returns HTTPResponse.Status

func (AddCompoundServiceResponse) StatusCode

func (r AddCompoundServiceResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type AddEndpointJSONBody

type AddEndpointJSONBody EndpointProperties

AddEndpointJSONBody defines parameters for AddEndpoint.

type AddEndpointJSONRequestBody

type AddEndpointJSONRequestBody AddEndpointJSONBody

AddEndpointJSONRequestBody defines body for AddEndpoint for application/json ContentType.

type AddEndpointResponse

type AddEndpointResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Endpoint
}

func ParseAddEndpointResponse

func ParseAddEndpointResponse(rsp *http.Response) (*AddEndpointResponse, error)

ParseAddEndpointResponse parses an HTTP response from a AddEndpointWithResponse call

func (AddEndpointResponse) Status

func (r AddEndpointResponse) Status() string

Status returns HTTPResponse.Status

func (AddEndpointResponse) StatusCode

func (r AddEndpointResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) AddCompoundService

func (c *Client) AddCompoundService(ctx context.Context, did string, body AddCompoundServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) AddCompoundServiceWithBody

func (c *Client) AddCompoundServiceWithBody(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) AddEndpoint

func (c *Client) AddEndpoint(ctx context.Context, did string, body AddEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) AddEndpointWithBody

func (c *Client) AddEndpointWithBody(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) DeleteEndpointsByType

func (c *Client) DeleteEndpointsByType(ctx context.Context, did string, pType string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) DeleteService

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

func (*Client) GetCompoundServiceEndpoint

func (c *Client) GetCompoundServiceEndpoint(ctx context.Context, did string, compoundServiceType string, endpointType string, params *GetCompoundServiceEndpointParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetCompoundServices

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

func (*Client) GetContactInformation

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

func (*Client) SearchOrganizations

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

func (*Client) UpdateContactInformation

func (c *Client) UpdateContactInformation(ctx context.Context, did string, body UpdateContactInformationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateContactInformationWithBody

func (c *Client) UpdateContactInformationWithBody(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// GetCompoundServices request
	GetCompoundServices(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// AddCompoundService request with any body
	AddCompoundServiceWithBody(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	AddCompoundService(ctx context.Context, did string, body AddCompoundServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetCompoundServiceEndpoint request
	GetCompoundServiceEndpoint(ctx context.Context, did string, compoundServiceType string, endpointType string, params *GetCompoundServiceEndpointParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetContactInformation request
	GetContactInformation(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateContactInformation request with any body
	UpdateContactInformationWithBody(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	UpdateContactInformation(ctx context.Context, did string, body UpdateContactInformationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// AddEndpoint request with any body
	AddEndpointWithBody(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	AddEndpoint(ctx context.Context, did string, body AddEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteEndpointsByType request
	DeleteEndpointsByType(ctx context.Context, did string, pType string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SearchOrganizations request
	SearchOrganizations(ctx context.Context, params *SearchOrganizationsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteService request
	DeleteService(ctx context.Context, id 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) AddCompoundServiceWithBodyWithResponse

func (c *ClientWithResponses) AddCompoundServiceWithBodyWithResponse(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddCompoundServiceResponse, error)

AddCompoundServiceWithBodyWithResponse request with arbitrary body returning *AddCompoundServiceResponse

func (*ClientWithResponses) AddCompoundServiceWithResponse

func (c *ClientWithResponses) AddCompoundServiceWithResponse(ctx context.Context, did string, body AddCompoundServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*AddCompoundServiceResponse, error)

func (*ClientWithResponses) AddEndpointWithBodyWithResponse

func (c *ClientWithResponses) AddEndpointWithBodyWithResponse(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddEndpointResponse, error)

AddEndpointWithBodyWithResponse request with arbitrary body returning *AddEndpointResponse

func (*ClientWithResponses) AddEndpointWithResponse

func (c *ClientWithResponses) AddEndpointWithResponse(ctx context.Context, did string, body AddEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*AddEndpointResponse, error)

func (*ClientWithResponses) DeleteEndpointsByTypeWithResponse

func (c *ClientWithResponses) DeleteEndpointsByTypeWithResponse(ctx context.Context, did string, pType string, reqEditors ...RequestEditorFn) (*DeleteEndpointsByTypeResponse, error)

DeleteEndpointsByTypeWithResponse request returning *DeleteEndpointsByTypeResponse

func (*ClientWithResponses) DeleteServiceWithResponse

func (c *ClientWithResponses) DeleteServiceWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteServiceResponse, error)

DeleteServiceWithResponse request returning *DeleteServiceResponse

func (*ClientWithResponses) GetCompoundServiceEndpointWithResponse

func (c *ClientWithResponses) GetCompoundServiceEndpointWithResponse(ctx context.Context, did string, compoundServiceType string, endpointType string, params *GetCompoundServiceEndpointParams, reqEditors ...RequestEditorFn) (*GetCompoundServiceEndpointResponse, error)

GetCompoundServiceEndpointWithResponse request returning *GetCompoundServiceEndpointResponse

func (*ClientWithResponses) GetCompoundServicesWithResponse

func (c *ClientWithResponses) GetCompoundServicesWithResponse(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*GetCompoundServicesResponse, error)

GetCompoundServicesWithResponse request returning *GetCompoundServicesResponse

func (*ClientWithResponses) GetContactInformationWithResponse

func (c *ClientWithResponses) GetContactInformationWithResponse(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*GetContactInformationResponse, error)

GetContactInformationWithResponse request returning *GetContactInformationResponse

func (*ClientWithResponses) SearchOrganizationsWithResponse

func (c *ClientWithResponses) SearchOrganizationsWithResponse(ctx context.Context, params *SearchOrganizationsParams, reqEditors ...RequestEditorFn) (*SearchOrganizationsResponse, error)

SearchOrganizationsWithResponse request returning *SearchOrganizationsResponse

func (*ClientWithResponses) UpdateContactInformationWithBodyWithResponse

func (c *ClientWithResponses) UpdateContactInformationWithBodyWithResponse(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateContactInformationResponse, error)

UpdateContactInformationWithBodyWithResponse request with arbitrary body returning *UpdateContactInformationResponse

func (*ClientWithResponses) UpdateContactInformationWithResponse

func (c *ClientWithResponses) UpdateContactInformationWithResponse(ctx context.Context, did string, body UpdateContactInformationJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateContactInformationResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetCompoundServices request
	GetCompoundServicesWithResponse(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*GetCompoundServicesResponse, error)

	// AddCompoundService request with any body
	AddCompoundServiceWithBodyWithResponse(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddCompoundServiceResponse, error)

	AddCompoundServiceWithResponse(ctx context.Context, did string, body AddCompoundServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*AddCompoundServiceResponse, error)

	// GetCompoundServiceEndpoint request
	GetCompoundServiceEndpointWithResponse(ctx context.Context, did string, compoundServiceType string, endpointType string, params *GetCompoundServiceEndpointParams, reqEditors ...RequestEditorFn) (*GetCompoundServiceEndpointResponse, error)

	// GetContactInformation request
	GetContactInformationWithResponse(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*GetContactInformationResponse, error)

	// UpdateContactInformation request with any body
	UpdateContactInformationWithBodyWithResponse(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateContactInformationResponse, error)

	UpdateContactInformationWithResponse(ctx context.Context, did string, body UpdateContactInformationJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateContactInformationResponse, error)

	// AddEndpoint request with any body
	AddEndpointWithBodyWithResponse(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddEndpointResponse, error)

	AddEndpointWithResponse(ctx context.Context, did string, body AddEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*AddEndpointResponse, error)

	// DeleteEndpointsByType request
	DeleteEndpointsByTypeWithResponse(ctx context.Context, did string, pType string, reqEditors ...RequestEditorFn) (*DeleteEndpointsByTypeResponse, error)

	// SearchOrganizations request
	SearchOrganizationsWithResponse(ctx context.Context, params *SearchOrganizationsParams, reqEditors ...RequestEditorFn) (*SearchOrganizationsResponse, error)

	// DeleteService request
	DeleteServiceWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteServiceResponse, error)
}

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

type CompoundService

type CompoundService struct {
	Id string `json:"id"`

	// A map containing service references and/or endpoints.
	ServiceEndpoint map[string]interface{} `json:"serviceEndpoint"`

	// type of the endpoint. May be freely choosen.
	Type string `json:"type"`
}

A creation request for a compound service with endpoints and/or references to endpoints.

type CompoundServiceProperties

type CompoundServiceProperties struct {
	// A map containing service references and/or endpoints.
	ServiceEndpoint map[string]interface{} `json:"serviceEndpoint"`

	// type of the endpoint. May be freely choosen.
	Type string `json:"type"`
}

A creation request for a compound service that contains endpoints. The endpoints can be either absolute endpoints or references.

type ContactInformation

type ContactInformation = didman.ContactInformation

ContactInformation is an alias for the already defined didman.ContactInformation

type DeleteEndpointsByTypeResponse

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

func ParseDeleteEndpointsByTypeResponse

func ParseDeleteEndpointsByTypeResponse(rsp *http.Response) (*DeleteEndpointsByTypeResponse, error)

ParseDeleteEndpointsByTypeResponse parses an HTTP response from a DeleteEndpointsByTypeWithResponse call

func (DeleteEndpointsByTypeResponse) Status

Status returns HTTPResponse.Status

func (DeleteEndpointsByTypeResponse) StatusCode

func (r DeleteEndpointsByTypeResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteServiceResponse

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

func ParseDeleteServiceResponse

func ParseDeleteServiceResponse(rsp *http.Response) (*DeleteServiceResponse, error)

ParseDeleteServiceResponse parses an HTTP response from a DeleteServiceWithResponse call

func (DeleteServiceResponse) Status

func (r DeleteServiceResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteServiceResponse) StatusCode

func (r DeleteServiceResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type EchoRouter

type EchoRouter interface {
	Add(method string, 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 Endpoint

type Endpoint struct {
	// An endpoint URL or a reference to another service.
	Endpoint string `json:"endpoint"`
	Id       string `json:"id"`

	// type of the endpoint. May be freely choosen.
	Type string `json:"type"`
}

A combination of type and URL.

type EndpointProperties

type EndpointProperties struct {
	// An endpoint URL or a reference to another service.
	Endpoint string `json:"endpoint"`

	// type of the endpoint. May be freely choosen.
	Type string `json:"type"`
}

A combination of type and URL.

type EndpointResponse

type EndpointResponse struct {
	// The endpoint URL.
	Endpoint string `json:"endpoint"`
}

EndpointResponse defines model for EndpointResponse.

type Error

type Error = problem.Problem

Error is an alias for the internally used problem.Problem

type ErrorStatusCodeResolver

type ErrorStatusCodeResolver interface {
	ResolveStatusCode(err error) int
}

type GetCompoundServiceEndpointParams

type GetCompoundServiceEndpointParams struct {
	// Whether to resolve references. When true and the given endpoint is a reference it returns the endpoint of the referenced service.
	// If false it returns the reference itself. Defaults to true.
	Resolve *bool `json:"resolve,omitempty"`
}

GetCompoundServiceEndpointParams defines parameters for GetCompoundServiceEndpoint.

type GetCompoundServiceEndpointResponse

type GetCompoundServiceEndpointResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *EndpointResponse
}

func ParseGetCompoundServiceEndpointResponse

func ParseGetCompoundServiceEndpointResponse(rsp *http.Response) (*GetCompoundServiceEndpointResponse, error)

ParseGetCompoundServiceEndpointResponse parses an HTTP response from a GetCompoundServiceEndpointWithResponse call

func (GetCompoundServiceEndpointResponse) Status

Status returns HTTPResponse.Status

func (GetCompoundServiceEndpointResponse) StatusCode

func (r GetCompoundServiceEndpointResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetCompoundServicesResponse

type GetCompoundServicesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]CompoundService
}

func ParseGetCompoundServicesResponse

func ParseGetCompoundServicesResponse(rsp *http.Response) (*GetCompoundServicesResponse, error)

ParseGetCompoundServicesResponse parses an HTTP response from a GetCompoundServicesWithResponse call

func (GetCompoundServicesResponse) Status

Status returns HTTPResponse.Status

func (GetCompoundServicesResponse) StatusCode

func (r GetCompoundServicesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetContactInformationResponse

type GetContactInformationResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ContactInformation
}

func ParseGetContactInformationResponse

func ParseGetContactInformationResponse(rsp *http.Response) (*GetContactInformationResponse, error)

ParseGetContactInformationResponse parses an HTTP response from a GetContactInformationWithResponse call

func (GetContactInformationResponse) Status

Status returns HTTPResponse.Status

func (GetContactInformationResponse) StatusCode

func (r GetContactInformationResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HTTPClient

type HTTPClient struct {
	ServerAddress string
	Timeout       time.Duration
}

HTTPClient holds the server address and other basic settings for the http client

func (HTTPClient) AddCompoundService

func (h HTTPClient) AddCompoundService(did, serviceType string, references map[string]string) (*CompoundService, error)

AddCompoundService registers a compound service on the given DID.

func (HTTPClient) AddEndpoint

func (h HTTPClient) AddEndpoint(did, endpointType, endpointURL string) (*Endpoint, error)

AddEndpoint registers a concrete endpoint URL on the given DID.

func (HTTPClient) DeleteEndpointsByType

func (h HTTPClient) DeleteEndpointsByType(did, endpointType string) error

DeleteEndpointsByType deletes an endpoint by type on a DID document indicated by the did.

func (HTTPClient) DeleteService

func (h HTTPClient) DeleteService(id ssi.URI) error

DeleteService tries to delete a service from the DID document indicated by the ID Returns an error if the service does not exists, is still in use or if the DID is not managed by this node.

func (HTTPClient) GetCompoundServices

func (h HTTPClient) GetCompoundServices(did string) ([]CompoundService, error)

GetCompoundServices returns a list of compound services for a given DID string.

func (HTTPClient) GetContactInformation

func (h HTTPClient) GetContactInformation(did string) (*ContactInformation, error)

GetContactInformation retrieves the contact information registered on the given DID. If the DID does not exist, an error is returned. If the DID does exist but has no contact information nothing is returned.

func (HTTPClient) UpdateContactInformation

func (h HTTPClient) UpdateContactInformation(did string, information ContactInformation) error

UpdateContactInformation (over)writes the contact information on given DID. If the DID does not exist an error is returned.

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type OrganizationSearchResult

type OrganizationSearchResult = didman.OrganizationSearchResult

OrganizationSearchResult is an alias for the already defined didman.OrganizationSearchResult

type Preprocessor

type Preprocessor interface {
	Preprocess(operationID string, context echo.Context)
}

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type SearchOrganizationsParams

type SearchOrganizationsParams struct {
	// Query used for searching the organization by name. The query is matched to the organization's name in a SQL's "LIKE" fashion: it matches partial strings and also names that sound like the given query, using a phonetic transformation algorithm.
	Query string `json:"query"`

	// Filters organizations by service of the given type in the organizations' DID document (optional).
	DidServiceType *string `json:"didServiceType,omitempty"`
}

SearchOrganizationsParams defines parameters for SearchOrganizations.

type SearchOrganizationsResponse

type SearchOrganizationsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]OrganizationSearchResult
}

func ParseSearchOrganizationsResponse

func ParseSearchOrganizationsResponse(rsp *http.Response) (*SearchOrganizationsResponse, error)

ParseSearchOrganizationsResponse parses an HTTP response from a SearchOrganizationsWithResponse call

func (SearchOrganizationsResponse) Status

Status returns HTTPResponse.Status

func (SearchOrganizationsResponse) StatusCode

func (r SearchOrganizationsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ServerInterface

type ServerInterface interface {
	// Get a list of compound services for a DID document.
	//
	// error responses:
	// * 400 - incorrect input
	// * 404 - unknown DID
	// (GET /internal/didman/v1/did/{did}/compoundservice)
	GetCompoundServices(ctx echo.Context, did string) error
	// Add a compound service to a DID Document.
	// (POST /internal/didman/v1/did/{did}/compoundservice)
	AddCompoundService(ctx echo.Context, did string) error
	// Retrieves the endpoint with the specified endpointType from the specified compound service.
	// (GET /internal/didman/v1/did/{did}/compoundservice/{compoundServiceType}/endpoint/{endpointType})
	GetCompoundServiceEndpoint(ctx echo.Context, did string, compoundServiceType string, endpointType string, params GetCompoundServiceEndpointParams) error

	// (GET /internal/didman/v1/did/{did}/contactinfo)
	GetContactInformation(ctx echo.Context, did string) error
	// Add a predetermined DID Service with real life contact information
	// (PUT /internal/didman/v1/did/{did}/contactinfo)
	UpdateContactInformation(ctx echo.Context, did string) error
	// Add a service endpoint or a reference to a service.
	// (POST /internal/didman/v1/did/{did}/endpoint)
	AddEndpoint(ctx echo.Context, did string) error

	// (DELETE /internal/didman/v1/did/{did}/endpoint/{type})
	DeleteEndpointsByType(ctx echo.Context, did string, pType string) error

	// (GET /internal/didman/v1/search/organizations)
	SearchOrganizations(ctx echo.Context, params SearchOrganizationsParams) error
	// Remove a service from a DID Document.
	// (DELETE /internal/didman/v1/service/{id})
	DeleteService(ctx echo.Context, id string) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) AddCompoundService

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

AddCompoundService converts echo context to params.

func (*ServerInterfaceWrapper) AddEndpoint

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

AddEndpoint converts echo context to params.

func (*ServerInterfaceWrapper) DeleteEndpointsByType

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

DeleteEndpointsByType converts echo context to params.

func (*ServerInterfaceWrapper) DeleteService

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

DeleteService converts echo context to params.

func (*ServerInterfaceWrapper) GetCompoundServiceEndpoint

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

GetCompoundServiceEndpoint converts echo context to params.

func (*ServerInterfaceWrapper) GetCompoundServices

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

GetCompoundServices converts echo context to params.

func (*ServerInterfaceWrapper) GetContactInformation

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

GetContactInformation converts echo context to params.

func (*ServerInterfaceWrapper) SearchOrganizations

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

SearchOrganizations converts echo context to params.

func (*ServerInterfaceWrapper) UpdateContactInformation

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

UpdateContactInformation converts echo context to params.

type UpdateContactInformationJSONBody

type UpdateContactInformationJSONBody ContactInformation

UpdateContactInformationJSONBody defines parameters for UpdateContactInformation.

type UpdateContactInformationJSONRequestBody

type UpdateContactInformationJSONRequestBody UpdateContactInformationJSONBody

UpdateContactInformationJSONRequestBody defines body for UpdateContactInformation for application/json ContentType.

type UpdateContactInformationResponse

type UpdateContactInformationResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ContactInformation
}

func ParseUpdateContactInformationResponse

func ParseUpdateContactInformationResponse(rsp *http.Response) (*UpdateContactInformationResponse, error)

ParseUpdateContactInformationResponse parses an HTTP response from a UpdateContactInformationWithResponse call

func (UpdateContactInformationResponse) Status

Status returns HTTPResponse.Status

func (UpdateContactInformationResponse) StatusCode

func (r UpdateContactInformationResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Wrapper

type Wrapper struct {
	Didman didman.Didman
}

Wrapper implements the generated interface from oapi-codegen

func (*Wrapper) AddCompoundService

func (w *Wrapper) AddCompoundService(ctx echo.Context, didStr string) error

AddCompoundService handles calls to add a compound service. A CompoundService consists of a type and a map of name -> serviceEndpoint(Ref).

This method checks the params: valid DID and type format Converts the request to an CompoundService Calls didman.AddCompoundService, which does the heavy lifting. Converts the response of AddCompoundService, which is a did.Service back to a CompoundService Sets the http status OK and adds the CompoundService to the response

func (*Wrapper) AddEndpoint

func (w *Wrapper) AddEndpoint(ctx echo.Context, didStr string) error

AddEndpoint handles calls to add a service. It only checks params and sets the correct return status code. didman.AddEndpoint does the heavy lifting.

func (*Wrapper) DeleteEndpointsByType

func (w *Wrapper) DeleteEndpointsByType(ctx echo.Context, didStr string, endpointType string) error

DeleteEndpointsByType handles calls to delete an endpoint. It only checks params and sets the correct return status code. didman.DeleteEndpoint does the heavy lifting.

func (*Wrapper) DeleteService

func (w *Wrapper) DeleteService(ctx echo.Context, uriStr string) error

DeleteService handles calls to delete a service. It only checks params and sets the correct return status code. didman.DeleteService does the heavy lifting.

func (*Wrapper) GetCompoundServiceEndpoint

func (w *Wrapper) GetCompoundServiceEndpoint(ctx echo.Context, didStr string, compoundServiceType string, endpointType string, params GetCompoundServiceEndpointParams) error

GetCompoundServiceEndpoint handles calls to read a specific endpoint of a compound service.

func (*Wrapper) GetCompoundServices

func (w *Wrapper) GetCompoundServices(ctx echo.Context, didStr string) error

GetCompoundServices handles calls to get a list of compound services for a provided DID string. Its checks params, calls Didman and sets http return values.

func (*Wrapper) GetContactInformation

func (w *Wrapper) GetContactInformation(ctx echo.Context, didStr string) error

GetContactInformation handles requests for contact information for a specific DID. It parses the did path param and passes it to didman.GetContactInformation.

func (*Wrapper) Preprocess

func (w *Wrapper) Preprocess(operationID string, context echo.Context)

Preprocess is called just before the API operation itself is invoked.

func (*Wrapper) ResolveStatusCode

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

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

func (*Wrapper) Routes

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

Routes registers the routes from the open api spec to the echo router.

func (*Wrapper) SearchOrganizations

func (w *Wrapper) SearchOrganizations(ctx echo.Context, params SearchOrganizationsParams) error

SearchOrganizations handles requests for searching organizations, meaning it looks for (valid) Verifiable Credentials that map to the "organization" concept and where its subject resolves to an active DID Document. It optionally filters only on organizations which DID documents contain a service with the specified type.

func (*Wrapper) UpdateContactInformation

func (w *Wrapper) UpdateContactInformation(ctx echo.Context, didStr string) error

UpdateContactInformation handles requests for updating contact information for a specific DID. It parses the did path param and and unmarshals the request body and passes them to didman.UpdateContactInformation.

Jump to

Keyboard shortcuts

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