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: 17 Imported by: 7

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 NewAddNewVerificationMethodRequest

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

NewAddNewVerificationMethodRequest generates requests for AddNewVerificationMethod

func NewConflictedDIDsRequest

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

NewConflictedDIDsRequest generates requests for ConflictedDIDs

func NewCreateDIDRequest

func NewCreateDIDRequest(server string, body CreateDIDJSONRequestBody) (*http.Request, error)

NewCreateDIDRequest calls the generic CreateDID builder with application/json body

func NewCreateDIDRequestWithBody

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

NewCreateDIDRequestWithBody generates requests for CreateDID with any type of body

func NewDeactivateDIDRequest

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

NewDeactivateDIDRequest generates requests for DeactivateDID

func NewDeleteVerificationMethodRequest

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

NewDeleteVerificationMethodRequest generates requests for DeleteVerificationMethod

func NewGetDIDRequest

func NewGetDIDRequest(server string, did string, params *GetDIDParams) (*http.Request, error)

NewGetDIDRequest generates requests for GetDID

func NewUpdateDIDRequest

func NewUpdateDIDRequest(server string, did string, body UpdateDIDJSONRequestBody) (*http.Request, error)

NewUpdateDIDRequest calls the generic UpdateDID builder with application/json body

func NewUpdateDIDRequestWithBody

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

NewUpdateDIDRequestWithBody generates requests for UpdateDID 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 AddNewVerificationMethodResponse

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

func ParseAddNewVerificationMethodResponse

func ParseAddNewVerificationMethodResponse(rsp *http.Response) (*AddNewVerificationMethodResponse, error)

ParseAddNewVerificationMethodResponse parses an HTTP response from a AddNewVerificationMethodWithResponse call

func (AddNewVerificationMethodResponse) Status

Status returns HTTPResponse.Status

func (AddNewVerificationMethodResponse) StatusCode

func (r AddNewVerificationMethodResponse) 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) AddNewVerificationMethod

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

func (*Client) ConflictedDIDs

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

func (*Client) CreateDID

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

func (*Client) CreateDIDWithBody

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

func (*Client) DeactivateDID

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

func (*Client) DeleteVerificationMethod

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

func (*Client) GetDID

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

func (*Client) UpdateDID

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

func (*Client) UpdateDIDWithBody

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

type ClientInterface

type ClientInterface interface {
	// CreateDID request with any body
	CreateDIDWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CreateDID(ctx context.Context, body CreateDIDJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ConflictedDIDs request
	ConflictedDIDs(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

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

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

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

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

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

	// DeleteVerificationMethod request
	DeleteVerificationMethod(ctx context.Context, did string, kid 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) AddNewVerificationMethodWithResponse

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

AddNewVerificationMethodWithResponse request returning *AddNewVerificationMethodResponse

func (*ClientWithResponses) ConflictedDIDsWithResponse

func (c *ClientWithResponses) ConflictedDIDsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ConflictedDIDsResponse, error)

ConflictedDIDsWithResponse request returning *ConflictedDIDsResponse

func (*ClientWithResponses) CreateDIDWithBodyWithResponse

func (c *ClientWithResponses) CreateDIDWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDIDResponse, error)

CreateDIDWithBodyWithResponse request with arbitrary body returning *CreateDIDResponse

func (*ClientWithResponses) CreateDIDWithResponse

func (c *ClientWithResponses) CreateDIDWithResponse(ctx context.Context, body CreateDIDJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDIDResponse, error)

func (*ClientWithResponses) DeactivateDIDWithResponse

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

DeactivateDIDWithResponse request returning *DeactivateDIDResponse

func (*ClientWithResponses) DeleteVerificationMethodWithResponse

func (c *ClientWithResponses) DeleteVerificationMethodWithResponse(ctx context.Context, did string, kid string, reqEditors ...RequestEditorFn) (*DeleteVerificationMethodResponse, error)

DeleteVerificationMethodWithResponse request returning *DeleteVerificationMethodResponse

func (*ClientWithResponses) GetDIDWithResponse

func (c *ClientWithResponses) GetDIDWithResponse(ctx context.Context, did string, params *GetDIDParams, reqEditors ...RequestEditorFn) (*GetDIDResponse, error)

GetDIDWithResponse request returning *GetDIDResponse

func (*ClientWithResponses) UpdateDIDWithBodyWithResponse

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

UpdateDIDWithBodyWithResponse request with arbitrary body returning *UpdateDIDResponse

func (*ClientWithResponses) UpdateDIDWithResponse

func (c *ClientWithResponses) UpdateDIDWithResponse(ctx context.Context, did string, body UpdateDIDJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDIDResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// CreateDID request with any body
	CreateDIDWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDIDResponse, error)

	CreateDIDWithResponse(ctx context.Context, body CreateDIDJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDIDResponse, error)

	// ConflictedDIDs request
	ConflictedDIDsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ConflictedDIDsResponse, error)

	// DeactivateDID request
	DeactivateDIDWithResponse(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*DeactivateDIDResponse, error)

	// GetDID request
	GetDIDWithResponse(ctx context.Context, did string, params *GetDIDParams, reqEditors ...RequestEditorFn) (*GetDIDResponse, error)

	// UpdateDID request with any body
	UpdateDIDWithBodyWithResponse(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDIDResponse, error)

	UpdateDIDWithResponse(ctx context.Context, did string, body UpdateDIDJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDIDResponse, error)

	// AddNewVerificationMethod request
	AddNewVerificationMethodWithResponse(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*AddNewVerificationMethodResponse, error)

	// DeleteVerificationMethod request
	DeleteVerificationMethodWithResponse(ctx context.Context, did string, kid string, reqEditors ...RequestEditorFn) (*DeleteVerificationMethodResponse, error)
}

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

type ConflictedDIDsResponse

type ConflictedDIDsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]DIDResolutionResult
}

func ParseConflictedDIDsResponse

func ParseConflictedDIDsResponse(rsp *http.Response) (*ConflictedDIDsResponse, error)

ParseConflictedDIDsResponse parses an HTTP response from a ConflictedDIDsWithResponse call

func (ConflictedDIDsResponse) Status

func (r ConflictedDIDsResponse) Status() string

Status returns HTTPResponse.Status

func (ConflictedDIDsResponse) StatusCode

func (r ConflictedDIDsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateDIDJSONBody

type CreateDIDJSONBody DIDCreateRequest

CreateDIDJSONBody defines parameters for CreateDID.

type CreateDIDJSONRequestBody

type CreateDIDJSONRequestBody CreateDIDJSONBody

CreateDIDJSONRequestBody defines body for CreateDID for application/json ContentType.

type CreateDIDResponse

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

func ParseCreateDIDResponse

func ParseCreateDIDResponse(rsp *http.Response) (*CreateDIDResponse, error)

ParseCreateDIDResponse parses an HTTP response from a CreateDIDWithResponse call

func (CreateDIDResponse) Status

func (r CreateDIDResponse) Status() string

Status returns HTTPResponse.Status

func (CreateDIDResponse) StatusCode

func (r CreateDIDResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DIDCreateRequest

type DIDCreateRequest struct {
	// indicates if the generated key pair can be used for assertions.
	AssertionMethod *bool `json:"assertionMethod,omitempty"`

	// indicates if the generated key pair can be used for authentication.
	Authentication *bool `json:"authentication,omitempty"`

	// indicates if the generated key pair can be used for capability delegations.
	CapabilityDelegation *bool `json:"capabilityDelegation,omitempty"`

	// indicates if the generated key pair can be used for altering DID Documents.
	// In combination with selfControl = true, the key can be used to alter the new DID Document.
	// Defaults to true when not given.
	// default: true
	CapabilityInvocation *bool `json:"capabilityInvocation,omitempty"`

	// List of DIDs that can control the new DID Document. If selfControl = true and controllers is not empty,
	// the newly generated DID will be added to the list of controllers.
	Controllers *[]string `json:"controllers,omitempty"`

	// indicates if the generated key pair can be used for Key agreements.
	KeyAgreement *bool `json:"keyAgreement,omitempty"`

	// whether the generated DID Document can be altered with its own capabilityInvocation key.
	SelfControl *bool `json:"selfControl,omitempty"`
}

DIDCreateRequest defines model for DIDCreateRequest.

type DIDDocument

type DIDDocument = did.Document

DIDDocument is an alias

type DIDDocumentMetadata

type DIDDocumentMetadata = types.DocumentMetadata

DIDDocumentMetadata is an alias

type DIDResolutionResult

type DIDResolutionResult struct {
	// A DID document according to the W3C spec following the Nuts Method rules as defined in [Nuts RFC006]
	Document DIDDocument `json:"document"`

	// The DID document metadata.
	DocumentMetadata DIDDocumentMetadata `json:"documentMetadata"`
}

DIDResolutionResult defines model for DIDResolutionResult.

type DIDUpdateRequest

type DIDUpdateRequest struct {
	// The hash of the document in hex format.
	CurrentHash string `json:"currentHash"`

	// A DID document according to the W3C spec following the Nuts Method rules as defined in [Nuts RFC006]
	Document DIDDocument `json:"document"`
}

DIDUpdateRequest defines model for DIDUpdateRequest.

type DeactivateDIDResponse

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

func ParseDeactivateDIDResponse

func ParseDeactivateDIDResponse(rsp *http.Response) (*DeactivateDIDResponse, error)

ParseDeactivateDIDResponse parses an HTTP response from a DeactivateDIDWithResponse call

func (DeactivateDIDResponse) Status

func (r DeactivateDIDResponse) Status() string

Status returns HTTPResponse.Status

func (DeactivateDIDResponse) StatusCode

func (r DeactivateDIDResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteVerificationMethodResponse

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

func ParseDeleteVerificationMethodResponse

func ParseDeleteVerificationMethodResponse(rsp *http.Response) (*DeleteVerificationMethodResponse, error)

ParseDeleteVerificationMethodResponse parses an HTTP response from a DeleteVerificationMethodWithResponse call

func (DeleteVerificationMethodResponse) Status

Status returns HTTPResponse.Status

func (DeleteVerificationMethodResponse) StatusCode

func (r DeleteVerificationMethodResponse) 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 ErrorStatusCodeResolver

type ErrorStatusCodeResolver interface {
	ResolveStatusCode(err error) int
}

type GetDIDParams

type GetDIDParams struct {
	// If a versionId parameter is provided, the DID resolution algorithm returns a specific version of the DID document.
	// The version is the Sha256 hash of the document.
	// The DID parameters versionId and versionTime are mutually exclusive.
	//
	// See [the did resolution spec about versioning](https://w3c-ccg.github.io/did-resolution/#versioning)
	VersionId *string `json:"versionId,omitempty"`

	// If a versionTime parameter is provided, the DID resolution algorithm returns a specific version of the DID document.
	// The DID parameters versionId and versionTime are mutually exclusive.
	//
	// See [the did resolution spec about versioning](https://w3c-ccg.github.io/did-resolution/#versioning)
	VersionTime *string `json:"versionTime,omitempty"`
}

GetDIDParams defines parameters for GetDID.

type GetDIDResponse

type GetDIDResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *DIDResolutionResult
}

func ParseGetDIDResponse

func ParseGetDIDResponse(rsp *http.Response) (*GetDIDResponse, error)

ParseGetDIDResponse parses an HTTP response from a GetDIDWithResponse call

func (GetDIDResponse) Status

func (r GetDIDResponse) Status() string

Status returns HTTPResponse.Status

func (GetDIDResponse) StatusCode

func (r GetDIDResponse) 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) AddNewVerificationMethod

func (hb HTTPClient) AddNewVerificationMethod(DID string) (*did.VerificationMethod, error)

AddNewVerificationMethod creates a new verificationMethod and adds it to the DID document It expects a status 200 response from the server, returns an error otherwise

func (HTTPClient) ConflictedDIDs

func (hb HTTPClient) ConflictedDIDs() ([]DIDResolutionResult, error)

ConflictedDIDs returns the conflicted DID Documents and their metadata

func (HTTPClient) Create

func (hb HTTPClient) Create(createRequest DIDCreateRequest) (*did.Document, error)

Create calls the server and creates a new DID Document

func (HTTPClient) Deactivate

func (hb HTTPClient) Deactivate(DID string) error

Deactivate a DID Document given a DID. It expects a status 200 response from the server, returns an error otherwise.

func (HTTPClient) DeleteVerificationMethod

func (hb HTTPClient) DeleteVerificationMethod(DID, kid string) error

DeleteVerificationMethod deletes a specified verificationMethod from the DID document It expects a status 204 response from the server, returns an error otherwise

func (HTTPClient) Get

Get returns a DID document and metadata based on a DID

func (HTTPClient) Update

func (hb HTTPClient) Update(DID string, current string, next did.Document) (*did.Document, error)

Update a DID Document given a DID and its current hash.

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

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 ServerInterface

type ServerInterface interface {
	// Creates a new Nuts DID
	// (POST /internal/vdr/v1/did)
	CreateDID(ctx echo.Context) error
	// Retrieve the list of conflicted DID documents
	// (GET /internal/vdr/v1/did/conflicted)
	ConflictedDIDs(ctx echo.Context) error
	// Deactivates a Nuts DID document according to the specification.
	// (DELETE /internal/vdr/v1/did/{did})
	DeactivateDID(ctx echo.Context, did string) error
	// Resolves a Nuts DID document
	// (GET /internal/vdr/v1/did/{did})
	GetDID(ctx echo.Context, did string, params GetDIDParams) error
	// Updates a Nuts DID document.
	// (PUT /internal/vdr/v1/did/{did})
	UpdateDID(ctx echo.Context, did string) error
	// Creates and adds a new verificationMethod to the DID document.
	// (POST /internal/vdr/v1/did/{did}/verificationmethod)
	AddNewVerificationMethod(ctx echo.Context, did string) error
	// Delete a specific verification method
	// (DELETE /internal/vdr/v1/did/{did}/verificationmethod/{kid})
	DeleteVerificationMethod(ctx echo.Context, did string, kid string) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) AddNewVerificationMethod

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

AddNewVerificationMethod converts echo context to params.

func (*ServerInterfaceWrapper) ConflictedDIDs

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

ConflictedDIDs converts echo context to params.

func (*ServerInterfaceWrapper) CreateDID

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

CreateDID converts echo context to params.

func (*ServerInterfaceWrapper) DeactivateDID

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

DeactivateDID converts echo context to params.

func (*ServerInterfaceWrapper) DeleteVerificationMethod

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

DeleteVerificationMethod converts echo context to params.

func (*ServerInterfaceWrapper) GetDID

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

GetDID converts echo context to params.

func (*ServerInterfaceWrapper) UpdateDID

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

UpdateDID converts echo context to params.

type UpdateDIDJSONBody

type UpdateDIDJSONBody DIDUpdateRequest

UpdateDIDJSONBody defines parameters for UpdateDID.

type UpdateDIDJSONRequestBody

type UpdateDIDJSONRequestBody UpdateDIDJSONBody

UpdateDIDJSONRequestBody defines body for UpdateDID for application/json ContentType.

type UpdateDIDResponse

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

func ParseUpdateDIDResponse

func ParseUpdateDIDResponse(rsp *http.Response) (*UpdateDIDResponse, error)

ParseUpdateDIDResponse parses an HTTP response from a UpdateDIDWithResponse call

func (UpdateDIDResponse) Status

func (r UpdateDIDResponse) Status() string

Status returns HTTPResponse.Status

func (UpdateDIDResponse) StatusCode

func (r UpdateDIDResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Wrapper

type Wrapper struct {
	VDR            types.VDR
	DocManipulator types.DocManipulator
	DocResolver    types.DocResolver
}

Wrapper is needed to connect the implementation to the echo ServiceWrapper

func (*Wrapper) AddNewVerificationMethod

func (a *Wrapper) AddNewVerificationMethod(ctx echo.Context, id string) error

AddNewVerificationMethod accepts a DID and adds a new VerificationMethod to that corresponding document.

func (*Wrapper) ConflictedDIDs

func (a *Wrapper) ConflictedDIDs(ctx echo.Context) error

func (Wrapper) CreateDID

func (a Wrapper) CreateDID(ctx echo.Context) error

CreateDID creates a new DID Document and returns it.

func (*Wrapper) DeactivateDID

func (a *Wrapper) DeactivateDID(ctx echo.Context, targetDID string) error

DeactivateDID deactivates a DID Document given a DID. It returns a 200 and an empty body if the deactivation was successful.

func (*Wrapper) DeleteVerificationMethod

func (a *Wrapper) DeleteVerificationMethod(ctx echo.Context, didStr string, kidStr string) error

DeleteVerificationMethod accepts a DID and a KeyIdentifier of a verificationMethod and calls the DocManipulator to remove the verificationMethod from the given document.

func (*Wrapper) GetDID

func (a *Wrapper) GetDID(ctx echo.Context, targetDID string, params GetDIDParams) error

GetDID returns a DID document and DID document metadata based on a DID.

func (*Wrapper) Preprocess

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

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

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)

func (Wrapper) UpdateDID

func (a Wrapper) UpdateDID(ctx echo.Context, targetDID string) error

UpdateDID updates a DID Document given a DID and DID Document body. It returns the updated DID Document.

Jump to

Keyboard shortcuts

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