agent

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: 8 Imported by: 0

README

Agent

This is the GRPC client side.

Usage

./gen.sh

to regenerate go code from .proto file.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ClientType_name = map[int32]string{
		0: "LND_GRPC",
		1: "LND_REST",
		2: "C_LIGHTNING",
		3: "ECLAIR",
	}
	ClientType_value = map[string]int32{
		"LND_GRPC":    0,
		"LND_REST":    1,
		"C_LIGHTNING": 2,
		"ECLAIR":      3,
	}
)

Enum value maps for ClientType.

View Source
var AgentAPI_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "agent.AgentAPI",
	HandlerType: (*AgentAPIServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Payments",
			Handler:    _AgentAPI_Payments_Handler,
		},
		{
			MethodName: "LatestPaymentTimestamp",
			Handler:    _AgentAPI_LatestPaymentTimestamp_Handler,
		},
		{
			MethodName: "Invoices",
			Handler:    _AgentAPI_Invoices_Handler,
		},
		{
			MethodName: "LatestInvoiceTimestamp",
			Handler:    _AgentAPI_LatestInvoiceTimestamp_Handler,
		},
		{
			MethodName: "Forwards",
			Handler:    _AgentAPI_Forwards_Handler,
		},
		{
			MethodName: "LatestForwardTimestamp",
			Handler:    _AgentAPI_LatestForwardTimestamp_Handler,
		},
		{
			MethodName: "LiquidityAds",
			Handler:    _AgentAPI_LiquidityAds_Handler,
		},
		{
			MethodName: "LatestLiquidityAdTimestamp",
			Handler:    _AgentAPI_LatestLiquidityAdTimestamp_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "agent.proto",
}

AgentAPI_ServiceDesc is the grpc.ServiceDesc for AgentAPI service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_agent_proto protoreflect.FileDescriptor

Functions

func RegisterAgentAPIServer

func RegisterAgentAPIServer(s grpc.ServiceRegistrar, srv AgentAPIServer)

Types

type AgentAPIClient

type AgentAPIClient interface {
	Payments(ctx context.Context, in *DataRequest, opts ...grpc.CallOption) (*Empty, error)
	LatestPaymentTimestamp(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*TimestampResponse, error)
	Invoices(ctx context.Context, in *DataRequest, opts ...grpc.CallOption) (*Empty, error)
	LatestInvoiceTimestamp(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*TimestampResponse, error)
	Forwards(ctx context.Context, in *DataRequest, opts ...grpc.CallOption) (*Empty, error)
	LatestForwardTimestamp(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*TimestampResponse, error)
	LiquidityAds(ctx context.Context, in *DataRequest, opts ...grpc.CallOption) (*Empty, error)
	LatestLiquidityAdTimestamp(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*TimestampResponse, error)
}

AgentAPIClient is the client API for AgentAPI service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.golang.ir/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewAgentAPIClient

func NewAgentAPIClient(cc grpc.ClientConnInterface) AgentAPIClient

type AgentAPIServer

type AgentAPIServer interface {
	Payments(context.Context, *DataRequest) (*Empty, error)
	LatestPaymentTimestamp(context.Context, *Empty) (*TimestampResponse, error)
	Invoices(context.Context, *DataRequest) (*Empty, error)
	LatestInvoiceTimestamp(context.Context, *Empty) (*TimestampResponse, error)
	Forwards(context.Context, *DataRequest) (*Empty, error)
	LatestForwardTimestamp(context.Context, *Empty) (*TimestampResponse, error)
	LiquidityAds(context.Context, *DataRequest) (*Empty, error)
	LatestLiquidityAdTimestamp(context.Context, *Empty) (*TimestampResponse, error)
	// contains filtered or unexported methods
}

AgentAPIServer is the server API for AgentAPI service. All implementations must embed UnimplementedAgentAPIServer for forward compatibility

type ClientType

type ClientType int32
const (
	ClientType_LND_GRPC    ClientType = 0
	ClientType_LND_REST    ClientType = 1
	ClientType_C_LIGHTNING ClientType = 2
	ClientType_ECLAIR      ClientType = 3
)

func (ClientType) Descriptor

func (ClientType) Descriptor() protoreflect.EnumDescriptor

func (ClientType) Enum

func (x ClientType) Enum() *ClientType

func (ClientType) EnumDescriptor deprecated

func (ClientType) EnumDescriptor() ([]byte, []int)

Deprecated: Use ClientType.Descriptor instead.

func (ClientType) Number

func (x ClientType) Number() protoreflect.EnumNumber

func (ClientType) String

func (x ClientType) String() string

func (ClientType) Type

type CredentialsRequest

type CredentialsRequest struct {
	PubKey     string     `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"`
	ClientType ClientType `protobuf:"varint,2,opt,name=client_type,json=clientType,proto3,enum=agent.ClientType" json:"client_type,omitempty"`
	// contains filtered or unexported fields
}

func (*CredentialsRequest) Descriptor deprecated

func (*CredentialsRequest) Descriptor() ([]byte, []int)

Deprecated: Use CredentialsRequest.ProtoReflect.Descriptor instead.

func (*CredentialsRequest) GetClientType

func (x *CredentialsRequest) GetClientType() ClientType

func (*CredentialsRequest) GetPubKey

func (x *CredentialsRequest) GetPubKey() string

func (*CredentialsRequest) ProtoMessage

func (*CredentialsRequest) ProtoMessage()

func (*CredentialsRequest) ProtoReflect

func (x *CredentialsRequest) ProtoReflect() protoreflect.Message

func (*CredentialsRequest) Reset

func (x *CredentialsRequest) Reset()

func (*CredentialsRequest) String

func (x *CredentialsRequest) String() string

type DataRequest

type DataRequest struct {
	Timestamp int64  `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // timestamp in nanoseconds
	Data      string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`            // Raw JSON serialized data (since it can come from various sources)
	// contains filtered or unexported fields
}

func (*DataRequest) Descriptor deprecated

func (*DataRequest) Descriptor() ([]byte, []int)

Deprecated: Use DataRequest.ProtoReflect.Descriptor instead.

func (*DataRequest) GetData

func (x *DataRequest) GetData() string

func (*DataRequest) GetTimestamp

func (x *DataRequest) GetTimestamp() int64

func (*DataRequest) ProtoMessage

func (*DataRequest) ProtoMessage()

func (*DataRequest) ProtoReflect

func (x *DataRequest) ProtoReflect() protoreflect.Message

func (*DataRequest) Reset

func (x *DataRequest) Reset()

func (*DataRequest) String

func (x *DataRequest) String() string

type Empty

type Empty struct {
	// contains filtered or unexported fields
}

func (*Empty) Descriptor deprecated

func (*Empty) Descriptor() ([]byte, []int)

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

func (x *Empty) ProtoReflect() protoreflect.Message

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type TimestampResponse

type TimestampResponse struct {
	Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

func (*TimestampResponse) Descriptor deprecated

func (*TimestampResponse) Descriptor() ([]byte, []int)

Deprecated: Use TimestampResponse.ProtoReflect.Descriptor instead.

func (*TimestampResponse) GetTimestamp

func (x *TimestampResponse) GetTimestamp() int64

func (*TimestampResponse) ProtoMessage

func (*TimestampResponse) ProtoMessage()

func (*TimestampResponse) ProtoReflect

func (x *TimestampResponse) ProtoReflect() protoreflect.Message

func (*TimestampResponse) Reset

func (x *TimestampResponse) Reset()

func (*TimestampResponse) String

func (x *TimestampResponse) String() string

type UnimplementedAgentAPIServer

type UnimplementedAgentAPIServer struct {
}

UnimplementedAgentAPIServer must be embedded to have forward compatible implementations.

func (UnimplementedAgentAPIServer) Forwards

func (UnimplementedAgentAPIServer) Invoices

func (UnimplementedAgentAPIServer) LatestForwardTimestamp

func (UnimplementedAgentAPIServer) LatestInvoiceTimestamp

func (UnimplementedAgentAPIServer) LatestLiquidityAdTimestamp

func (UnimplementedAgentAPIServer) LatestLiquidityAdTimestamp(context.Context, *Empty) (*TimestampResponse, error)

func (UnimplementedAgentAPIServer) LatestPaymentTimestamp

func (UnimplementedAgentAPIServer) LiquidityAds

func (UnimplementedAgentAPIServer) Payments

type UnsafeAgentAPIServer

type UnsafeAgentAPIServer interface {
	// contains filtered or unexported methods
}

UnsafeAgentAPIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AgentAPIServer will result in compilation errors.

Jump to

Keyboard shortcuts

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