Documentation ¶
Overview ¶
nolint
Index ¶
- Constants
- func Register(ctx map[string]interface{}, r chi.Router)
- func Webhook(http.ResponseWriter, *http.Request)
- type Bootstrapper
- type CreateEntityRequest
- type CreateTransferDetailRequest
- type EntityDataResponse
- type EntityResponse
- type FundingDataResponse
- type FundingListResponse
- type FundingRequest
- type FundingResponse
- type NFTMintInvoiceUnpaidRequest
- type NFTMintResponse
- type Relationship
- type ResponseHeader
- type Service
- func (s Service) CreateEntity(ctx context.Context, req CreateEntityRequest) (documents.Model, jobs.JobID, error)
- func (s Service) CreateFundingAgreement(ctx context.Context, docID []byte, data *funding.Data) (documents.Model, jobs.JobID, error)
- func (s Service) CreateTransferDetail(ctx context.Context, req transferdetails.CreateTransferDetailRequest) (documents.Model, jobs.JobID, error)
- func (s Service) GetCurrentTransferDetail(ctx context.Context, docID, transferID []byte) (*transferdetails.TransferDetail, documents.Model, error)
- func (s Service) GetCurrentTransferDetailsList(ctx context.Context, docID []byte) (*transferdetails.TransferDetailList, documents.Model, error)
- func (s Service) GetEntity(ctx context.Context, docID []byte) (documents.Model, error)
- func (s Service) GetEntityByRelationship(ctx context.Context, docID []byte) (documents.Model, error)
- func (s Service) GetVersionTransferDetail(ctx context.Context, docID, versionID, transferID []byte) (*transferdetails.TransferDetail, documents.Model, error)
- func (s Service) GetVersionTransferDetailsList(ctx context.Context, docID, versionID []byte) (*transferdetails.TransferDetailList, documents.Model, error)
- func (s Service) RevokeRelationship(ctx context.Context, docID []byte, req ShareEntityRequest) (documents.Model, jobs.JobID, error)
- func (s Service) ShareEntity(ctx context.Context, docID []byte, req ShareEntityRequest) (documents.Model, jobs.JobID, error)
- func (s Service) UpdateEntity(ctx context.Context, docID []byte, req CreateEntityRequest) (documents.Model, jobs.JobID, error)
- func (s Service) UpdateTransferDetail(ctx context.Context, req transferdetails.UpdateTransferDetailRequest) (documents.Model, jobs.JobID, error)
- type ShareEntityRequest
- type ShareEntityResponse
- type TransferDetailListResponse
- type TransferDetailResponse
- type UpdateTransferDetailRequest
Constants ¶
const BootstrappedUserAPIService = "UserAPI Service"
BootstrappedUserAPIService key maps to the Service implementation in Bootstrap context.
const ErrInvalidAgreementID = errors.Error("Invalid funding agreement ID")
ErrInvalidAgreementID is a sentinel error when the agreement ID is invalid.
Variables ¶
This section is empty.
Functions ¶
func Webhook ¶
func Webhook(http.ResponseWriter, *http.Request)
Webhook is a place holder to describe webhook response in swagger @summary Webhook is a place holder to describe webhook response in swagger. @description Webhook is a place holder to describe webhook response in swagger. @id webhook @tags Webhook @accept json @produce json @success 200 {object} notification.Message @router /webhook [post]
Types ¶
type Bootstrapper ¶
type Bootstrapper struct{}
Bootstrapper implements bootstrap.Bootstrapper.
func (Bootstrapper) Bootstrap ¶
func (b Bootstrapper) Bootstrap(ctx map[string]interface{}) error
Bootstrap adds transaction.Repository into context.
type CreateEntityRequest ¶
type CreateEntityRequest struct { ReadAccess []identity.DID `json:"read_access" swaggertype:"array,string"` WriteAccess []identity.DID `json:"write_access" swaggertype:"array,string"` Data entity.Data `json:"data"` Attributes coreapi.AttributeMapRequest `json:"attributes"` }
CreateEntityRequest holds details for creating Entity Document.
type CreateTransferDetailRequest ¶
type CreateTransferDetailRequest struct { DocumentID string `json:"document_id"` Data transferdetails.Data `json:"data"` }
CreateTransferDetailRequest is the request body for creating a Transfer Detail
type EntityDataResponse ¶
type EntityDataResponse struct { Entity entity.Data `json:"entity"` Relationships []Relationship `json:"relationships"` }
EntityDataResponse holds the entity data and Relationships
type EntityResponse ¶
type EntityResponse struct { Header coreapi.ResponseHeader `json:"header"` Data EntityDataResponse `json:"data"` Attributes coreapi.AttributeMapResponse `json:"attributes"` }
EntityResponse represents the entity in client API format.
type FundingDataResponse ¶
type FundingDataResponse struct { Funding funding.Data `json:"funding"` Signatures []funding.Signature `json:"signatures"` }
FundingDataResponse holds funding data and the signatures.
type FundingListResponse ¶
type FundingListResponse struct { Header coreapi.ResponseHeader `json:"header"` Data []FundingDataResponse `json:"data"` }
FundingListResponse holds the response for funding agreements.
type FundingRequest ¶
FundingRequest is the request payload for funding operations.
type FundingResponse ¶
type FundingResponse struct { Header coreapi.ResponseHeader `json:"header"` Data FundingDataResponse `json:"data"` }
FundingResponse holds the response for funding operations.
type NFTMintInvoiceUnpaidRequest ¶
type NFTMintInvoiceUnpaidRequest struct { // Deposit address for NFT Token created DepositAddress common.Address `json:"deposit_address" swaggertype:"primitive,string"` }
NFTMintInvoiceUnpaidRequest is the request for minting an NFT for an unpaid NFT
type NFTMintResponse ¶
type NFTMintResponse struct {
Header *ResponseHeader `json:"header"`
}
NFTMintResponse is response from user api NFT minting
type Relationship ¶
type Relationship struct { TargetIdentity identity.DID `json:"target_identity" swaggertype:"primitive,string"` OwnerIdentity identity.DID `json:"owner_identity" swaggertype:"primitive,string"` EntityIdentifier byteutils.HexBytes `json:"entity_identifier" swaggertype:"primitive,string"` Active bool `json:"active"` }
Relationship holds the identity and status of the relationship
type ResponseHeader ¶
type ResponseHeader struct {
JobID string `json:"job_id"`
}
ResponseHeader header with job id
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides functionality for User APIs.
func (Service) CreateEntity ¶
func (s Service) CreateEntity(ctx context.Context, req CreateEntityRequest) (documents.Model, jobs.JobID, error)
CreateEntity creates Entity document and anchors it.
func (Service) CreateFundingAgreement ¶
func (s Service) CreateFundingAgreement(ctx context.Context, docID []byte, data *funding.Data) (documents.Model, jobs.JobID, error)
CreateFundingAgreement creates a new funding agreement on a document and anchors the document.
func (Service) CreateTransferDetail ¶
func (s Service) CreateTransferDetail(ctx context.Context, req transferdetails.CreateTransferDetailRequest) (documents.Model, jobs.JobID, error)
CreateTransferDetail creates and anchors a Transfer Detail
func (Service) GetCurrentTransferDetail ¶
func (s Service) GetCurrentTransferDetail(ctx context.Context, docID, transferID []byte) (*transferdetails.TransferDetail, documents.Model, error)
GetCurrentTransferDetail returns the current version on a Transfer Detail
func (Service) GetCurrentTransferDetailsList ¶
func (s Service) GetCurrentTransferDetailsList(ctx context.Context, docID []byte) (*transferdetails.TransferDetailList, documents.Model, error)
GetCurrentTransferDetailsList returns a list of Transfer Details on the current version of a document
func (Service) GetEntityByRelationship ¶
func (s Service) GetEntityByRelationship(ctx context.Context, docID []byte) (documents.Model, error)
GetEntityByRelationship returns an entity through a relationship ID.
func (Service) GetVersionTransferDetail ¶
func (s Service) GetVersionTransferDetail(ctx context.Context, docID, versionID, transferID []byte) (*transferdetails.TransferDetail, documents.Model, error)
GetVersionTransferDetail returns a Transfer Detail on a particular version of a Document
func (Service) GetVersionTransferDetailsList ¶
func (s Service) GetVersionTransferDetailsList(ctx context.Context, docID, versionID []byte) (*transferdetails.TransferDetailList, documents.Model, error)
GetVersionTransferDetailsList returns a list of Transfer Details on a particular version of a Document
func (Service) RevokeRelationship ¶
func (s Service) RevokeRelationship(ctx context.Context, docID []byte, req ShareEntityRequest) (documents.Model, jobs.JobID, error)
RevokeRelationship revokes target_identity's access to entity.
func (Service) ShareEntity ¶
func (s Service) ShareEntity(ctx context.Context, docID []byte, req ShareEntityRequest) (documents.Model, jobs.JobID, error)
ShareEntity shares an entity relationship document with target identity.
func (Service) UpdateEntity ¶
func (s Service) UpdateEntity(ctx context.Context, docID []byte, req CreateEntityRequest) (documents.Model, jobs.JobID, error)
UpdateEntity updates existing entity associated with docID with provided data and anchors it.
func (Service) UpdateTransferDetail ¶
func (s Service) UpdateTransferDetail(ctx context.Context, req transferdetails.UpdateTransferDetailRequest) (documents.Model, jobs.JobID, error)
UpdateTransferDetail updates and anchors a Transfer Detail
type ShareEntityRequest ¶
type ShareEntityRequest struct {
}ShareEntityRequest holds the documentID and target identity to share entity with.
type ShareEntityResponse ¶
type ShareEntityResponse struct {}
ShareEntityResponse holds the response for entity share.
type TransferDetailListResponse ¶
type TransferDetailListResponse struct { Header coreapi.ResponseHeader `json:"header"` Data []transferdetails.Data `json:"data"` }
TransferDetailListResponse is the response body when fetching a list of Transfer Details
type TransferDetailResponse ¶
type TransferDetailResponse struct { Header coreapi.ResponseHeader `json:"header"` Data transferdetails.Data `json:"data"` }
TransferDetailResponse is the response body when fetching a Transfer Detail
type UpdateTransferDetailRequest ¶
type UpdateTransferDetailRequest struct { DocumentID string `json:"document_id"` TransferID string `json:"transfer_id"` Data transferdetails.Data `json:"data"` }
UpdateTransferDetailRequest is the request body for updating a Transfer Detail