Documentation ¶
Overview ¶
Package defaultservice - Service that Milagro D-TA provides with no-plugins
Index ¶
- type Plugable
- type Service
- func (s *Service) Endpoints() (namespace string, endpoints transport.HTTPEndpoints)
- func (s *Service) FulfillOrder(req *api.FulfillOrderRequest) (*api.FulfillOrderResponse, error)
- func (s *Service) FulfillOrderSecret(req *api.FulfillOrderSecretRequest) (*api.FulfillOrderSecretResponse, error)
- func (s *Service) GetOrder(req *api.GetOrderRequest) (*api.GetOrderResponse, error)
- func (s *Service) Init(plugin Plugable, options ...ServiceOption) error
- func (s *Service) MasterFiduciaryNodeID() string
- func (s *Service) Name() string
- func (s *Service) NodeID() string
- func (s *Service) Order(req *api.OrderRequest) (*api.OrderResponse, error)
- func (s *Service) OrderList(req *api.OrderListRequest) (*api.OrderListResponse, error)
- func (s *Service) OrderSecret(req *api.OrderSecretRequest) (*api.OrderSecretResponse, error)
- func (s *Service) PrepareOrderPart1(order *documents.OrderDoc, reqExtension map[string]string) (fulfillExtension map[string]string, err error)
- func (s *Service) PrepareOrderResponse(orderPart2 *documents.OrderDoc, ...) (commitment string, extension map[string]string, err error)
- func (s *Service) ProduceBeneficiaryEncryptedData(blsSK []byte, order *documents.OrderDoc, req *api.OrderSecretRequest) (encrypted []byte, extension map[string]string, err error)
- func (s *Service) ProduceFinalSecret(seed, sikeSK []byte, order, orderPart4 *documents.OrderDoc, ...) (secret, commitment string, extension map[string]string, err error)
- func (s *Service) SetMasterFiduciaryNodeID(masterFiduciaryNodeID string)
- func (s *Service) SetNodeID(nodeID string)
- func (s *Service) Status(apiVersion, nodeType string) (*api.StatusResponse, error)
- func (s *Service) ValidateOrderRequest(req *api.OrderRequest) error
- func (s *Service) ValidateOrderSecretRequest(req *api.OrderSecretRequest, order documents.OrderDoc) error
- func (s *Service) Vendor() string
- type ServiceOption
- func WithConfig(cfg *config.Config) ServiceOption
- func WithDataStore(store *datastore.Store) ServiceOption
- func WithIPFS(ipfsConnector ipfs.Connector) ServiceOption
- func WithKeyStore(store keystore.Store) ServiceOption
- func WithLogger(logger *logger.Logger) ServiceOption
- func WithMasterFiduciary(masterFiduciaryServer api.ClientService) ServiceOption
- func WithRng(rng io.Reader) ServiceOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Plugable ¶
type Plugable interface { // service Name() string Vendor() string // order ValidateOrderRequest(req *api.OrderRequest) error ValidateOrderSecretRequest(req *api.OrderSecretRequest, order documents.OrderDoc) error PrepareOrderPart1(order *documents.OrderDoc, reqExtension map[string]string) (fulfillExtension map[string]string, err error) PrepareOrderResponse(orderPart2 *documents.OrderDoc, reqExtension, fulfillExtension map[string]string) (commitment string, extension map[string]string, err error) ProduceBeneficiaryEncryptedData(blsSK []byte, order *documents.OrderDoc, req *api.OrderSecretRequest) (encrypted []byte, extension map[string]string, err error) ProduceFinalSecret(seed, sikeSK []byte, order, orderPart4 *documents.OrderDoc, req *api.OrderSecretRequest, fulfillSecretRespomse *api.FulfillOrderSecretResponse) (secret, commitment string, extension map[string]string, err error) }
Plugable service methods
type Service ¶
type Service struct { Plugin Plugable Logger *logger.Logger Rng io.Reader Store *datastore.Store KeyStore keystore.Store Ipfs ipfs.Connector MasterFiduciaryServer api.ClientService // contains filtered or unexported fields }
Service implements the default functionality It also implements the ServicePlugin interface
func (*Service) Endpoints ¶
func (s *Service) Endpoints() (namespace string, endpoints transport.HTTPEndpoints)
Endpoints for extending the plugin endpoints
func (*Service) FulfillOrder ¶
func (s *Service) FulfillOrder(req *api.FulfillOrderRequest) (*api.FulfillOrderResponse, error)
FulfillOrder -
func (*Service) FulfillOrderSecret ¶
func (s *Service) FulfillOrderSecret(req *api.FulfillOrderSecretRequest) (*api.FulfillOrderSecretResponse, error)
FulfillOrderSecret -
func (*Service) GetOrder ¶
func (s *Service) GetOrder(req *api.GetOrderRequest) (*api.GetOrderResponse, error)
GetOrder retreives an order
func (*Service) Init ¶
func (s *Service) Init(plugin Plugable, options ...ServiceOption) error
Init sets-up the service options. It's called when the plugin gets registered
func (*Service) MasterFiduciaryNodeID ¶
MasterFiduciaryNodeID returns the Master Fiduciary NodeID
func (*Service) Order ¶
func (s *Service) Order(req *api.OrderRequest) (*api.OrderResponse, error)
Order -
func (*Service) OrderList ¶
func (s *Service) OrderList(req *api.OrderListRequest) (*api.OrderListResponse, error)
OrderList retrieves the list of orders
func (*Service) OrderSecret ¶
func (s *Service) OrderSecret(req *api.OrderSecretRequest) (*api.OrderSecretResponse, error)
OrderSecret -
func (*Service) PrepareOrderPart1 ¶
func (s *Service) PrepareOrderPart1(order *documents.OrderDoc, reqExtension map[string]string) (fulfillExtension map[string]string, err error)
PrepareOrderPart1 is called before the order is send
func (*Service) PrepareOrderResponse ¶
func (s *Service) PrepareOrderResponse(orderPart2 *documents.OrderDoc, reqExtension, fulfillExtension map[string]string) (commitment string, extension map[string]string, err error)
PrepareOrderResponse gets the updated order and returns the commitment and extension
func (*Service) ProduceBeneficiaryEncryptedData ¶
func (s *Service) ProduceBeneficiaryEncryptedData(blsSK []byte, order *documents.OrderDoc, req *api.OrderSecretRequest) (encrypted []byte, extension map[string]string, err error)
ProduceBeneficiaryEncryptedData -
func (*Service) ProduceFinalSecret ¶
func (s *Service) ProduceFinalSecret(seed, sikeSK []byte, order, orderPart4 *documents.OrderDoc, req *api.OrderSecretRequest, fulfillSecretRespomse *api.FulfillOrderSecretResponse) (secret, commitment string, extension map[string]string, err error)
ProduceFinalSecret -
func (*Service) SetMasterFiduciaryNodeID ¶
SetMasterFiduciaryNodeID sets the Master Fiduciary NodeID
func (*Service) Status ¶
func (s *Service) Status(apiVersion, nodeType string) (*api.StatusResponse, error)
Status of the server
func (*Service) ValidateOrderRequest ¶
func (s *Service) ValidateOrderRequest(req *api.OrderRequest) error
ValidateOrderRequest returns error if the request values are invalid
func (*Service) ValidateOrderSecretRequest ¶
func (s *Service) ValidateOrderSecretRequest(req *api.OrderSecretRequest, order documents.OrderDoc) error
ValidateOrderSecretRequest - Validate fields in the Order Secret
type ServiceOption ¶
ServiceOption function to set Service properties
func WithConfig ¶
func WithConfig(cfg *config.Config) ServiceOption
WithConfig adds config settings to the Service
func WithDataStore ¶
func WithDataStore(store *datastore.Store) ServiceOption
WithDataStore adds store to the Service
func WithIPFS ¶
func WithIPFS(ipfsConnector ipfs.Connector) ServiceOption
WithIPFS adds ipfs connector to the Service
func WithKeyStore ¶
func WithKeyStore(store keystore.Store) ServiceOption
WithKeyStore adds store to the Service
func WithLogger ¶
func WithLogger(logger *logger.Logger) ServiceOption
WithLogger adds logger to the Service
func WithMasterFiduciary ¶
func WithMasterFiduciary(masterFiduciaryServer api.ClientService) ServiceOption
WithMasterFiduciary adds master fiduciary connector to the Service