invoices_service

package
v0.0.0-...-e2d33fb Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package invoices_service is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	InvoicesService_CreateInvoice_FullMethodName = "/invoices_service.InvoicesService/CreateInvoice"
	InvoicesService_CheckInvoice_FullMethodName  = "/invoices_service.InvoicesService/CheckInvoice"
	InvoicesService_UpdateInvoice_FullMethodName = "/invoices_service.InvoicesService/UpdateInvoice"
	InvoicesService_ListInvoices_FullMethodName  = "/invoices_service.InvoicesService/ListInvoices"
)

Variables

View Source
var (
	InvoiceStatus_name = map[int32]string{
		0: "UNKNOWN_STATUS",
		1: "NEW",
		2: "PENDING",
		3: "FAILED",
		4: "SUCCESS",
		5: "EXPIRED",
		6: "SENDING_TO_CLIENT",
		7: "MANUAL_CONTROL",
	}
	InvoiceStatus_value = map[string]int32{
		"UNKNOWN_STATUS":    0,
		"NEW":               1,
		"PENDING":           2,
		"FAILED":            3,
		"SUCCESS":           4,
		"EXPIRED":           5,
		"SENDING_TO_CLIENT": 6,
		"MANUAL_CONTROL":    7,
	}
)

Enum value maps for InvoiceStatus.

View Source
var File_api_invoices_service_invoices_service_proto protoreflect.FileDescriptor
View Source
var InvoicesService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "invoices_service.InvoicesService",
	HandlerType: (*InvoicesServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateInvoice",
			Handler:    _InvoicesService_CreateInvoice_Handler,
		},
		{
			MethodName: "CheckInvoice",
			Handler:    _InvoicesService_CheckInvoice_Handler,
		},
		{
			MethodName: "UpdateInvoice",
			Handler:    _InvoicesService_UpdateInvoice_Handler,
		},
		{
			MethodName: "ListInvoices",
			Handler:    _InvoicesService_ListInvoices_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/invoices-service/invoices-service.proto",
}

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

Functions

func RegisterInvoicesServiceHandler

func RegisterInvoicesServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterInvoicesServiceHandler registers the http handlers for service InvoicesService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterInvoicesServiceHandlerClient

func RegisterInvoicesServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client InvoicesServiceClient) error

RegisterInvoicesServiceHandlerClient registers the http handlers for service InvoicesService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "InvoicesServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "InvoicesServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "InvoicesServiceClient" to call the correct interceptors.

func RegisterInvoicesServiceHandlerFromEndpoint

func RegisterInvoicesServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterInvoicesServiceHandlerFromEndpoint is same as RegisterInvoicesServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterInvoicesServiceHandlerServer

func RegisterInvoicesServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server InvoicesServiceServer) error

RegisterInvoicesServiceHandlerServer registers the http handlers for service InvoicesService to "mux". UnaryRPC :call InvoicesServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterInvoicesServiceHandlerFromEndpoint instead.

func RegisterInvoicesServiceServer

func RegisterInvoicesServiceServer(s grpc.ServiceRegistrar, srv InvoicesServiceServer)

Types

type CheckInvoiceRequest

type CheckInvoiceRequest struct {

	// Invoice identifier
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*CheckInvoiceRequest) Descriptor deprecated

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

Deprecated: Use CheckInvoiceRequest.ProtoReflect.Descriptor instead.

func (*CheckInvoiceRequest) GetId

func (x *CheckInvoiceRequest) GetId() string

func (*CheckInvoiceRequest) ProtoMessage

func (*CheckInvoiceRequest) ProtoMessage()

func (*CheckInvoiceRequest) ProtoReflect

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

func (*CheckInvoiceRequest) Reset

func (x *CheckInvoiceRequest) Reset()

func (*CheckInvoiceRequest) String

func (x *CheckInvoiceRequest) String() string

type CheckInvoiceResponse

type CheckInvoiceResponse struct {
	Invoice *Invoice `protobuf:"bytes,1,opt,name=invoice,proto3" json:"invoice,omitempty"`
	// contains filtered or unexported fields
}

func (*CheckInvoiceResponse) Descriptor deprecated

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

Deprecated: Use CheckInvoiceResponse.ProtoReflect.Descriptor instead.

func (*CheckInvoiceResponse) GetInvoice

func (x *CheckInvoiceResponse) GetInvoice() *Invoice

func (*CheckInvoiceResponse) ProtoMessage

func (*CheckInvoiceResponse) ProtoMessage()

func (*CheckInvoiceResponse) ProtoReflect

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

func (*CheckInvoiceResponse) Reset

func (x *CheckInvoiceResponse) Reset()

func (*CheckInvoiceResponse) String

func (x *CheckInvoiceResponse) String() string

type CreateInvoiceRequest

type CreateInvoiceRequest struct {
	ClientId  string  `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	UsdAmount float64 `protobuf:"fixed64,2,opt,name=usd_amount,json=usdAmount,proto3" json:"usd_amount,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateInvoiceRequest) Descriptor deprecated

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

Deprecated: Use CreateInvoiceRequest.ProtoReflect.Descriptor instead.

func (*CreateInvoiceRequest) GetClientId

func (x *CreateInvoiceRequest) GetClientId() string

func (*CreateInvoiceRequest) GetUsdAmount

func (x *CreateInvoiceRequest) GetUsdAmount() float64

func (*CreateInvoiceRequest) ProtoMessage

func (*CreateInvoiceRequest) ProtoMessage()

func (*CreateInvoiceRequest) ProtoReflect

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

func (*CreateInvoiceRequest) Reset

func (x *CreateInvoiceRequest) Reset()

func (*CreateInvoiceRequest) String

func (x *CreateInvoiceRequest) String() string

type CreateInvoiceResponse

type CreateInvoiceResponse struct {

	// Invoice identifier
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateInvoiceResponse) Descriptor deprecated

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

Deprecated: Use CreateInvoiceResponse.ProtoReflect.Descriptor instead.

func (*CreateInvoiceResponse) GetId

func (x *CreateInvoiceResponse) GetId() string

func (*CreateInvoiceResponse) ProtoMessage

func (*CreateInvoiceResponse) ProtoMessage()

func (*CreateInvoiceResponse) ProtoReflect

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

func (*CreateInvoiceResponse) Reset

func (x *CreateInvoiceResponse) Reset()

func (*CreateInvoiceResponse) String

func (x *CreateInvoiceResponse) String() string

type Invoice

type Invoice struct {
	Id            string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	ClientId      string                 `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	UsdAmount     float64                `protobuf:"fixed64,3,opt,name=usd_amount,json=usdAmount,proto3" json:"usd_amount,omitempty"`
	TokenAmount   float64                `protobuf:"fixed64,4,opt,name=token_amount,json=tokenAmount,proto3" json:"token_amount,omitempty"`
	Chain         string                 `protobuf:"bytes,5,opt,name=chain,proto3" json:"chain,omitempty"`
	Token         string                 `protobuf:"bytes,6,opt,name=token,proto3" json:"token,omitempty"`
	Status        InvoiceStatus          `protobuf:"varint,7,opt,name=status,proto3,enum=invoices_service.InvoiceStatus" json:"status,omitempty"`
	Address       string                 `protobuf:"bytes,8,opt,name=address,proto3" json:"address,omitempty"`
	CreatedAt     *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	PayerClientId string                 `protobuf:"bytes,10,opt,name=payer_client_id,json=payerClientId,proto3" json:"payer_client_id,omitempty"`
	// contains filtered or unexported fields
}

func (*Invoice) Descriptor deprecated

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

Deprecated: Use Invoice.ProtoReflect.Descriptor instead.

func (*Invoice) GetAddress

func (x *Invoice) GetAddress() string

func (*Invoice) GetChain

func (x *Invoice) GetChain() string

func (*Invoice) GetClientId

func (x *Invoice) GetClientId() string

func (*Invoice) GetCreatedAt

func (x *Invoice) GetCreatedAt() *timestamppb.Timestamp

func (*Invoice) GetId

func (x *Invoice) GetId() string

func (*Invoice) GetPayerClientId

func (x *Invoice) GetPayerClientId() string

func (*Invoice) GetStatus

func (x *Invoice) GetStatus() InvoiceStatus

func (*Invoice) GetToken

func (x *Invoice) GetToken() string

func (*Invoice) GetTokenAmount

func (x *Invoice) GetTokenAmount() float64

func (*Invoice) GetUsdAmount

func (x *Invoice) GetUsdAmount() float64

func (*Invoice) ProtoMessage

func (*Invoice) ProtoMessage()

func (*Invoice) ProtoReflect

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

func (*Invoice) Reset

func (x *Invoice) Reset()

func (*Invoice) String

func (x *Invoice) String() string

type InvoiceStatus

type InvoiceStatus int32
const (
	InvoiceStatus_UNKNOWN_STATUS InvoiceStatus = 0
	InvoiceStatus_NEW            InvoiceStatus = 1
	InvoiceStatus_PENDING        InvoiceStatus = 2
	InvoiceStatus_FAILED         InvoiceStatus = 3
	InvoiceStatus_SUCCESS        InvoiceStatus = 4
	InvoiceStatus_EXPIRED        InvoiceStatus = 5
	// Send received funds to client
	InvoiceStatus_SENDING_TO_CLIENT InvoiceStatus = 6
	// If invoice is stuck and not sending crypto to client
	// then set such status to manually control situation
	InvoiceStatus_MANUAL_CONTROL InvoiceStatus = 7
)

func (InvoiceStatus) Descriptor

func (InvoiceStatus) Enum

func (x InvoiceStatus) Enum() *InvoiceStatus

func (InvoiceStatus) EnumDescriptor deprecated

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

Deprecated: Use InvoiceStatus.Descriptor instead.

func (InvoiceStatus) Number

func (InvoiceStatus) String

func (x InvoiceStatus) String() string

func (InvoiceStatus) Type

type InvoicesServiceClient

type InvoicesServiceClient interface {
	CreateInvoice(ctx context.Context, in *CreateInvoiceRequest, opts ...grpc.CallOption) (*CreateInvoiceResponse, error)
	CheckInvoice(ctx context.Context, in *CheckInvoiceRequest, opts ...grpc.CallOption) (*CheckInvoiceResponse, error)
	UpdateInvoice(ctx context.Context, in *UpdateInvoiceRequest, opts ...grpc.CallOption) (*UpdateInvoiceResponse, error)
	ListInvoices(ctx context.Context, in *ListInvoicesRequest, opts ...grpc.CallOption) (*ListInvoicesResponse, error)
}

InvoicesServiceClient is the client API for InvoicesService 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.

type InvoicesServiceServer

type InvoicesServiceServer interface {
	CreateInvoice(context.Context, *CreateInvoiceRequest) (*CreateInvoiceResponse, error)
	CheckInvoice(context.Context, *CheckInvoiceRequest) (*CheckInvoiceResponse, error)
	UpdateInvoice(context.Context, *UpdateInvoiceRequest) (*UpdateInvoiceResponse, error)
	ListInvoices(context.Context, *ListInvoicesRequest) (*ListInvoicesResponse, error)
	// contains filtered or unexported methods
}

InvoicesServiceServer is the server API for InvoicesService service. All implementations must embed UnimplementedInvoicesServiceServer for forward compatibility

type ListInvoicesRequest

type ListInvoicesRequest struct {
	Filter *ListInvoicesRequest_Filter `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"`
	// contains filtered or unexported fields
}

func (*ListInvoicesRequest) Descriptor deprecated

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

Deprecated: Use ListInvoicesRequest.ProtoReflect.Descriptor instead.

func (*ListInvoicesRequest) GetFilter

func (*ListInvoicesRequest) ProtoMessage

func (*ListInvoicesRequest) ProtoMessage()

func (*ListInvoicesRequest) ProtoReflect

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

func (*ListInvoicesRequest) Reset

func (x *ListInvoicesRequest) Reset()

func (*ListInvoicesRequest) String

func (x *ListInvoicesRequest) String() string

type ListInvoicesRequest_Filter

type ListInvoicesRequest_Filter struct {
	IdIn            []string        `protobuf:"bytes,1,rep,name=id_in,json=idIn,proto3" json:"id_in,omitempty"`
	ClientIdIn      []string        `protobuf:"bytes,2,rep,name=client_id_in,json=clientIdIn,proto3" json:"client_id_in,omitempty"`
	InvoiceStatusIn []InvoiceStatus `` /* 152-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ListInvoicesRequest_Filter) Descriptor deprecated

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

Deprecated: Use ListInvoicesRequest_Filter.ProtoReflect.Descriptor instead.

func (*ListInvoicesRequest_Filter) GetClientIdIn

func (x *ListInvoicesRequest_Filter) GetClientIdIn() []string

func (*ListInvoicesRequest_Filter) GetIdIn

func (x *ListInvoicesRequest_Filter) GetIdIn() []string

func (*ListInvoicesRequest_Filter) GetInvoiceStatusIn

func (x *ListInvoicesRequest_Filter) GetInvoiceStatusIn() []InvoiceStatus

func (*ListInvoicesRequest_Filter) ProtoMessage

func (*ListInvoicesRequest_Filter) ProtoMessage()

func (*ListInvoicesRequest_Filter) ProtoReflect

func (*ListInvoicesRequest_Filter) Reset

func (x *ListInvoicesRequest_Filter) Reset()

func (*ListInvoicesRequest_Filter) String

func (x *ListInvoicesRequest_Filter) String() string

type ListInvoicesResponse

type ListInvoicesResponse struct {
	Invoices []*Invoice `protobuf:"bytes,1,rep,name=invoices,proto3" json:"invoices,omitempty"`
	// contains filtered or unexported fields
}

func (*ListInvoicesResponse) Descriptor deprecated

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

Deprecated: Use ListInvoicesResponse.ProtoReflect.Descriptor instead.

func (*ListInvoicesResponse) GetInvoices

func (x *ListInvoicesResponse) GetInvoices() []*Invoice

func (*ListInvoicesResponse) ProtoMessage

func (*ListInvoicesResponse) ProtoMessage()

func (*ListInvoicesResponse) ProtoReflect

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

func (*ListInvoicesResponse) Reset

func (x *ListInvoicesResponse) Reset()

func (*ListInvoicesResponse) String

func (x *ListInvoicesResponse) String() string

type UnimplementedInvoicesServiceServer

type UnimplementedInvoicesServiceServer struct {
}

UnimplementedInvoicesServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedInvoicesServiceServer) CheckInvoice

func (UnimplementedInvoicesServiceServer) CreateInvoice

func (UnimplementedInvoicesServiceServer) ListInvoices

func (UnimplementedInvoicesServiceServer) UpdateInvoice

type UnsafeInvoicesServiceServer

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

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

type UpdateInvoiceRequest

type UpdateInvoiceRequest struct {
	Id            string  `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Chain         string  `protobuf:"bytes,2,opt,name=chain,proto3" json:"chain,omitempty"`
	Token         string  `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"`
	PayerClientId *string `protobuf:"bytes,4,opt,name=payer_client_id,json=payerClientId,proto3,oneof" json:"payer_client_id,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateInvoiceRequest) Descriptor deprecated

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

Deprecated: Use UpdateInvoiceRequest.ProtoReflect.Descriptor instead.

func (*UpdateInvoiceRequest) GetChain

func (x *UpdateInvoiceRequest) GetChain() string

func (*UpdateInvoiceRequest) GetId

func (x *UpdateInvoiceRequest) GetId() string

func (*UpdateInvoiceRequest) GetPayerClientId

func (x *UpdateInvoiceRequest) GetPayerClientId() string

func (*UpdateInvoiceRequest) GetToken

func (x *UpdateInvoiceRequest) GetToken() string

func (*UpdateInvoiceRequest) ProtoMessage

func (*UpdateInvoiceRequest) ProtoMessage()

func (*UpdateInvoiceRequest) ProtoReflect

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

func (*UpdateInvoiceRequest) Reset

func (x *UpdateInvoiceRequest) Reset()

func (*UpdateInvoiceRequest) String

func (x *UpdateInvoiceRequest) String() string

type UpdateInvoiceResponse

type UpdateInvoiceResponse struct {
	Invoice *Invoice `protobuf:"bytes,1,opt,name=invoice,proto3" json:"invoice,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateInvoiceResponse) Descriptor deprecated

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

Deprecated: Use UpdateInvoiceResponse.ProtoReflect.Descriptor instead.

func (*UpdateInvoiceResponse) GetInvoice

func (x *UpdateInvoiceResponse) GetInvoice() *Invoice

func (*UpdateInvoiceResponse) ProtoMessage

func (*UpdateInvoiceResponse) ProtoMessage()

func (*UpdateInvoiceResponse) ProtoReflect

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

func (*UpdateInvoiceResponse) Reset

func (x *UpdateInvoiceResponse) Reset()

func (*UpdateInvoiceResponse) String

func (x *UpdateInvoiceResponse) String() string

Jump to

Keyboard shortcuts

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