Documentation ¶
Index ¶
- Variables
- func RegisterNotificationsServer(s grpc.ServiceRegistrar, srv NotificationsServer)
- type CleanupService
- type EncryptedNotificationRequest
- func (*EncryptedNotificationRequest) Descriptor() ([]byte, []int)deprecated
- func (x *EncryptedNotificationRequest) GetBlob() []byte
- func (*EncryptedNotificationRequest) ProtoMessage()
- func (x *EncryptedNotificationRequest) ProtoReflect() protoreflect.Message
- func (x *EncryptedNotificationRequest) Reset()
- func (x *EncryptedNotificationRequest) String() string
- type NotificationService
- type NotificationsClient
- type NotificationsServer
- type PaymentReceivedPayload
- type Store
- type SubscribeNotificationsReply
- type SubscribeNotificationsRequest
- func (*SubscribeNotificationsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SubscribeNotificationsRequest) GetSignature() string
- func (x *SubscribeNotificationsRequest) GetUrl() string
- func (*SubscribeNotificationsRequest) ProtoMessage()
- func (x *SubscribeNotificationsRequest) ProtoReflect() protoreflect.Message
- func (x *SubscribeNotificationsRequest) Reset()
- func (x *SubscribeNotificationsRequest) String() string
- type UnimplementedNotificationsServer
- func (UnimplementedNotificationsServer) SubscribeNotifications(context.Context, *EncryptedNotificationRequest) (*SubscribeNotificationsReply, error)
- func (UnimplementedNotificationsServer) UnsubscribeNotifications(context.Context, *EncryptedNotificationRequest) (*UnsubscribeNotificationsReply, error)
- type UnsafeNotificationsServer
- type UnsubscribeNotificationsReply
- func (*UnsubscribeNotificationsReply) Descriptor() ([]byte, []int)deprecated
- func (*UnsubscribeNotificationsReply) ProtoMessage()
- func (x *UnsubscribeNotificationsReply) ProtoReflect() protoreflect.Message
- func (x *UnsubscribeNotificationsReply) Reset()
- func (x *UnsubscribeNotificationsReply) String() string
- type UnsubscribeNotificationsRequest
- func (*UnsubscribeNotificationsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UnsubscribeNotificationsRequest) GetSignature() string
- func (x *UnsubscribeNotificationsRequest) GetUrl() string
- func (*UnsubscribeNotificationsRequest) ProtoMessage()
- func (x *UnsubscribeNotificationsRequest) ProtoReflect() protoreflect.Message
- func (x *UnsubscribeNotificationsRequest) Reset()
- func (x *UnsubscribeNotificationsRequest) String() string
Constants ¶
This section is empty.
Variables ¶
var CleanupInterval time.Duration = time.Hour
The interval to clean unused promises and buy registrations.
var ErrInternal = fmt.Errorf("internal error")
var ExpiryDuration time.Duration = time.Hour * 24 * 28
The expiry duration is the time until a non-refreshed webhook url expires. Currently set to 4 weeks.
var File_notifications_proto protoreflect.FileDescriptor
var Notifications_ServiceDesc = grpc.ServiceDesc{ ServiceName: "notifications.Notifications", HandlerType: (*NotificationsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SubscribeNotifications", Handler: _Notifications_SubscribeNotifications_Handler, }, { MethodName: "UnsubscribeNotifications", Handler: _Notifications_UnsubscribeNotifications_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "notifications.proto", }
Notifications_ServiceDesc is the grpc.ServiceDesc for Notifications service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterNotificationsServer ¶
func RegisterNotificationsServer(s grpc.ServiceRegistrar, srv NotificationsServer)
Types ¶
type CleanupService ¶
type CleanupService struct {
// contains filtered or unexported fields
}
func NewCleanupService ¶
func NewCleanupService(store Store) *CleanupService
func (*CleanupService) Start ¶
func (c *CleanupService) Start(ctx context.Context)
Periodically cleans up expired webhook urls.
type EncryptedNotificationRequest ¶
type EncryptedNotificationRequest struct { Blob []byte `protobuf:"bytes,1,opt,name=blob,proto3" json:"blob,omitempty"` // contains filtered or unexported fields }
func (*EncryptedNotificationRequest) Descriptor
deprecated
func (*EncryptedNotificationRequest) Descriptor() ([]byte, []int)
Deprecated: Use EncryptedNotificationRequest.ProtoReflect.Descriptor instead.
func (*EncryptedNotificationRequest) GetBlob ¶
func (x *EncryptedNotificationRequest) GetBlob() []byte
func (*EncryptedNotificationRequest) ProtoMessage ¶
func (*EncryptedNotificationRequest) ProtoMessage()
func (*EncryptedNotificationRequest) ProtoReflect ¶
func (x *EncryptedNotificationRequest) ProtoReflect() protoreflect.Message
func (*EncryptedNotificationRequest) Reset ¶
func (x *EncryptedNotificationRequest) Reset()
func (*EncryptedNotificationRequest) String ¶
func (x *EncryptedNotificationRequest) String() string
type NotificationService ¶
type NotificationService struct {
// contains filtered or unexported fields
}
func NewNotificationService ¶
func NewNotificationService(store Store) *NotificationService
func (*NotificationService) Notify ¶
func (s *NotificationService) Notify( pubkey string, paymenthash string, ) (bool, error)
func (*NotificationService) Start ¶
func (s *NotificationService) Start(ctx context.Context)
type NotificationsClient ¶
type NotificationsClient interface { SubscribeNotifications(ctx context.Context, in *EncryptedNotificationRequest, opts ...grpc.CallOption) (*SubscribeNotificationsReply, error) UnsubscribeNotifications(ctx context.Context, in *EncryptedNotificationRequest, opts ...grpc.CallOption) (*UnsubscribeNotificationsReply, error) }
NotificationsClient is the client API for Notifications service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewNotificationsClient ¶
func NewNotificationsClient(cc grpc.ClientConnInterface) NotificationsClient
type NotificationsServer ¶
type NotificationsServer interface { SubscribeNotifications(context.Context, *EncryptedNotificationRequest) (*SubscribeNotificationsReply, error) UnsubscribeNotifications(context.Context, *EncryptedNotificationRequest) (*UnsubscribeNotificationsReply, error) // contains filtered or unexported methods }
NotificationsServer is the server API for Notifications service. All implementations must embed UnimplementedNotificationsServer for forward compatibility
func NewNotificationsServer ¶
func NewNotificationsServer(store Store) NotificationsServer
type PaymentReceivedPayload ¶
type SubscribeNotificationsReply ¶
type SubscribeNotificationsReply struct {
// contains filtered or unexported fields
}
func (*SubscribeNotificationsReply) Descriptor
deprecated
func (*SubscribeNotificationsReply) Descriptor() ([]byte, []int)
Deprecated: Use SubscribeNotificationsReply.ProtoReflect.Descriptor instead.
func (*SubscribeNotificationsReply) ProtoMessage ¶
func (*SubscribeNotificationsReply) ProtoMessage()
func (*SubscribeNotificationsReply) ProtoReflect ¶
func (x *SubscribeNotificationsReply) ProtoReflect() protoreflect.Message
func (*SubscribeNotificationsReply) Reset ¶
func (x *SubscribeNotificationsReply) Reset()
func (*SubscribeNotificationsReply) String ¶
func (x *SubscribeNotificationsReply) String() string
type SubscribeNotificationsRequest ¶
type SubscribeNotificationsRequest struct { Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` Signature string `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` // contains filtered or unexported fields }
func (*SubscribeNotificationsRequest) Descriptor
deprecated
func (*SubscribeNotificationsRequest) Descriptor() ([]byte, []int)
Deprecated: Use SubscribeNotificationsRequest.ProtoReflect.Descriptor instead.
func (*SubscribeNotificationsRequest) GetSignature ¶
func (x *SubscribeNotificationsRequest) GetSignature() string
func (*SubscribeNotificationsRequest) GetUrl ¶
func (x *SubscribeNotificationsRequest) GetUrl() string
func (*SubscribeNotificationsRequest) ProtoMessage ¶
func (*SubscribeNotificationsRequest) ProtoMessage()
func (*SubscribeNotificationsRequest) ProtoReflect ¶
func (x *SubscribeNotificationsRequest) ProtoReflect() protoreflect.Message
func (*SubscribeNotificationsRequest) Reset ¶
func (x *SubscribeNotificationsRequest) Reset()
func (*SubscribeNotificationsRequest) String ¶
func (x *SubscribeNotificationsRequest) String() string
type UnimplementedNotificationsServer ¶
type UnimplementedNotificationsServer struct { }
UnimplementedNotificationsServer must be embedded to have forward compatible implementations.
func (UnimplementedNotificationsServer) SubscribeNotifications ¶
func (UnimplementedNotificationsServer) SubscribeNotifications(context.Context, *EncryptedNotificationRequest) (*SubscribeNotificationsReply, error)
func (UnimplementedNotificationsServer) UnsubscribeNotifications ¶
func (UnimplementedNotificationsServer) UnsubscribeNotifications(context.Context, *EncryptedNotificationRequest) (*UnsubscribeNotificationsReply, error)
type UnsafeNotificationsServer ¶
type UnsafeNotificationsServer interface {
// contains filtered or unexported methods
}
UnsafeNotificationsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NotificationsServer will result in compilation errors.
type UnsubscribeNotificationsReply ¶
type UnsubscribeNotificationsReply struct {
// contains filtered or unexported fields
}
func (*UnsubscribeNotificationsReply) Descriptor
deprecated
func (*UnsubscribeNotificationsReply) Descriptor() ([]byte, []int)
Deprecated: Use UnsubscribeNotificationsReply.ProtoReflect.Descriptor instead.
func (*UnsubscribeNotificationsReply) ProtoMessage ¶
func (*UnsubscribeNotificationsReply) ProtoMessage()
func (*UnsubscribeNotificationsReply) ProtoReflect ¶
func (x *UnsubscribeNotificationsReply) ProtoReflect() protoreflect.Message
func (*UnsubscribeNotificationsReply) Reset ¶
func (x *UnsubscribeNotificationsReply) Reset()
func (*UnsubscribeNotificationsReply) String ¶
func (x *UnsubscribeNotificationsReply) String() string
type UnsubscribeNotificationsRequest ¶
type UnsubscribeNotificationsRequest struct { Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` Signature string `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` // contains filtered or unexported fields }
func (*UnsubscribeNotificationsRequest) Descriptor
deprecated
func (*UnsubscribeNotificationsRequest) Descriptor() ([]byte, []int)
Deprecated: Use UnsubscribeNotificationsRequest.ProtoReflect.Descriptor instead.
func (*UnsubscribeNotificationsRequest) GetSignature ¶
func (x *UnsubscribeNotificationsRequest) GetSignature() string
func (*UnsubscribeNotificationsRequest) GetUrl ¶
func (x *UnsubscribeNotificationsRequest) GetUrl() string
func (*UnsubscribeNotificationsRequest) ProtoMessage ¶
func (*UnsubscribeNotificationsRequest) ProtoMessage()
func (*UnsubscribeNotificationsRequest) ProtoReflect ¶
func (x *UnsubscribeNotificationsRequest) ProtoReflect() protoreflect.Message
func (*UnsubscribeNotificationsRequest) Reset ¶
func (x *UnsubscribeNotificationsRequest) Reset()
func (*UnsubscribeNotificationsRequest) String ¶
func (x *UnsubscribeNotificationsRequest) String() string