raw

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 17 Imported by: 0

README

Raw

This is the glue that takes lightning API on one side and GRPC API on the other side and combines them in order to report data to server.

Documentation

Index

Constants

View Source
const DefaultBatchSize = 50

DefaultBatchSize is the default batch size

View Source
const ReportBatch = 10

ReportBatch is how often a log is printed to show progress

Variables

This section is empty.

Functions

func GetFirstDay

func GetFirstDay(monthsAgo int) time.Time

GetFirstDay get first day of the month monthsAgo (0 is current month) firstLastMonth := GetFirstDay(1) beginOfThisMonth := GetFirstDay(0) endOfThisMonth := GetFirstDay(-1).Add(-1 * time.Millisecond)

func GetForwardsChannel

func GetForwardsChannel(ctx context.Context, lightning api.NewAPICall, from time.Time) <-chan api.RawMessage

GetForwardsChannel returns a channel with raw forwards

func GetInvoicesChannel

func GetInvoicesChannel(ctx context.Context, lightning api.NewAPICall, from time.Time) <-chan api.RawMessage

GetInvoicesChannel returns a channel with raw invoices

func GetPaymentsChannel

func GetPaymentsChannel(ctx context.Context, lightning api.NewAPICall, from time.Time) <-chan api.RawMessage

GetPaymentsChannel returns a channel with raw payments

Types

type Credentials

type Credentials struct {
	Pubkey    string
	AuthToken string
}

Credentials implements PerRPCCredentials

func MakeCredentials

func MakeCredentials(pubkey, authToken string) *Credentials

MakeCredentials creates new Credentials

func (*Credentials) GetRequestMetadata

func (c *Credentials) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)

GetRequestMetadata implements PerRPCCredentials

func (*Credentials) RequireTransportSecurity

func (c *Credentials) RequireTransportSecurity() bool

RequireTransportSecurity implements PerRPCCredentials

type GetRawData

type GetRawData func(ctx context.Context, lightning api.NewAPICall, pagination api.RawPagination) ([]api.RawMessage, *api.ResponseRawPagination, error)

GetRawData - signature for the function to get raw data

type Sender

type Sender struct {
	AuthToken    string
	LightningAPI api.NewAPICall
	AgentAPI     agent.AgentAPIClient
	PubKey       string
	ClientType   int
}

Sender struct

func MakeSender

func MakeSender(ctx context.Context, authToken string, endpoint string, l api.NewAPICall, isInsecure bool) (*Sender, error)

MakeSender creates a new Sender

func (*Sender) SendForwards

func (f *Sender) SendForwards(ctx context.Context, shouldUpdateTimeToLatest bool, from time.Time)

SendForwards will send forwards

func (*Sender) SendInvoices

func (f *Sender) SendInvoices(ctx context.Context, shouldUpdateTimeToLatest bool, from time.Time)

SendInvoices will send invoices

func (*Sender) SendPayments

func (f *Sender) SendPayments(ctx context.Context, shouldUpdateTimeToLatest bool, from time.Time)

SendPayments will send payments

Jump to

Keyboard shortcuts

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