Documentation ¶
Overview ¶
Package ledgerv1beta is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterHealthAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterHealthAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HealthAPIClient) error
- func RegisterHealthAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterHealthAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HealthAPIServer) error
- func RegisterHealthAPIServer(s grpc.ServiceRegistrar, srv HealthAPIServer)
- func RegisterLedgerAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterLedgerAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LedgerAPIClient) error
- func RegisterLedgerAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterLedgerAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LedgerAPIServer) error
- func RegisterLedgerAPIServer(s grpc.ServiceRegistrar, srv LedgerAPIServer)
- type AccountEntry
- func (*AccountEntry) Descriptor() ([]byte, []int)deprecated
- func (x *AccountEntry) GetAccount() string
- func (x *AccountEntry) GetAmount() int64
- func (x *AccountEntry) GetCompetenceDate() *timestamppb.Timestamp
- func (x *AccountEntry) GetEvent() int32
- func (x *AccountEntry) GetId() string
- func (x *AccountEntry) GetMetadata() *structpb.Struct
- func (x *AccountEntry) GetOperation() Operation
- func (x *AccountEntry) GetVersion() int64
- func (*AccountEntry) ProtoMessage()
- func (x *AccountEntry) ProtoReflect() protoreflect.Message
- func (x *AccountEntry) Reset()
- func (x *AccountEntry) String() string
- type AccountResult
- func (*AccountResult) Descriptor() ([]byte, []int)deprecated
- func (x *AccountResult) GetAccount() string
- func (x *AccountResult) GetCredit() int64
- func (x *AccountResult) GetDebit() int64
- func (*AccountResult) ProtoMessage()
- func (x *AccountResult) ProtoReflect() protoreflect.Message
- func (x *AccountResult) Reset()
- func (x *AccountResult) String() string
- type CheckRequest
- type CheckResponse
- type CheckResponse_ServingStatus
- func (CheckResponse_ServingStatus) Descriptor() protoreflect.EnumDescriptor
- func (x CheckResponse_ServingStatus) Enum() *CheckResponse_ServingStatus
- func (CheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int)deprecated
- func (x CheckResponse_ServingStatus) Number() protoreflect.EnumNumber
- func (x CheckResponse_ServingStatus) String() string
- func (CheckResponse_ServingStatus) Type() protoreflect.EnumType
- type CreateTransactionRequest
- func (*CreateTransactionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateTransactionRequest) GetCompany() string
- func (x *CreateTransactionRequest) GetCompetenceDate() *timestamppb.Timestamp
- func (x *CreateTransactionRequest) GetEntries() []*Entry
- func (x *CreateTransactionRequest) GetEvent() uint32
- func (x *CreateTransactionRequest) GetId() string
- func (*CreateTransactionRequest) ProtoMessage()
- func (x *CreateTransactionRequest) ProtoReflect() protoreflect.Message
- func (x *CreateTransactionRequest) Reset()
- func (x *CreateTransactionRequest) String() string
- type CreateTransactionResponse
- type Entry
- func (*Entry) Descriptor() ([]byte, []int)deprecated
- func (x *Entry) GetAccount() string
- func (x *Entry) GetAmount() int64
- func (x *Entry) GetExpectedVersion() int64
- func (x *Entry) GetId() string
- func (x *Entry) GetMetadata() *structpb.Struct
- func (x *Entry) GetOperation() Operation
- func (*Entry) ProtoMessage()
- func (x *Entry) ProtoReflect() protoreflect.Message
- func (x *Entry) Reset()
- func (x *Entry) String() string
- type GetAccountBalanceRequest
- func (*GetAccountBalanceRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetAccountBalanceRequest) GetAccount() string
- func (x *GetAccountBalanceRequest) GetEndDate() *timestamppb.Timestamp
- func (x *GetAccountBalanceRequest) GetStartDate() *timestamppb.Timestamp
- func (*GetAccountBalanceRequest) ProtoMessage()
- func (x *GetAccountBalanceRequest) ProtoReflect() protoreflect.Message
- func (x *GetAccountBalanceRequest) Reset()
- func (x *GetAccountBalanceRequest) String() string
- type GetAccountBalanceResponse
- func (*GetAccountBalanceResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetAccountBalanceResponse) GetAccount() string
- func (x *GetAccountBalanceResponse) GetBalance() int64
- func (x *GetAccountBalanceResponse) GetCurrentVersion() int64
- func (*GetAccountBalanceResponse) ProtoMessage()
- func (x *GetAccountBalanceResponse) ProtoReflect() protoreflect.Message
- func (x *GetAccountBalanceResponse) Reset()
- func (x *GetAccountBalanceResponse) String() string
- type GetSyntheticReportFilters
- func (*GetSyntheticReportFilters) Descriptor() ([]byte, []int)deprecated
- func (x *GetSyntheticReportFilters) GetLevel() int32
- func (*GetSyntheticReportFilters) ProtoMessage()
- func (x *GetSyntheticReportFilters) ProtoReflect() protoreflect.Message
- func (x *GetSyntheticReportFilters) Reset()
- func (x *GetSyntheticReportFilters) String() string
- type GetSyntheticReportRequest
- func (*GetSyntheticReportRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetSyntheticReportRequest) GetAccount() string
- func (x *GetSyntheticReportRequest) GetEndDate() *timestamppb.Timestamp
- func (x *GetSyntheticReportRequest) GetFilters() *GetSyntheticReportFilters
- func (x *GetSyntheticReportRequest) GetStartDate() *timestamppb.Timestamp
- func (*GetSyntheticReportRequest) ProtoMessage()
- func (x *GetSyntheticReportRequest) ProtoReflect() protoreflect.Message
- func (x *GetSyntheticReportRequest) Reset()
- func (x *GetSyntheticReportRequest) String() string
- type GetSyntheticReportResponse
- func (*GetSyntheticReportResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetSyntheticReportResponse) GetResults() []*AccountResult
- func (x *GetSyntheticReportResponse) GetTotalCredit() int64
- func (x *GetSyntheticReportResponse) GetTotalDebit() int64
- func (*GetSyntheticReportResponse) ProtoMessage()
- func (x *GetSyntheticReportResponse) ProtoReflect() protoreflect.Message
- func (x *GetSyntheticReportResponse) Reset()
- func (x *GetSyntheticReportResponse) String() string
- type HealthAPIClient
- type HealthAPIServer
- type LedgerAPIClient
- type LedgerAPIServer
- type ListAccountEntriesRequest
- func (*ListAccountEntriesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListAccountEntriesRequest) GetAccount() string
- func (x *ListAccountEntriesRequest) GetEndDate() *timestamppb.Timestamp
- func (x *ListAccountEntriesRequest) GetFilter() *ListAccountEntriesRequest_Filter
- func (x *ListAccountEntriesRequest) GetPage() *RequestPagination
- func (x *ListAccountEntriesRequest) GetStartDate() *timestamppb.Timestamp
- func (*ListAccountEntriesRequest) ProtoMessage()
- func (x *ListAccountEntriesRequest) ProtoReflect() protoreflect.Message
- func (x *ListAccountEntriesRequest) Reset()
- func (x *ListAccountEntriesRequest) String() string
- type ListAccountEntriesRequest_Filter
- func (*ListAccountEntriesRequest_Filter) Descriptor() ([]byte, []int)deprecated
- func (x *ListAccountEntriesRequest_Filter) GetCompanies() []string
- func (x *ListAccountEntriesRequest_Filter) GetEvents() []int32
- func (x *ListAccountEntriesRequest_Filter) GetOperation() Operation
- func (*ListAccountEntriesRequest_Filter) ProtoMessage()
- func (x *ListAccountEntriesRequest_Filter) ProtoReflect() protoreflect.Message
- func (x *ListAccountEntriesRequest_Filter) Reset()
- func (x *ListAccountEntriesRequest_Filter) String() string
- type ListAccountEntriesResponse
- func (*ListAccountEntriesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListAccountEntriesResponse) GetEntries() []*AccountEntry
- func (x *ListAccountEntriesResponse) GetNextPageToken() string
- func (*ListAccountEntriesResponse) ProtoMessage()
- func (x *ListAccountEntriesResponse) ProtoReflect() protoreflect.Message
- func (x *ListAccountEntriesResponse) Reset()
- func (x *ListAccountEntriesResponse) String() string
- type Operation
- type RequestPagination
- func (*RequestPagination) Descriptor() ([]byte, []int)deprecated
- func (x *RequestPagination) GetPageSize() int32
- func (x *RequestPagination) GetPageToken() string
- func (*RequestPagination) ProtoMessage()
- func (x *RequestPagination) ProtoReflect() protoreflect.Message
- func (x *RequestPagination) Reset()
- func (x *RequestPagination) String() string
- type UnimplementedHealthAPIServer
- type UnimplementedLedgerAPIServer
- func (UnimplementedLedgerAPIServer) CreateTransaction(context.Context, *CreateTransactionRequest) (*CreateTransactionResponse, error)
- func (UnimplementedLedgerAPIServer) GetAccountBalance(context.Context, *GetAccountBalanceRequest) (*GetAccountBalanceResponse, error)
- func (UnimplementedLedgerAPIServer) GetSyntheticReport(context.Context, *GetSyntheticReportRequest) (*GetSyntheticReportResponse, error)
- func (UnimplementedLedgerAPIServer) ListAccountEntries(context.Context, *ListAccountEntriesRequest) (*ListAccountEntriesResponse, error)
- type UnsafeHealthAPIServer
- type UnsafeLedgerAPIServer
Constants ¶
This section is empty.
Variables ¶
var ( Operation_name = map[int32]string{ 0: "OPERATION_INVALID", 1: "OPERATION_CREDIT", 2: "OPERATION_DEBIT", } Operation_value = map[string]int32{ "OPERATION_INVALID": 0, "OPERATION_CREDIT": 1, "OPERATION_DEBIT": 2, } )
Enum value maps for Operation.
var ( CheckResponse_ServingStatus_name = map[int32]string{ 0: "SERVING_STATUS_UNKNOWN_INVALID", 1: "SERVING_STATUS_SERVING", 2: "SERVING_STATUS_NOT_SERVING", 3: "SERVING_STATUS_SERVICE_UNKNOWN", } CheckResponse_ServingStatus_value = map[string]int32{ "SERVING_STATUS_UNKNOWN_INVALID": 0, "SERVING_STATUS_SERVING": 1, "SERVING_STATUS_NOT_SERVING": 2, "SERVING_STATUS_SERVICE_UNKNOWN": 3, } )
Enum value maps for CheckResponse_ServingStatus.
var File_ledger_v1beta_ledger_proto protoreflect.FileDescriptor
var HealthAPI_ServiceDesc = grpc.ServiceDesc{ ServiceName: "ledger.v1beta.HealthAPI", HandlerType: (*HealthAPIServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Check", Handler: _HealthAPI_Check_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "ledger/v1beta/ledger.proto", }
HealthAPI_ServiceDesc is the grpc.ServiceDesc for HealthAPI service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var LedgerAPI_ServiceDesc = grpc.ServiceDesc{ ServiceName: "ledger.v1beta.LedgerAPI", HandlerType: (*LedgerAPIServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateTransaction", Handler: _LedgerAPI_CreateTransaction_Handler, }, { MethodName: "GetAccountBalance", Handler: _LedgerAPI_GetAccountBalance_Handler, }, { MethodName: "ListAccountEntries", Handler: _LedgerAPI_ListAccountEntries_Handler, }, { MethodName: "GetSyntheticReport", Handler: _LedgerAPI_GetSyntheticReport_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "ledger/v1beta/ledger.proto", }
LedgerAPI_ServiceDesc is the grpc.ServiceDesc for LedgerAPI service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterHealthAPIHandler ¶
func RegisterHealthAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterHealthAPIHandler registers the http handlers for service HealthAPI to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterHealthAPIHandlerClient ¶
func RegisterHealthAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HealthAPIClient) error
RegisterHealthAPIHandlerClient registers the http handlers for service HealthAPI to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HealthAPIClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HealthAPIClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "HealthAPIClient" to call the correct interceptors.
func RegisterHealthAPIHandlerFromEndpoint ¶
func RegisterHealthAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterHealthAPIHandlerFromEndpoint is same as RegisterHealthAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterHealthAPIHandlerServer ¶
func RegisterHealthAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HealthAPIServer) error
RegisterHealthAPIHandlerServer registers the http handlers for service HealthAPI to "mux". UnaryRPC :call HealthAPIServer 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 RegisterHealthAPIHandlerFromEndpoint instead.
func RegisterHealthAPIServer ¶
func RegisterHealthAPIServer(s grpc.ServiceRegistrar, srv HealthAPIServer)
func RegisterLedgerAPIHandler ¶
func RegisterLedgerAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterLedgerAPIHandler registers the http handlers for service LedgerAPI to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterLedgerAPIHandlerClient ¶
func RegisterLedgerAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LedgerAPIClient) error
RegisterLedgerAPIHandlerClient registers the http handlers for service LedgerAPI to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "LedgerAPIClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "LedgerAPIClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "LedgerAPIClient" to call the correct interceptors.
func RegisterLedgerAPIHandlerFromEndpoint ¶
func RegisterLedgerAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterLedgerAPIHandlerFromEndpoint is same as RegisterLedgerAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterLedgerAPIHandlerServer ¶
func RegisterLedgerAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LedgerAPIServer) error
RegisterLedgerAPIHandlerServer registers the http handlers for service LedgerAPI to "mux". UnaryRPC :call LedgerAPIServer 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 RegisterLedgerAPIHandlerFromEndpoint instead.
func RegisterLedgerAPIServer ¶
func RegisterLedgerAPIServer(s grpc.ServiceRegistrar, srv LedgerAPIServer)
Types ¶
type AccountEntry ¶
type AccountEntry struct { // It's the entry id. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Account version at the time. Version int64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` // Operation: debit or credit. Operation Operation `protobuf:"varint,3,opt,name=operation,proto3,enum=ledger.v1beta.Operation" json:"operation,omitempty"` // Amount (in cents). Amount int64 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"` // Event that generated the transaction Event int32 `protobuf:"varint,5,opt,name=event,proto3" json:"event,omitempty"` // Transaction date received on creation. CompetenceDate *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=competence_date,json=competenceDate,proto3" json:"competence_date,omitempty"` // The entry metadata. Metadata *structpb.Struct `protobuf:"bytes,7,opt,name=metadata,proto3" json:"metadata,omitempty"` // The account responsible for the entry. Account string `protobuf:"bytes,8,opt,name=account,proto3" json:"account,omitempty"` // contains filtered or unexported fields }
Represents a historical entry for a account
func (*AccountEntry) Descriptor
deprecated
func (*AccountEntry) Descriptor() ([]byte, []int)
Deprecated: Use AccountEntry.ProtoReflect.Descriptor instead.
func (*AccountEntry) GetAccount ¶
func (x *AccountEntry) GetAccount() string
func (*AccountEntry) GetAmount ¶
func (x *AccountEntry) GetAmount() int64
func (*AccountEntry) GetCompetenceDate ¶
func (x *AccountEntry) GetCompetenceDate() *timestamppb.Timestamp
func (*AccountEntry) GetEvent ¶
func (x *AccountEntry) GetEvent() int32
func (*AccountEntry) GetId ¶
func (x *AccountEntry) GetId() string
func (*AccountEntry) GetMetadata ¶
func (x *AccountEntry) GetMetadata() *structpb.Struct
func (*AccountEntry) GetOperation ¶
func (x *AccountEntry) GetOperation() Operation
func (*AccountEntry) GetVersion ¶
func (x *AccountEntry) GetVersion() int64
func (*AccountEntry) ProtoMessage ¶
func (*AccountEntry) ProtoMessage()
func (*AccountEntry) ProtoReflect ¶
func (x *AccountEntry) ProtoReflect() protoreflect.Message
func (*AccountEntry) Reset ¶
func (x *AccountEntry) Reset()
func (*AccountEntry) String ¶
func (x *AccountEntry) String() string
type AccountResult ¶
type AccountResult struct { // The account name Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` // credit Credit int64 `protobuf:"varint,2,opt,name=credit,proto3" json:"credit,omitempty"` // debit Debit int64 `protobuf:"varint,3,opt,name=debit,proto3" json:"debit,omitempty"` // contains filtered or unexported fields }
func (*AccountResult) Descriptor
deprecated
func (*AccountResult) Descriptor() ([]byte, []int)
Deprecated: Use AccountResult.ProtoReflect.Descriptor instead.
func (*AccountResult) GetAccount ¶
func (x *AccountResult) GetAccount() string
func (*AccountResult) GetCredit ¶
func (x *AccountResult) GetCredit() int64
func (*AccountResult) GetDebit ¶
func (x *AccountResult) GetDebit() int64
func (*AccountResult) ProtoMessage ¶
func (*AccountResult) ProtoMessage()
func (*AccountResult) ProtoReflect ¶
func (x *AccountResult) ProtoReflect() protoreflect.Message
func (*AccountResult) Reset ¶
func (x *AccountResult) Reset()
func (*AccountResult) String ¶
func (x *AccountResult) String() string
type CheckRequest ¶
type CheckRequest struct {
// contains filtered or unexported fields
}
CheckRequest represents an empty response object.
func (*CheckRequest) Descriptor
deprecated
func (*CheckRequest) Descriptor() ([]byte, []int)
Deprecated: Use CheckRequest.ProtoReflect.Descriptor instead.
func (*CheckRequest) ProtoMessage ¶
func (*CheckRequest) ProtoMessage()
func (*CheckRequest) ProtoReflect ¶
func (x *CheckRequest) ProtoReflect() protoreflect.Message
func (*CheckRequest) Reset ¶
func (x *CheckRequest) Reset()
func (*CheckRequest) String ¶
func (x *CheckRequest) String() string
type CheckResponse ¶
type CheckResponse struct { // Server status. Status CheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,proto3,enum=ledger.v1beta.CheckResponse_ServingStatus" json:"status,omitempty"` // contains filtered or unexported fields }
https://github.com/grpc/grpc/blob/master/doc/health-checking.md CheckResponse is the health check status
func (*CheckResponse) Descriptor
deprecated
func (*CheckResponse) Descriptor() ([]byte, []int)
Deprecated: Use CheckResponse.ProtoReflect.Descriptor instead.
func (*CheckResponse) GetStatus ¶
func (x *CheckResponse) GetStatus() CheckResponse_ServingStatus
func (*CheckResponse) ProtoMessage ¶
func (*CheckResponse) ProtoMessage()
func (*CheckResponse) ProtoReflect ¶
func (x *CheckResponse) ProtoReflect() protoreflect.Message
func (*CheckResponse) Reset ¶
func (x *CheckResponse) Reset()
func (*CheckResponse) String ¶
func (x *CheckResponse) String() string
type CheckResponse_ServingStatus ¶
type CheckResponse_ServingStatus int32
ServingStatus is the enum of the possible health check status
const ( // Don't use. It's just the default value. CheckResponse_SERVING_STATUS_UNKNOWN_INVALID CheckResponse_ServingStatus = 0 // Healthy CheckResponse_SERVING_STATUS_SERVING CheckResponse_ServingStatus = 1 // Unhealthy CheckResponse_SERVING_STATUS_NOT_SERVING CheckResponse_ServingStatus = 2 // Used only when streaming CheckResponse_SERVING_STATUS_SERVICE_UNKNOWN CheckResponse_ServingStatus = 3 )
func (CheckResponse_ServingStatus) Descriptor ¶
func (CheckResponse_ServingStatus) Descriptor() protoreflect.EnumDescriptor
func (CheckResponse_ServingStatus) Enum ¶
func (x CheckResponse_ServingStatus) Enum() *CheckResponse_ServingStatus
func (CheckResponse_ServingStatus) EnumDescriptor
deprecated
func (CheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use CheckResponse_ServingStatus.Descriptor instead.
func (CheckResponse_ServingStatus) Number ¶
func (x CheckResponse_ServingStatus) Number() protoreflect.EnumNumber
func (CheckResponse_ServingStatus) String ¶
func (x CheckResponse_ServingStatus) String() string
func (CheckResponse_ServingStatus) Type ¶
func (CheckResponse_ServingStatus) Type() protoreflect.EnumType
type CreateTransactionRequest ¶
type CreateTransactionRequest struct { // ID (UUID) to link the entries to a transaction. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // The list of entries, where len(entries) must be >= 2. Entries []*Entry `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"` // The transaction competence date (execution date). CompetenceDate *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=competence_date,json=competenceDate,proto3" json:"competence_date,omitempty"` // The ledgers owner. Eg.: company name Company string `protobuf:"bytes,4,opt,name=company,proto3" json:"company,omitempty"` // The event which triggered the transaction. Event uint32 `protobuf:"varint,5,opt,name=event,proto3" json:"event,omitempty"` // contains filtered or unexported fields }
CreateTransactionRequest represents a transaction to be saved. A transaction must have at least two entries, with a valid balance. More info here: https://en.wikipedia.org/wiki/Double-entry_bookkeeping
func (*CreateTransactionRequest) Descriptor
deprecated
func (*CreateTransactionRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateTransactionRequest.ProtoReflect.Descriptor instead.
func (*CreateTransactionRequest) GetCompany ¶
func (x *CreateTransactionRequest) GetCompany() string
func (*CreateTransactionRequest) GetCompetenceDate ¶
func (x *CreateTransactionRequest) GetCompetenceDate() *timestamppb.Timestamp
func (*CreateTransactionRequest) GetEntries ¶
func (x *CreateTransactionRequest) GetEntries() []*Entry
func (*CreateTransactionRequest) GetEvent ¶
func (x *CreateTransactionRequest) GetEvent() uint32
func (*CreateTransactionRequest) GetId ¶
func (x *CreateTransactionRequest) GetId() string
func (*CreateTransactionRequest) ProtoMessage ¶
func (*CreateTransactionRequest) ProtoMessage()
func (*CreateTransactionRequest) ProtoReflect ¶
func (x *CreateTransactionRequest) ProtoReflect() protoreflect.Message
func (*CreateTransactionRequest) Reset ¶
func (x *CreateTransactionRequest) Reset()
func (*CreateTransactionRequest) String ¶
func (x *CreateTransactionRequest) String() string
type CreateTransactionResponse ¶
type CreateTransactionResponse struct {
// contains filtered or unexported fields
}
CreateTransactionResponse represents an empty response object.
func (*CreateTransactionResponse) Descriptor
deprecated
func (*CreateTransactionResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateTransactionResponse.ProtoReflect.Descriptor instead.
func (*CreateTransactionResponse) ProtoMessage ¶
func (*CreateTransactionResponse) ProtoMessage()
func (*CreateTransactionResponse) ProtoReflect ¶
func (x *CreateTransactionResponse) ProtoReflect() protoreflect.Message
func (*CreateTransactionResponse) Reset ¶
func (x *CreateTransactionResponse) Reset()
func (*CreateTransactionResponse) String ¶
func (x *CreateTransactionResponse) String() string
type Entry ¶
type Entry struct { // It's the idempotency key, and must be unique (UUID). Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Account involved in the operation. Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` // To deal with optimistic lock. ExpectedVersion int64 `protobuf:"varint,3,opt,name=expected_version,json=expectedVersion,proto3" json:"expected_version,omitempty"` // Operation: debit or credit. Operation Operation `protobuf:"varint,4,opt,name=operation,proto3,enum=ledger.v1beta.Operation" json:"operation,omitempty"` // Amount (in cents). Amount int64 `protobuf:"varint,5,opt,name=amount,proto3" json:"amount,omitempty"` // The entry metadata. Metadata *structpb.Struct `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"` // contains filtered or unexported fields }
Entry represents a new entry on the Ledger.
func (*Entry) Descriptor
deprecated
func (*Entry) GetAccount ¶
func (*Entry) GetExpectedVersion ¶
func (*Entry) GetMetadata ¶
func (*Entry) GetOperation ¶
func (*Entry) ProtoMessage ¶
func (*Entry) ProtoMessage()
func (*Entry) ProtoReflect ¶
func (x *Entry) ProtoReflect() protoreflect.Message
type GetAccountBalanceRequest ¶
type GetAccountBalanceRequest struct { // The account name, can be either a synthetic or an analytical one. Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` // Start date for calculating account balance, INCLUSIVE. // If passed, the version will be the most recent one within the interval. StartDate *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=start_date,json=startDate,proto3" json:"start_date,omitempty"` // End date for calculating account balance, EXCLUSIVE. // If passed, the version will be the most recent one within the interval. EndDate *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=end_date,json=endDate,proto3" json:"end_date,omitempty"` // contains filtered or unexported fields }
GetAccountBalance Request
func (*GetAccountBalanceRequest) Descriptor
deprecated
func (*GetAccountBalanceRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetAccountBalanceRequest.ProtoReflect.Descriptor instead.
func (*GetAccountBalanceRequest) GetAccount ¶
func (x *GetAccountBalanceRequest) GetAccount() string
func (*GetAccountBalanceRequest) GetEndDate ¶
func (x *GetAccountBalanceRequest) GetEndDate() *timestamppb.Timestamp
func (*GetAccountBalanceRequest) GetStartDate ¶
func (x *GetAccountBalanceRequest) GetStartDate() *timestamppb.Timestamp
func (*GetAccountBalanceRequest) ProtoMessage ¶
func (*GetAccountBalanceRequest) ProtoMessage()
func (*GetAccountBalanceRequest) ProtoReflect ¶
func (x *GetAccountBalanceRequest) ProtoReflect() protoreflect.Message
func (*GetAccountBalanceRequest) Reset ¶
func (x *GetAccountBalanceRequest) Reset()
func (*GetAccountBalanceRequest) String ¶
func (x *GetAccountBalanceRequest) String() string
type GetAccountBalanceResponse ¶
type GetAccountBalanceResponse struct { // The account name. Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` // The account version. // When a synthetic account is passed, -1 will be returned. // If either start_date or end_date is passed, the value will be the most recent one within the interval. CurrentVersion int64 `protobuf:"varint,2,opt,name=current_version,json=currentVersion,proto3" json:"current_version,omitempty"` // The account balance. Balance int64 `protobuf:"varint,3,opt,name=balance,proto3" json:"balance,omitempty"` // contains filtered or unexported fields }
GetAccountBalance Response
func (*GetAccountBalanceResponse) Descriptor
deprecated
func (*GetAccountBalanceResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetAccountBalanceResponse.ProtoReflect.Descriptor instead.
func (*GetAccountBalanceResponse) GetAccount ¶
func (x *GetAccountBalanceResponse) GetAccount() string
func (*GetAccountBalanceResponse) GetBalance ¶
func (x *GetAccountBalanceResponse) GetBalance() int64
func (*GetAccountBalanceResponse) GetCurrentVersion ¶
func (x *GetAccountBalanceResponse) GetCurrentVersion() int64
func (*GetAccountBalanceResponse) ProtoMessage ¶
func (*GetAccountBalanceResponse) ProtoMessage()
func (*GetAccountBalanceResponse) ProtoReflect ¶
func (x *GetAccountBalanceResponse) ProtoReflect() protoreflect.Message
func (*GetAccountBalanceResponse) Reset ¶
func (x *GetAccountBalanceResponse) Reset()
func (*GetAccountBalanceResponse) String ¶
func (x *GetAccountBalanceResponse) String() string
type GetSyntheticReportFilters ¶
type GetSyntheticReportFilters struct { // The level of the account path Level int32 `protobuf:"varint,1,opt,name=level,proto3" json:"level,omitempty"` // contains filtered or unexported fields }
Filters
func (*GetSyntheticReportFilters) Descriptor
deprecated
func (*GetSyntheticReportFilters) Descriptor() ([]byte, []int)
Deprecated: Use GetSyntheticReportFilters.ProtoReflect.Descriptor instead.
func (*GetSyntheticReportFilters) GetLevel ¶
func (x *GetSyntheticReportFilters) GetLevel() int32
func (*GetSyntheticReportFilters) ProtoMessage ¶
func (*GetSyntheticReportFilters) ProtoMessage()
func (*GetSyntheticReportFilters) ProtoReflect ¶
func (x *GetSyntheticReportFilters) ProtoReflect() protoreflect.Message
func (*GetSyntheticReportFilters) Reset ¶
func (x *GetSyntheticReportFilters) Reset()
func (*GetSyntheticReportFilters) String ¶
func (x *GetSyntheticReportFilters) String() string
type GetSyntheticReportRequest ¶
type GetSyntheticReportRequest struct { // The account that's going to be queried. Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` // Start date of the range (timestamp). StartDate *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=start_date,json=startDate,proto3" json:"start_date,omitempty"` // End date of the range (timestamp). EndDate *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=end_date,json=endDate,proto3" json:"end_date,omitempty"` // Optional filters Filters *GetSyntheticReportFilters `protobuf:"bytes,4,opt,name=filters,proto3" json:"filters,omitempty"` // TODO use gRPC pagination // contains filtered or unexported fields }
Represents a syntethic report request
func (*GetSyntheticReportRequest) Descriptor
deprecated
func (*GetSyntheticReportRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetSyntheticReportRequest.ProtoReflect.Descriptor instead.
func (*GetSyntheticReportRequest) GetAccount ¶
func (x *GetSyntheticReportRequest) GetAccount() string
func (*GetSyntheticReportRequest) GetEndDate ¶
func (x *GetSyntheticReportRequest) GetEndDate() *timestamppb.Timestamp
func (*GetSyntheticReportRequest) GetFilters ¶
func (x *GetSyntheticReportRequest) GetFilters() *GetSyntheticReportFilters
func (*GetSyntheticReportRequest) GetStartDate ¶
func (x *GetSyntheticReportRequest) GetStartDate() *timestamppb.Timestamp
func (*GetSyntheticReportRequest) ProtoMessage ¶
func (*GetSyntheticReportRequest) ProtoMessage()
func (*GetSyntheticReportRequest) ProtoReflect ¶
func (x *GetSyntheticReportRequest) ProtoReflect() protoreflect.Message
func (*GetSyntheticReportRequest) Reset ¶
func (x *GetSyntheticReportRequest) Reset()
func (*GetSyntheticReportRequest) String ¶
func (x *GetSyntheticReportRequest) String() string
type GetSyntheticReportResponse ¶
type GetSyntheticReportResponse struct { // All credit accumulated TotalCredit int64 `protobuf:"varint,2,opt,name=total_credit,json=totalCredit,proto3" json:"total_credit,omitempty"` // All debit accumulated TotalDebit int64 `protobuf:"varint,3,opt,name=total_debit,json=totalDebit,proto3" json:"total_debit,omitempty"` // The paths Results []*AccountResult `protobuf:"bytes,4,rep,name=results,proto3" json:"results,omitempty"` // contains filtered or unexported fields }
GetSyntheticReport Response
func (*GetSyntheticReportResponse) Descriptor
deprecated
func (*GetSyntheticReportResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetSyntheticReportResponse.ProtoReflect.Descriptor instead.
func (*GetSyntheticReportResponse) GetResults ¶
func (x *GetSyntheticReportResponse) GetResults() []*AccountResult
func (*GetSyntheticReportResponse) GetTotalCredit ¶
func (x *GetSyntheticReportResponse) GetTotalCredit() int64
func (*GetSyntheticReportResponse) GetTotalDebit ¶
func (x *GetSyntheticReportResponse) GetTotalDebit() int64
func (*GetSyntheticReportResponse) ProtoMessage ¶
func (*GetSyntheticReportResponse) ProtoMessage()
func (*GetSyntheticReportResponse) ProtoReflect ¶
func (x *GetSyntheticReportResponse) ProtoReflect() protoreflect.Message
func (*GetSyntheticReportResponse) Reset ¶
func (x *GetSyntheticReportResponse) Reset()
func (*GetSyntheticReportResponse) String ¶
func (x *GetSyntheticReportResponse) String() string
type HealthAPIClient ¶
type HealthAPIClient interface { // Check - checks the system health. Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error) }
HealthAPIClient is the client API for HealthAPI 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 NewHealthAPIClient ¶
func NewHealthAPIClient(cc grpc.ClientConnInterface) HealthAPIClient
type HealthAPIServer ¶
type HealthAPIServer interface { // Check - checks the system health. Check(context.Context, *CheckRequest) (*CheckResponse, error) }
HealthAPIServer is the server API for HealthAPI service. All implementations should embed UnimplementedHealthAPIServer for forward compatibility
type LedgerAPIClient ¶
type LedgerAPIClient interface { CreateTransaction(ctx context.Context, in *CreateTransactionRequest, opts ...grpc.CallOption) (*CreateTransactionResponse, error) GetAccountBalance(ctx context.Context, in *GetAccountBalanceRequest, opts ...grpc.CallOption) (*GetAccountBalanceResponse, error) ListAccountEntries(ctx context.Context, in *ListAccountEntriesRequest, opts ...grpc.CallOption) (*ListAccountEntriesResponse, error) GetSyntheticReport(ctx context.Context, in *GetSyntheticReportRequest, opts ...grpc.CallOption) (*GetSyntheticReportResponse, error) }
LedgerAPIClient is the client API for LedgerAPI 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 NewLedgerAPIClient ¶
func NewLedgerAPIClient(cc grpc.ClientConnInterface) LedgerAPIClient
type LedgerAPIServer ¶
type LedgerAPIServer interface { CreateTransaction(context.Context, *CreateTransactionRequest) (*CreateTransactionResponse, error) GetAccountBalance(context.Context, *GetAccountBalanceRequest) (*GetAccountBalanceResponse, error) ListAccountEntries(context.Context, *ListAccountEntriesRequest) (*ListAccountEntriesResponse, error) GetSyntheticReport(context.Context, *GetSyntheticReportRequest) (*GetSyntheticReportResponse, error) }
LedgerAPIServer is the server API for LedgerAPI service. All implementations should embed UnimplementedLedgerAPIServer for forward compatibility
type ListAccountEntriesRequest ¶
type ListAccountEntriesRequest struct { // The account path Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` // Start history date StartDate *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=start_date,json=startDate,proto3" json:"start_date,omitempty"` // End history date EndDate *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=end_date,json=endDate,proto3" json:"end_date,omitempty"` // Filters Filter *ListAccountEntriesRequest_Filter `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"` // Pagination Page *RequestPagination `protobuf:"bytes,5,opt,name=page,proto3" json:"page,omitempty"` // contains filtered or unexported fields }
ListAccountEntries Request
func (*ListAccountEntriesRequest) Descriptor
deprecated
func (*ListAccountEntriesRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListAccountEntriesRequest.ProtoReflect.Descriptor instead.
func (*ListAccountEntriesRequest) GetAccount ¶
func (x *ListAccountEntriesRequest) GetAccount() string
func (*ListAccountEntriesRequest) GetEndDate ¶
func (x *ListAccountEntriesRequest) GetEndDate() *timestamppb.Timestamp
func (*ListAccountEntriesRequest) GetFilter ¶
func (x *ListAccountEntriesRequest) GetFilter() *ListAccountEntriesRequest_Filter
func (*ListAccountEntriesRequest) GetPage ¶
func (x *ListAccountEntriesRequest) GetPage() *RequestPagination
func (*ListAccountEntriesRequest) GetStartDate ¶
func (x *ListAccountEntriesRequest) GetStartDate() *timestamppb.Timestamp
func (*ListAccountEntriesRequest) ProtoMessage ¶
func (*ListAccountEntriesRequest) ProtoMessage()
func (*ListAccountEntriesRequest) ProtoReflect ¶
func (x *ListAccountEntriesRequest) ProtoReflect() protoreflect.Message
func (*ListAccountEntriesRequest) Reset ¶
func (x *ListAccountEntriesRequest) Reset()
func (*ListAccountEntriesRequest) String ¶
func (x *ListAccountEntriesRequest) String() string
type ListAccountEntriesRequest_Filter ¶
type ListAccountEntriesRequest_Filter struct { // Companies Companies []string `protobuf:"bytes,1,rep,name=companies,proto3" json:"companies,omitempty"` // Events Events []int32 `protobuf:"varint,2,rep,packed,name=events,proto3" json:"events,omitempty"` // Operation Operation Operation `protobuf:"varint,3,opt,name=operation,proto3,enum=ledger.v1beta.Operation" json:"operation,omitempty"` // contains filtered or unexported fields }
func (*ListAccountEntriesRequest_Filter) Descriptor
deprecated
func (*ListAccountEntriesRequest_Filter) Descriptor() ([]byte, []int)
Deprecated: Use ListAccountEntriesRequest_Filter.ProtoReflect.Descriptor instead.
func (*ListAccountEntriesRequest_Filter) GetCompanies ¶
func (x *ListAccountEntriesRequest_Filter) GetCompanies() []string
func (*ListAccountEntriesRequest_Filter) GetEvents ¶
func (x *ListAccountEntriesRequest_Filter) GetEvents() []int32
func (*ListAccountEntriesRequest_Filter) GetOperation ¶
func (x *ListAccountEntriesRequest_Filter) GetOperation() Operation
func (*ListAccountEntriesRequest_Filter) ProtoMessage ¶
func (*ListAccountEntriesRequest_Filter) ProtoMessage()
func (*ListAccountEntriesRequest_Filter) ProtoReflect ¶
func (x *ListAccountEntriesRequest_Filter) ProtoReflect() protoreflect.Message
func (*ListAccountEntriesRequest_Filter) Reset ¶
func (x *ListAccountEntriesRequest_Filter) Reset()
func (*ListAccountEntriesRequest_Filter) String ¶
func (x *ListAccountEntriesRequest_Filter) String() string
type ListAccountEntriesResponse ¶
type ListAccountEntriesResponse struct { // List of entries of a given account Entries []*AccountEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` // Cursor that references the next page. Empty string if there is no next page NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` // contains filtered or unexported fields }
ListAccountEntries Response
func (*ListAccountEntriesResponse) Descriptor
deprecated
func (*ListAccountEntriesResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListAccountEntriesResponse.ProtoReflect.Descriptor instead.
func (*ListAccountEntriesResponse) GetEntries ¶
func (x *ListAccountEntriesResponse) GetEntries() []*AccountEntry
func (*ListAccountEntriesResponse) GetNextPageToken ¶
func (x *ListAccountEntriesResponse) GetNextPageToken() string
func (*ListAccountEntriesResponse) ProtoMessage ¶
func (*ListAccountEntriesResponse) ProtoMessage()
func (*ListAccountEntriesResponse) ProtoReflect ¶
func (x *ListAccountEntriesResponse) ProtoReflect() protoreflect.Message
func (*ListAccountEntriesResponse) Reset ¶
func (x *ListAccountEntriesResponse) Reset()
func (*ListAccountEntriesResponse) String ¶
func (x *ListAccountEntriesResponse) String() string
type Operation ¶
type Operation int32
Operation has the possible operations to be used in Entry.
func (Operation) Descriptor ¶
func (Operation) Descriptor() protoreflect.EnumDescriptor
func (Operation) EnumDescriptor
deprecated
func (Operation) Number ¶
func (x Operation) Number() protoreflect.EnumNumber
func (Operation) Type ¶
func (Operation) Type() protoreflect.EnumType
type RequestPagination ¶
type RequestPagination struct { // Max of 50, defaults to 10. PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // Cursor for the next page. PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` // contains filtered or unexported fields }
Request Pagination
func (*RequestPagination) Descriptor
deprecated
func (*RequestPagination) Descriptor() ([]byte, []int)
Deprecated: Use RequestPagination.ProtoReflect.Descriptor instead.
func (*RequestPagination) GetPageSize ¶
func (x *RequestPagination) GetPageSize() int32
func (*RequestPagination) GetPageToken ¶
func (x *RequestPagination) GetPageToken() string
func (*RequestPagination) ProtoMessage ¶
func (*RequestPagination) ProtoMessage()
func (*RequestPagination) ProtoReflect ¶
func (x *RequestPagination) ProtoReflect() protoreflect.Message
func (*RequestPagination) Reset ¶
func (x *RequestPagination) Reset()
func (*RequestPagination) String ¶
func (x *RequestPagination) String() string
type UnimplementedHealthAPIServer ¶
type UnimplementedHealthAPIServer struct { }
UnimplementedHealthAPIServer should be embedded to have forward compatible implementations.
func (UnimplementedHealthAPIServer) Check ¶
func (UnimplementedHealthAPIServer) Check(context.Context, *CheckRequest) (*CheckResponse, error)
type UnimplementedLedgerAPIServer ¶
type UnimplementedLedgerAPIServer struct { }
UnimplementedLedgerAPIServer should be embedded to have forward compatible implementations.
func (UnimplementedLedgerAPIServer) CreateTransaction ¶
func (UnimplementedLedgerAPIServer) CreateTransaction(context.Context, *CreateTransactionRequest) (*CreateTransactionResponse, error)
func (UnimplementedLedgerAPIServer) GetAccountBalance ¶
func (UnimplementedLedgerAPIServer) GetAccountBalance(context.Context, *GetAccountBalanceRequest) (*GetAccountBalanceResponse, error)
func (UnimplementedLedgerAPIServer) GetSyntheticReport ¶
func (UnimplementedLedgerAPIServer) GetSyntheticReport(context.Context, *GetSyntheticReportRequest) (*GetSyntheticReportResponse, error)
func (UnimplementedLedgerAPIServer) ListAccountEntries ¶
func (UnimplementedLedgerAPIServer) ListAccountEntries(context.Context, *ListAccountEntriesRequest) (*ListAccountEntriesResponse, error)
type UnsafeHealthAPIServer ¶
type UnsafeHealthAPIServer interface {
// contains filtered or unexported methods
}
UnsafeHealthAPIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HealthAPIServer will result in compilation errors.
type UnsafeLedgerAPIServer ¶
type UnsafeLedgerAPIServer interface {
// contains filtered or unexported methods
}
UnsafeLedgerAPIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to LedgerAPIServer will result in compilation errors.