stack

package
v0.81.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumerStack

type ConsumerStack struct {
	layer.BaseLayer
	// contains filtered or unexported fields
}

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

type IncomingStack struct {
	layer.BaseLayer
	// contains filtered or unexported fields
}

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

type SellerStack struct {
	layer.BaseLayer
	// contains filtered or unexported fields
}

SellerStack is the stack used for opinion selling.

func NewSellerStack

func NewSellerStack() *SellerStack

NewSellerStack creates a new seller stack.

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.

Jump to

Keyboard shortcuts

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