Documentation ¶
Index ¶
- type ConsumerStack
- func (c *ConsumerStack) AnnounceNexus(belowNexus nexusHelper.Nexus)
- func (c *ConsumerStack) OnInvoice(transactNexus nexusHelper.Nexus, invoice string, requestReferenceUUID string)
- func (c *ConsumerStack) OnPing(transactNexus nexusHelper.Nexus, msecs int)
- func (c *ConsumerStack) OnPreImage(transactNexus nexusHelper.Nexus, preimage, requestReferenceUUID string)
- func (c *ConsumerStack) OnProviderInfo(consumerTransactNexus nexusHelper.Nexus, ...)
- func (c *ConsumerStack) RequestInvoice(msats int64, overrideRequestUUID, description string)
- func (c *ConsumerStack) RequestPay(bolt11, overrideRequestUUID string)
- func (c *ConsumerStack) RevokeNexus(belowNexus nexusHelper.Nexus)
- func (c *ConsumerStack) SendStackEvent(layerName string, nexus nexusHelper.Nexus, event string)
- func (c *ConsumerStack) SetOnInvoice(invoice nexus_transact.OnInvoice)
- func (c *ConsumerStack) SetOnPing(ping consumerNexus.OnPingFn)
- func (c *ConsumerStack) SetOnPreimage(preimage nexus_transact.OnPreimage)
- func (c *ConsumerStack) SetOnProviderInfo(info nexus_transact.OnProviderInfo)
- func (c *ConsumerStack) SetSendStackEvent(handler layer.OnLayerEventFn)
- func (c *ConsumerStack) SetupConsumerLayer(belowLayer layer.Base)
- func (c *ConsumerStack) SetupTransactLayer(belowLayer layer.Base)
- type IncomingStack
- func (i *IncomingStack) AnnounceNexus(belowNexus nexusHelper.Nexus)
- func (i *IncomingStack) GetListenLocations() []location.Location
- func (i *IncomingStack) GetListenURL() string
- func (i *IncomingStack) Listen() error
- func (i *IncomingStack) RegisterAboveLayer(belowLayer layer.Base)
- func (i *IncomingStack) RevokeNexus(nexus nexusHelper.Nexus)
- func (i *IncomingStack) SendStackEvent(layerName string, nexus nexusHelper.Nexus, event string)
- func (i *IncomingStack) SetupLocalLayer(outgoingLocalLayer *local.OutgoingLocalLayer)
- func (i *IncomingStack) SetupRelayLayer(rendezvousLayer *rendezvous.IncomingRendezvousLayer)
- func (i *IncomingStack) SetupRendezvousLayer(belowLayer1 layer.Base, belowLayer2 layer.Base)
- func (i *IncomingStack) SetupWebsocketLayer()
- type OutgoingConsumerStack
- type SellerStack
- func (s *SellerStack) AnnounceNexus(belowNexus nexus.Nexus)
- func (s *SellerStack) DoDisconnect()
- func (s *SellerStack) HandleInvoiceRequest(msats int64, requestUUID string)
- func (s *SellerStack) HandleOpinionInvoiceRequest(itemID, requestUUID string)
- func (s *SellerStack) ProviderNowReadyFromApp()
- func (s *SellerStack) RevokeNexus(belowNexus nexus.Nexus)
- func (s *SellerStack) SellerNowReadyFromApp()
- func (s *SellerStack) SetHandleInvoiceRequest(handleInvoice func(msats int64, requestUuid string))
- func (s *SellerStack) SetHandleOpinionInvoiceRequest(handler func(item string, requestUuid string))
- func (s *SellerStack) SetHandlePayRequest(handlePayRequest func(msats int64, requestUuid string))
- func (s *SellerStack) SetHandleProviderInfoRequest(hpr compat.HandleProviderInfoRequest)
- func (s *SellerStack) SetHandleSellerInfoRequest(handler func() nexusSeller.Info)
- func (s *SellerStack) SetOnStackEvent(onEvent func(layerName string, nexus nexus.Nexus, status string))
- func (s *SellerStack) SetupOutgoingRendezvousLayer()
- func (s *SellerStack) SetupOutgoingWebsocketLayer()
- func (s *SellerStack) SetupProviderLayer()
- func (s *SellerStack) SetupProviderTransactLayer()
- func (s *SellerStack) SetupSellerLayer()
- func (s *SellerStack) UpdatePrices()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsumerStack ¶
ConsumerStack handles various events passed from/to child classes.
func NewConsumerStack ¶
func NewConsumerStack() *ConsumerStack
NewConsumerStack creates a new ConsumerStack.
func (*ConsumerStack) AnnounceNexus ¶
func (c *ConsumerStack) AnnounceNexus(belowNexus nexusHelper.Nexus)
AnnounceNexus announces a nexus.
func (*ConsumerStack) OnInvoice ¶
func (c *ConsumerStack) OnInvoice(transactNexus nexusHelper.Nexus, invoice string, requestReferenceUUID string)
OnInvoice calls the on invoice function.
func (*ConsumerStack) OnPing ¶
func (c *ConsumerStack) OnPing(transactNexus nexusHelper.Nexus, msecs int)
OnPing sends a ping.
func (*ConsumerStack) OnPreImage ¶
func (c *ConsumerStack) OnPreImage(transactNexus nexusHelper.Nexus, preimage, requestReferenceUUID string)
OnPreImage call on preimage function.
func (*ConsumerStack) OnProviderInfo ¶
func (c *ConsumerStack) OnProviderInfo(consumerTransactNexus nexusHelper.Nexus, msg moneysocket_message.MoneysocketMessage)
OnProviderInfo handles a provider info event.
func (*ConsumerStack) RequestInvoice ¶
func (c *ConsumerStack) RequestInvoice(msats int64, overrideRequestUUID, description string)
RequestInvoice requests an invoice for a given sat count.
func (*ConsumerStack) RequestPay ¶
func (c *ConsumerStack) RequestPay(bolt11, overrideRequestUUID string)
RequestPay requests the lnd client to pay an invoice.
func (*ConsumerStack) RevokeNexus ¶
func (c *ConsumerStack) RevokeNexus(belowNexus nexusHelper.Nexus)
RevokeNexus removes the nexus from directories/layers. Calls OnRevoke.
func (*ConsumerStack) SendStackEvent ¶
func (c *ConsumerStack) SendStackEvent(layerName string, nexus nexusHelper.Nexus, event string)
SendStackEvent sends a stack event.
func (*ConsumerStack) SetOnInvoice ¶
func (c *ConsumerStack) SetOnInvoice(invoice nexus_transact.OnInvoice)
SetOnInvoice sets function to be called when on invoice is called.
func (*ConsumerStack) SetOnPing ¶
func (c *ConsumerStack) SetOnPing(ping consumerNexus.OnPingFn)
SetOnPing sets function to be called when onPreImage is called.
func (*ConsumerStack) SetOnPreimage ¶
func (c *ConsumerStack) SetOnPreimage(preimage nexus_transact.OnPreimage)
SetOnPreimage sets function to be called when onPreImage is called.
func (*ConsumerStack) SetOnProviderInfo ¶
func (c *ConsumerStack) SetOnProviderInfo(info nexus_transact.OnProviderInfo)
SetOnProviderInfo sets function to be called when OnProviderInfo is called.
func (*ConsumerStack) SetSendStackEvent ¶
func (c *ConsumerStack) SetSendStackEvent(handler layer.OnLayerEventFn)
SetSendStackEvent sets a send stack callback.
func (*ConsumerStack) SetupConsumerLayer ¶
func (c *ConsumerStack) SetupConsumerLayer(belowLayer layer.Base)
SetupConsumerLayer sets up a consumer layer.
func (*ConsumerStack) SetupTransactLayer ¶
func (c *ConsumerStack) SetupTransactLayer(belowLayer layer.Base)
SetupTransactLayer sets up a transact layer.
type IncomingStack ¶
IncomingStack handles incoming connections.
func NewIncomingStack ¶
func NewIncomingStack(config *config.Config, outgoingLocalLayer *local.OutgoingLocalLayer) *IncomingStack
NewIncomingStack creates a new incoming stack.
func (*IncomingStack) AnnounceNexus ¶
func (i *IncomingStack) AnnounceNexus(belowNexus nexusHelper.Nexus)
AnnounceNexus does nothing. It is here to satisfy the interface since IncomingStack must act as a layer.
func (*IncomingStack) GetListenLocations ¶
func (i *IncomingStack) GetListenLocations() []location.Location
GetListenLocations returns a websocket location object from config.
func (*IncomingStack) GetListenURL ¶ added in v0.54.0
func (i *IncomingStack) GetListenURL() string
GetListenURL gets a listen url.
func (*IncomingStack) Listen ¶
func (i *IncomingStack) Listen() error
Listen listens on a given port TODO implement tls config.
func (*IncomingStack) RegisterAboveLayer ¶
func (i *IncomingStack) RegisterAboveLayer(belowLayer layer.Base)
RegisterAboveLayer does nothing. It is here to satisfy the interface since IncomingStack must act as a layer.
func (*IncomingStack) RevokeNexus ¶
func (i *IncomingStack) RevokeNexus(nexus nexusHelper.Nexus)
RevokeNexus does nothing. It is here to satisfy the interface since IncomingStack acts as a layer.
func (*IncomingStack) SendStackEvent ¶
func (i *IncomingStack) SendStackEvent(layerName string, nexus nexusHelper.Nexus, event string)
SendStackEvent does nothing in this context.
func (*IncomingStack) SetupLocalLayer ¶
func (i *IncomingStack) SetupLocalLayer(outgoingLocalLayer *local.OutgoingLocalLayer)
SetupLocalLayer sets up the outgoing local layer.
func (*IncomingStack) SetupRelayLayer ¶
func (i *IncomingStack) SetupRelayLayer(rendezvousLayer *rendezvous.IncomingRendezvousLayer)
SetupRelayLayer sets up the relay layer.
func (*IncomingStack) SetupRendezvousLayer ¶
func (i *IncomingStack) SetupRendezvousLayer(belowLayer1 layer.Base, belowLayer2 layer.Base)
SetupRendezvousLayer sets up the rendezvous layer.
func (*IncomingStack) SetupWebsocketLayer ¶
func (i *IncomingStack) SetupWebsocketLayer()
SetupWebsocketLayer sets up the websocket layer.
type OutgoingConsumerStack ¶
type OutgoingConsumerStack struct { *ConsumerStack // contains filtered or unexported fields }
OutgoingConsumerStack provides an interoperable interface to connect to a given beacon currently it only supports the websocket layer.
func NewOutgoingConsumerStack ¶
func NewOutgoingConsumerStack() *OutgoingConsumerStack
NewOutgoingConsumerStack creates and initialize an outgoing consumer stack.
func (*OutgoingConsumerStack) DoConnect ¶
func (o *OutgoingConsumerStack) DoConnect(connectBeacon beacon.Beacon) error
DoConnect connects to the given beacon.
func (*OutgoingConsumerStack) SetupRendezvousLayer ¶
func (o *OutgoingConsumerStack) SetupRendezvousLayer(belowLayer layer.Base)
SetupRendezvousLayer sets up the rendezvous layer.
func (*OutgoingConsumerStack) SetupWebsocketLayer ¶
func (o *OutgoingConsumerStack) SetupWebsocketLayer()
SetupWebsocketLayer sets up the websocket layer.
type SellerStack ¶
SellerStack is the stack used for opinion selling.
func (*SellerStack) AnnounceNexus ¶
func (s *SellerStack) AnnounceNexus(belowNexus nexus.Nexus)
AnnounceNexus handles announcing nexus events.
func (*SellerStack) DoDisconnect ¶
func (s *SellerStack) DoDisconnect()
DoDisconnect disconnects the websocket.
func (*SellerStack) HandleInvoiceRequest ¶
func (s *SellerStack) HandleInvoiceRequest(msats int64, requestUUID string)
HandleInvoiceRequest handles invoice requests.
func (*SellerStack) HandleOpinionInvoiceRequest ¶
func (s *SellerStack) HandleOpinionInvoiceRequest(itemID, requestUUID string)
HandleOpinionInvoiceRequest handles opinion invoice requests.
func (*SellerStack) ProviderNowReadyFromApp ¶
func (s *SellerStack) ProviderNowReadyFromApp()
ProviderNowReadyFromApp sets the provider ready.
func (*SellerStack) RevokeNexus ¶
func (s *SellerStack) RevokeNexus(belowNexus nexus.Nexus)
RevokeNexus handles nexus revokes.
func (*SellerStack) SellerNowReadyFromApp ¶
func (s *SellerStack) SellerNowReadyFromApp()
SellerNowReadyFromApp handles notifying the seller layer the stack is ready.
func (*SellerStack) SetHandleInvoiceRequest ¶
func (s *SellerStack) SetHandleInvoiceRequest(handleInvoice func(msats int64, requestUuid string))
SetHandleInvoiceRequest sets handler invoices.
func (*SellerStack) SetHandleOpinionInvoiceRequest ¶
func (s *SellerStack) SetHandleOpinionInvoiceRequest(handler func(item string, requestUuid string))
SetHandleOpinionInvoiceRequest sets the invoice request method.
func (*SellerStack) SetHandlePayRequest ¶
func (s *SellerStack) SetHandlePayRequest(handlePayRequest func(msats int64, requestUuid string))
SetHandlePayRequest sets pay requests.
func (*SellerStack) SetHandleProviderInfoRequest ¶
func (s *SellerStack) SetHandleProviderInfoRequest(hpr compat.HandleProviderInfoRequest)
SetHandleProviderInfoRequest sets the hrp.
func (*SellerStack) SetHandleSellerInfoRequest ¶
func (s *SellerStack) SetHandleSellerInfoRequest(handler func() nexusSeller.Info)
SetHandleSellerInfoRequest sets the seller info request.
func (*SellerStack) SetOnStackEvent ¶
func (s *SellerStack) SetOnStackEvent(onEvent func(layerName string, nexus nexus.Nexus, status string))
SetOnStackEvent sets the stack event handler.
func (*SellerStack) SetupOutgoingRendezvousLayer ¶
func (s *SellerStack) SetupOutgoingRendezvousLayer()
SetupOutgoingRendezvousLayer sets up the rendezvous mlayer.
func (*SellerStack) SetupOutgoingWebsocketLayer ¶
func (s *SellerStack) SetupOutgoingWebsocketLayer()
SetupOutgoingWebsocketLayer sets up the websocket layer.
func (*SellerStack) SetupProviderLayer ¶
func (s *SellerStack) SetupProviderLayer()
SetupProviderLayer sets up the provider layer.
func (*SellerStack) SetupProviderTransactLayer ¶
func (s *SellerStack) SetupProviderTransactLayer()
SetupProviderTransactLayer sets up the transact layer.
func (*SellerStack) SetupSellerLayer ¶
func (s *SellerStack) SetupSellerLayer()
SetupSellerLayer sets up the seller layer/event handlers.
func (*SellerStack) UpdatePrices ¶
func (s *SellerStack) UpdatePrices()
UpdatePrices sends updates prices to the nexus.