notification

package
v0.61.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UUIDKey                 = "notification_uuid"
	RequestReferenceUUIDKey = "request_reference_uuid"
	NameKey                 = "notification_name"
)

Variables

This section is empty.

Functions

func EncodeMoneysocketNotification

func EncodeMoneysocketNotification(msg MoneysocketNotification, toEncode map[string]interface{}) error

func FromText added in v0.54.0

func FromText(payload []byte) (base.MoneysocketMessage, base.MessageType, error)

Types

type BaseMoneySocketNotification

type BaseMoneySocketNotification struct {
	base.MoneysocketMessage
	// BaseNotificationUUID is the uuid for this message
	BaseNotificationUUID string
	// BaseRequestReferenceUUID is the request reference id
	BaseRequestReferenceUUID string
	// contains filtered or unexported fields
}

BaseMoneySocketNotification is the notification type

func DecodeRequest

func DecodeRequest(request []byte) (b BaseMoneySocketNotification, err error)

func NewBaseMoneySocketNotification

func NewBaseMoneySocketNotification(notificationType base.MessageType, requestUUID string) BaseMoneySocketNotification

func (BaseMoneySocketNotification) MessageClass

func (BaseMoneySocketNotification) NotificationName

func (b BaseMoneySocketNotification) NotificationName() string

func (BaseMoneySocketNotification) NotificationUUID added in v0.54.0

func (b BaseMoneySocketNotification) NotificationUUID() string

func (BaseMoneySocketNotification) RequestReferenceUUID added in v0.54.0

func (b BaseMoneySocketNotification) RequestReferenceUUID() string

func (BaseMoneySocketNotification) RequestType

type Item

type Item struct {
	// item id
	ItemID string `json:"item_id"`
	// name of the item
	Name string `json:"name"`
	// msats in the message
	Msats int `json:"msats"`
}

item from the seller

type MoneysocketNotification

type MoneysocketNotification interface {
	base.MoneysocketMessage
	// get the notification uuid
	NotificationUUID() string
	RequestReferenceUUID() string
	NotificationName() string
	RequestType() base.MessageType
}

type NotifyInvoice

type NotifyInvoice struct {
	BaseMoneySocketNotification
	Bolt11 string
}

func DecodeNotifyInvoice

func DecodeNotifyInvoice(payload []byte) (NotifyInvoice, error)

func NewNotifyInvoice

func NewNotifyInvoice(bolt11, requestUUID string) NotifyInvoice

func (NotifyInvoice) IsValid

func (o NotifyInvoice) IsValid() (bool, error)

func (NotifyInvoice) MustBeClearText

func (o NotifyInvoice) MustBeClearText() bool

func (NotifyInvoice) ToJSON added in v0.54.0

func (o NotifyInvoice) ToJSON() ([]byte, error)

type NotifyOpinionInvoice

type NotifyOpinionInvoice struct {
	BaseMoneySocketNotification
	Bolt11 string
}

func DecodeNotifyOpinionInvoice

func DecodeNotifyOpinionInvoice(payload []byte) (NotifyOpinionInvoice, error)

func NewNotifyOpinionInvoice

func NewNotifyOpinionInvoice(requestUUID, bolt11 string) NotifyOpinionInvoice

func (NotifyOpinionInvoice) ToJSON added in v0.54.0

func (n NotifyOpinionInvoice) ToJSON() ([]byte, error)

type NotifyOpinionSeller

type NotifyOpinionSeller struct {
	BaseMoneySocketNotification
	// contains filtered or unexported fields
}

func DecodeNotifyOpinionSeller

func DecodeNotifyOpinionSeller(payload []byte) (NotifyOpinionSeller, error)

func NewNotifyOpinionSeller

func NewNotifyOpinionSeller(sellerUUID string, items []Item, requestReferenceUUID string) NotifyOpinionSeller

func (NotifyOpinionSeller) ToJSON added in v0.54.0

func (o NotifyOpinionSeller) ToJSON() ([]byte, error)

type NotifyOpinionSellerNotReady

type NotifyOpinionSellerNotReady struct {
	BaseMoneySocketNotification
}

func DecodeNotifyOpinionSellerNotReady

func DecodeNotifyOpinionSellerNotReady(payload []byte) (NotifyOpinionSellerNotReady, error)

func NewNotifyOpinionSellerNotReady

func NewNotifyOpinionSellerNotReady(requestUUID string) NotifyOpinionSellerNotReady

create a new rendezvous end notification with a given rendezvous id

func (NotifyOpinionSellerNotReady) MustBeClearText

func (r NotifyOpinionSellerNotReady) MustBeClearText() bool

func (NotifyOpinionSellerNotReady) ToJSON added in v0.54.0

func (r NotifyOpinionSellerNotReady) ToJSON() ([]byte, error)

type NotifyPong

type NotifyPong struct {
	BaseMoneySocketNotification
}

func DecodeNotifyPong

func DecodeNotifyPong(payload []byte) (NotifyPong, error)

func NewNotifyPong

func NewNotifyPong(requestUUID string) NotifyPong

func (NotifyPong) ToJSON added in v0.54.0

func (n NotifyPong) ToJSON() ([]byte, error)

type NotifyPreimage

type NotifyPreimage struct {
	BaseMoneySocketNotification
	Preimage string
	Ext      string
}

func NewNotifyPreimage

func NewNotifyPreimage(preimage, ext, requestUUID string) NotifyPreimage

func (NotifyPreimage) IsValid

func (n NotifyPreimage) IsValid() (bool, error)

func (NotifyPreimage) MustBeClearText

func (n NotifyPreimage) MustBeClearText() bool

func (NotifyPreimage) ToJSON added in v0.54.0

func (n NotifyPreimage) ToJSON() ([]byte, error)

type NotifyProvider

type NotifyProvider struct {
	BaseMoneySocketNotification
	// account uuid
	AccountUUID string
	// provider pay outgoing invoice
	Payer bool
	// provider generates invoices for incoming payments
	Payee bool
	// balance to advertize as being available
	Wad wad.Wad
}

func NewNotifyProvider

func NewNotifyProvider(accountUUID string, payer, payee bool, wad wad.Wad, requestUUID string) NotifyProvider

func (NotifyProvider) MustBeClearText

func (n NotifyProvider) MustBeClearText() bool

func (NotifyProvider) ToJSON added in v0.54.0

func (n NotifyProvider) ToJSON() ([]byte, error)

type NotifyProviderNotReady

type NotifyProviderNotReady struct {
	BaseMoneySocketNotification
}

func DecodeNotifyProviderNotReady

func DecodeNotifyProviderNotReady(payload []byte) (NotifyProviderNotReady, error)

func NewNotifyProviderNotReady

func NewNotifyProviderNotReady(requestUUID string) NotifyProviderNotReady

func (NotifyProviderNotReady) ToJSON added in v0.54.0

func (n NotifyProviderNotReady) ToJSON() ([]byte, error)

type Rendezvous

type Rendezvous struct {
	BaseMoneySocketNotification
	// contains filtered or unexported fields
}

func DecodeRendezvous

func DecodeRendezvous(payload []byte) (Rendezvous, error)

func NewNotifyRendezvous

func NewNotifyRendezvous(rid, requestUUID string) Rendezvous

create a new rendezvous end notification with a given rendezvous id

func (Rendezvous) MustBeClearText

func (r Rendezvous) MustBeClearText() bool

func (Rendezvous) ToJSON added in v0.54.0

func (r Rendezvous) ToJSON() ([]byte, error)

type RendezvousEnd

type RendezvousEnd struct {
	BaseMoneySocketNotification
	// contains filtered or unexported fields
}

func DecodeRendezvousEnd

func DecodeRendezvousEnd(payload []byte) (RendezvousEnd, error)

func NewRendezvousEnd

func NewRendezvousEnd(rid, requestUUID string) RendezvousEnd

create a new rendezvous end notification with a given rendezvous id

func (RendezvousEnd) MustBeClearText

func (r RendezvousEnd) MustBeClearText() bool

func (RendezvousEnd) ToJSON added in v0.54.0

func (r RendezvousEnd) ToJSON() ([]byte, error)

type RendezvousNotReady

type RendezvousNotReady struct {
	BaseMoneySocketNotification
	// contains filtered or unexported fields
}

func DecodeRendezvousNotReady

func DecodeRendezvousNotReady(payload []byte) (RendezvousNotReady, error)

func NewRendezvousNotReady

func NewRendezvousNotReady(rid, requestUUID string) RendezvousNotReady

create a new rendezvous end notification with a given rendezvous id

func (RendezvousNotReady) MustBeClearText

func (r RendezvousNotReady) MustBeClearText() bool

func (RendezvousNotReady) ToJSON added in v0.54.0

func (r RendezvousNotReady) ToJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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