ledgerv1

package
v1.29.14 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package ledgerv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package ledgerv1 is a generated GoMock package.

Index

Constants

View Source
const (
	LedgerService_SearchLedgers_FullMethodName            = "/ledger.v1.LedgerService/SearchLedgers"
	LedgerService_CreateLedger_FullMethodName             = "/ledger.v1.LedgerService/CreateLedger"
	LedgerService_UpdateLedger_FullMethodName             = "/ledger.v1.LedgerService/UpdateLedger"
	LedgerService_SearchAccounts_FullMethodName           = "/ledger.v1.LedgerService/SearchAccounts"
	LedgerService_CreateAccount_FullMethodName            = "/ledger.v1.LedgerService/CreateAccount"
	LedgerService_UpdateAccount_FullMethodName            = "/ledger.v1.LedgerService/UpdateAccount"
	LedgerService_SearchTransactions_FullMethodName       = "/ledger.v1.LedgerService/SearchTransactions"
	LedgerService_CreateTransaction_FullMethodName        = "/ledger.v1.LedgerService/CreateTransaction"
	LedgerService_ReverseTransaction_FullMethodName       = "/ledger.v1.LedgerService/ReverseTransaction"
	LedgerService_UpdateTransaction_FullMethodName        = "/ledger.v1.LedgerService/UpdateTransaction"
	LedgerService_SearchTransactionEntries_FullMethodName = "/ledger.v1.LedgerService/SearchTransactionEntries"
)

Variables

View Source
var (
	LedgerType_name = map[int32]string{
		0: "ASSET",
		1: "LIABILITY",
		2: "INCOME",
		3: "EXPENSE",
		4: "CAPITAL",
	}
	LedgerType_value = map[string]int32{
		"ASSET":     0,
		"LIABILITY": 1,
		"INCOME":    2,
		"EXPENSE":   3,
		"CAPITAL":   4,
	}
)

Enum value maps for LedgerType.

View Source
var (
	TransactionType_name = map[int32]string{
		0: "NORMAL",
		1: "REVERSAL",
		2: "RESERVATION",
	}
	TransactionType_value = map[string]int32{
		"NORMAL":      0,
		"REVERSAL":    1,
		"RESERVATION": 2,
	}
)

Enum value maps for TransactionType.

View Source
var File_ledger_v1_ledger_proto protoreflect.FileDescriptor
View Source
var LedgerService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "ledger.v1.LedgerService",
	HandlerType: (*LedgerServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateLedger",
			Handler:    _LedgerService_CreateLedger_Handler,
		},
		{
			MethodName: "UpdateLedger",
			Handler:    _LedgerService_UpdateLedger_Handler,
		},
		{
			MethodName: "CreateAccount",
			Handler:    _LedgerService_CreateAccount_Handler,
		},
		{
			MethodName: "UpdateAccount",
			Handler:    _LedgerService_UpdateAccount_Handler,
		},
		{
			MethodName: "CreateTransaction",
			Handler:    _LedgerService_CreateTransaction_Handler,
		},
		{
			MethodName: "ReverseTransaction",
			Handler:    _LedgerService_ReverseTransaction_Handler,
		},
		{
			MethodName: "UpdateTransaction",
			Handler:    _LedgerService_UpdateTransaction_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "SearchLedgers",
			Handler:       _LedgerService_SearchLedgers_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "SearchAccounts",
			Handler:       _LedgerService_SearchAccounts_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "SearchTransactions",
			Handler:       _LedgerService_SearchTransactions_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "SearchTransactionEntries",
			Handler:       _LedgerService_SearchTransactionEntries_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "ledger/v1/ledger.proto",
}

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

Functions

func CreateProxyHandler added in v1.28.4

func CreateProxyHandler(ctx context.Context, proxyOptions common.ProxyOptions) (*http.ServeMux, error)

func RegisterLedgerServiceHandler added in v1.28.0

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

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

func RegisterLedgerServiceHandlerClient added in v1.28.0

func RegisterLedgerServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LedgerServiceClient) error

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

func RegisterLedgerServiceHandlerFromEndpoint added in v1.28.0

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

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

func RegisterLedgerServiceHandlerServer added in v1.28.0

func RegisterLedgerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LedgerServiceServer) error

RegisterLedgerServiceHandlerServer registers the http handlers for service LedgerService to "mux". UnaryRPC :call LedgerServiceServer 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 RegisterLedgerServiceHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.

func RegisterLedgerServiceServer

func RegisterLedgerServiceServer(s grpc.ServiceRegistrar, srv LedgerServiceServer)

func ToContext

func ToContext(ctx context.Context, client *LedgerClient) context.Context

Types

type Account

type Account struct {
	Reference        string            `protobuf:"bytes,1,opt,name=reference,proto3" json:"reference,omitempty"`
	Ledger           string            `protobuf:"bytes,3,opt,name=ledger,proto3" json:"ledger,omitempty"`
	Balance          *money.Money      `protobuf:"bytes,4,opt,name=balance,proto3" json:"balance,omitempty"`
	Data             map[string]string `` /* 149-byte string literal not displayed */
	UnclearedBalance *money.Money      `protobuf:"bytes,6,opt,name=uncleared_balance,json=unclearedBalance,proto3" json:"uncleared_balance,omitempty"`
	ReservedBalance  *money.Money      `protobuf:"bytes,7,opt,name=reserved_balance,json=reservedBalance,proto3" json:"reserved_balance,omitempty"`
	// contains filtered or unexported fields
}

func (*Account) Descriptor deprecated

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

Deprecated: Use Account.ProtoReflect.Descriptor instead.

func (*Account) GetBalance

func (x *Account) GetBalance() *money.Money

func (*Account) GetData

func (x *Account) GetData() map[string]string

func (*Account) GetLedger

func (x *Account) GetLedger() string

func (*Account) GetReference

func (x *Account) GetReference() string

func (*Account) GetReservedBalance added in v1.20.5

func (x *Account) GetReservedBalance() *money.Money

func (*Account) GetUnclearedBalance added in v1.20.5

func (x *Account) GetUnclearedBalance() *money.Money

func (*Account) ProtoMessage

func (*Account) ProtoMessage()

func (*Account) ProtoReflect

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

func (*Account) Reset

func (x *Account) Reset()

func (*Account) String

func (x *Account) String() string

type Ledger

type Ledger struct {
	Reference string            `protobuf:"bytes,1,opt,name=reference,proto3" json:"reference,omitempty"`
	Type      LedgerType        `protobuf:"varint,2,opt,name=type,proto3,enum=ledger.v1.LedgerType" json:"type,omitempty"`
	Parent    string            `protobuf:"bytes,3,opt,name=parent,proto3" json:"parent,omitempty"`
	Data      map[string]string `` /* 149-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Ledger) Descriptor deprecated

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

Deprecated: Use Ledger.ProtoReflect.Descriptor instead.

func (*Ledger) GetData

func (x *Ledger) GetData() map[string]string

func (*Ledger) GetParent

func (x *Ledger) GetParent() string

func (*Ledger) GetReference

func (x *Ledger) GetReference() string

func (*Ledger) GetType

func (x *Ledger) GetType() LedgerType

func (*Ledger) ProtoMessage

func (*Ledger) ProtoMessage()

func (*Ledger) ProtoReflect

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

func (*Ledger) Reset

func (x *Ledger) Reset()

func (*Ledger) String

func (x *Ledger) String() string

type LedgerClient

type LedgerClient struct {
	*common.GrpcClientBase

	// The gRPC API Client.
	Client LedgerServiceClient
}

LedgerClient is a Client for interacting with the notification service API.

Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

func FromContext

func FromContext(ctx context.Context) *LedgerClient

func Init added in v1.9.1

func NewLedgerClient

func NewLedgerClient(ctx context.Context, opts ...common.ClientOption) (*LedgerClient, error)

NewLedgerClient creates a new notification Client.

The service that an application uses to send and access received messages

type LedgerServiceClient

type LedgerServiceClient interface {
	// Searches for an ledger based on details
	SearchLedgers(ctx context.Context, in *v1.SearchRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Ledger], error)
	// Creates a new ledger based on supplied data
	CreateLedger(ctx context.Context, in *Ledger, opts ...grpc.CallOption) (*Ledger, error)
	// Updates the data component of the ledger.
	UpdateLedger(ctx context.Context, in *Ledger, opts ...grpc.CallOption) (*Ledger, error)
	// Searches for an account based on details
	SearchAccounts(ctx context.Context, in *v1.SearchRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Account], error)
	// Creates a new account based on supplied data
	CreateAccount(ctx context.Context, in *Account, opts ...grpc.CallOption) (*Account, error)
	// Updates the data component of the account.
	UpdateAccount(ctx context.Context, in *Account, opts ...grpc.CallOption) (*Account, error)
	// Searches for a transaction based on details
	SearchTransactions(ctx context.Context, in *v1.SearchRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Transaction], error)
	// Creates a new transaction
	CreateTransaction(ctx context.Context, in *Transaction, opts ...grpc.CallOption) (*Transaction, error)
	// Reverses a transaction by creating a new one with inverted entries
	ReverseTransaction(ctx context.Context, in *Transaction, opts ...grpc.CallOption) (*Transaction, error)
	// Updates a transaction's details
	UpdateTransaction(ctx context.Context, in *Transaction, opts ...grpc.CallOption) (*Transaction, error)
	// Searches for entries matching the search details
	SearchTransactionEntries(ctx context.Context, in *v1.SearchRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[TransactionEntry], error)
}

LedgerServiceClient is the client API for LedgerService 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.

The ledger service definition.

type LedgerServiceServer

type LedgerServiceServer interface {
	// Searches for an ledger based on details
	SearchLedgers(*v1.SearchRequest, grpc.ServerStreamingServer[Ledger]) error
	// Creates a new ledger based on supplied data
	CreateLedger(context.Context, *Ledger) (*Ledger, error)
	// Updates the data component of the ledger.
	UpdateLedger(context.Context, *Ledger) (*Ledger, error)
	// Searches for an account based on details
	SearchAccounts(*v1.SearchRequest, grpc.ServerStreamingServer[Account]) error
	// Creates a new account based on supplied data
	CreateAccount(context.Context, *Account) (*Account, error)
	// Updates the data component of the account.
	UpdateAccount(context.Context, *Account) (*Account, error)
	// Searches for a transaction based on details
	SearchTransactions(*v1.SearchRequest, grpc.ServerStreamingServer[Transaction]) error
	// Creates a new transaction
	CreateTransaction(context.Context, *Transaction) (*Transaction, error)
	// Reverses a transaction by creating a new one with inverted entries
	ReverseTransaction(context.Context, *Transaction) (*Transaction, error)
	// Updates a transaction's details
	UpdateTransaction(context.Context, *Transaction) (*Transaction, error)
	// Searches for entries matching the search details
	SearchTransactionEntries(*v1.SearchRequest, grpc.ServerStreamingServer[TransactionEntry]) error
	// contains filtered or unexported methods
}

LedgerServiceServer is the server API for LedgerService service. All implementations must embed UnimplementedLedgerServiceServer for forward compatibility.

The ledger service definition.

type LedgerService_SearchAccountsClient

type LedgerService_SearchAccountsClient = grpc.ServerStreamingClient[Account]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type LedgerService_SearchAccountsServer

type LedgerService_SearchAccountsServer = grpc.ServerStreamingServer[Account]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type LedgerService_SearchLedgersClient

type LedgerService_SearchLedgersClient = grpc.ServerStreamingClient[Ledger]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type LedgerService_SearchLedgersServer

type LedgerService_SearchLedgersServer = grpc.ServerStreamingServer[Ledger]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type LedgerService_SearchTransactionEntriesClient

type LedgerService_SearchTransactionEntriesClient = grpc.ServerStreamingClient[TransactionEntry]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type LedgerService_SearchTransactionEntriesServer

type LedgerService_SearchTransactionEntriesServer = grpc.ServerStreamingServer[TransactionEntry]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type LedgerService_SearchTransactionsClient

type LedgerService_SearchTransactionsClient = grpc.ServerStreamingClient[Transaction]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type LedgerService_SearchTransactionsServer

type LedgerService_SearchTransactionsServer = grpc.ServerStreamingServer[Transaction]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type LedgerType

type LedgerType int32

buf:lint:ignore ENUM_VALUE_PREFIX

const (
	// buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX
	LedgerType_ASSET     LedgerType = 0
	LedgerType_LIABILITY LedgerType = 1
	LedgerType_INCOME    LedgerType = 2
	LedgerType_EXPENSE   LedgerType = 3
	LedgerType_CAPITAL   LedgerType = 4
)

func (LedgerType) Descriptor

func (LedgerType) Descriptor() protoreflect.EnumDescriptor

func (LedgerType) Enum

func (x LedgerType) Enum() *LedgerType

func (LedgerType) EnumDescriptor deprecated

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

Deprecated: Use LedgerType.Descriptor instead.

func (LedgerType) Number

func (x LedgerType) Number() protoreflect.EnumNumber

func (LedgerType) String

func (x LedgerType) String() string

func (LedgerType) Type

type MockLedgerServiceClient

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

MockLedgerServiceClient is a mock of LedgerServiceClient interface.

func NewMockLedgerServiceClient

func NewMockLedgerServiceClient(ctrl *gomock.Controller) *MockLedgerServiceClient

NewMockLedgerServiceClient creates a new mock instance.

func (*MockLedgerServiceClient) CreateAccount

func (m *MockLedgerServiceClient) CreateAccount(ctx context.Context, in *Account, opts ...grpc.CallOption) (*Account, error)

CreateAccount mocks base method.

func (*MockLedgerServiceClient) CreateLedger

func (m *MockLedgerServiceClient) CreateLedger(ctx context.Context, in *Ledger, opts ...grpc.CallOption) (*Ledger, error)

CreateLedger mocks base method.

func (*MockLedgerServiceClient) CreateTransaction

func (m *MockLedgerServiceClient) CreateTransaction(ctx context.Context, in *Transaction, opts ...grpc.CallOption) (*Transaction, error)

CreateTransaction mocks base method.

func (*MockLedgerServiceClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockLedgerServiceClient) ReverseTransaction

func (m *MockLedgerServiceClient) ReverseTransaction(ctx context.Context, in *Transaction, opts ...grpc.CallOption) (*Transaction, error)

ReverseTransaction mocks base method.

func (*MockLedgerServiceClient) SearchAccounts

SearchAccounts mocks base method.

func (*MockLedgerServiceClient) SearchLedgers

SearchLedgers mocks base method.

func (*MockLedgerServiceClient) SearchTransactionEntries

SearchTransactionEntries mocks base method.

func (*MockLedgerServiceClient) SearchTransactions

SearchTransactions mocks base method.

func (*MockLedgerServiceClient) UpdateAccount

func (m *MockLedgerServiceClient) UpdateAccount(ctx context.Context, in *Account, opts ...grpc.CallOption) (*Account, error)

UpdateAccount mocks base method.

func (*MockLedgerServiceClient) UpdateLedger

func (m *MockLedgerServiceClient) UpdateLedger(ctx context.Context, in *Ledger, opts ...grpc.CallOption) (*Ledger, error)

UpdateLedger mocks base method.

func (*MockLedgerServiceClient) UpdateTransaction

func (m *MockLedgerServiceClient) UpdateTransaction(ctx context.Context, in *Transaction, opts ...grpc.CallOption) (*Transaction, error)

UpdateTransaction mocks base method.

type MockLedgerServiceClientMockRecorder

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

MockLedgerServiceClientMockRecorder is the mock recorder for MockLedgerServiceClient.

func (*MockLedgerServiceClientMockRecorder) CreateAccount

func (mr *MockLedgerServiceClientMockRecorder) CreateAccount(ctx, in any, opts ...any) *gomock.Call

CreateAccount indicates an expected call of CreateAccount.

func (*MockLedgerServiceClientMockRecorder) CreateLedger

func (mr *MockLedgerServiceClientMockRecorder) CreateLedger(ctx, in any, opts ...any) *gomock.Call

CreateLedger indicates an expected call of CreateLedger.

func (*MockLedgerServiceClientMockRecorder) CreateTransaction

func (mr *MockLedgerServiceClientMockRecorder) CreateTransaction(ctx, in any, opts ...any) *gomock.Call

CreateTransaction indicates an expected call of CreateTransaction.

func (*MockLedgerServiceClientMockRecorder) ReverseTransaction

func (mr *MockLedgerServiceClientMockRecorder) ReverseTransaction(ctx, in any, opts ...any) *gomock.Call

ReverseTransaction indicates an expected call of ReverseTransaction.

func (*MockLedgerServiceClientMockRecorder) SearchAccounts

func (mr *MockLedgerServiceClientMockRecorder) SearchAccounts(ctx, in any, opts ...any) *gomock.Call

SearchAccounts indicates an expected call of SearchAccounts.

func (*MockLedgerServiceClientMockRecorder) SearchLedgers

func (mr *MockLedgerServiceClientMockRecorder) SearchLedgers(ctx, in any, opts ...any) *gomock.Call

SearchLedgers indicates an expected call of SearchLedgers.

func (*MockLedgerServiceClientMockRecorder) SearchTransactionEntries

func (mr *MockLedgerServiceClientMockRecorder) SearchTransactionEntries(ctx, in any, opts ...any) *gomock.Call

SearchTransactionEntries indicates an expected call of SearchTransactionEntries.

func (*MockLedgerServiceClientMockRecorder) SearchTransactions

func (mr *MockLedgerServiceClientMockRecorder) SearchTransactions(ctx, in any, opts ...any) *gomock.Call

SearchTransactions indicates an expected call of SearchTransactions.

func (*MockLedgerServiceClientMockRecorder) UpdateAccount

func (mr *MockLedgerServiceClientMockRecorder) UpdateAccount(ctx, in any, opts ...any) *gomock.Call

UpdateAccount indicates an expected call of UpdateAccount.

func (*MockLedgerServiceClientMockRecorder) UpdateLedger

func (mr *MockLedgerServiceClientMockRecorder) UpdateLedger(ctx, in any, opts ...any) *gomock.Call

UpdateLedger indicates an expected call of UpdateLedger.

func (*MockLedgerServiceClientMockRecorder) UpdateTransaction

func (mr *MockLedgerServiceClientMockRecorder) UpdateTransaction(ctx, in any, opts ...any) *gomock.Call

UpdateTransaction indicates an expected call of UpdateTransaction.

type MockLedgerServiceServer

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

MockLedgerServiceServer is a mock of LedgerServiceServer interface.

func NewMockLedgerServiceServer

func NewMockLedgerServiceServer(ctrl *gomock.Controller) *MockLedgerServiceServer

NewMockLedgerServiceServer creates a new mock instance.

func (*MockLedgerServiceServer) CreateAccount

func (m *MockLedgerServiceServer) CreateAccount(arg0 context.Context, arg1 *Account) (*Account, error)

CreateAccount mocks base method.

func (*MockLedgerServiceServer) CreateLedger

func (m *MockLedgerServiceServer) CreateLedger(arg0 context.Context, arg1 *Ledger) (*Ledger, error)

CreateLedger mocks base method.

func (*MockLedgerServiceServer) CreateTransaction

func (m *MockLedgerServiceServer) CreateTransaction(arg0 context.Context, arg1 *Transaction) (*Transaction, error)

CreateTransaction mocks base method.

func (*MockLedgerServiceServer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockLedgerServiceServer) ReverseTransaction

func (m *MockLedgerServiceServer) ReverseTransaction(arg0 context.Context, arg1 *Transaction) (*Transaction, error)

ReverseTransaction mocks base method.

func (*MockLedgerServiceServer) SearchAccounts

SearchAccounts mocks base method.

func (*MockLedgerServiceServer) SearchLedgers

SearchLedgers mocks base method.

func (*MockLedgerServiceServer) SearchTransactionEntries

SearchTransactionEntries mocks base method.

func (*MockLedgerServiceServer) SearchTransactions

SearchTransactions mocks base method.

func (*MockLedgerServiceServer) UpdateAccount

func (m *MockLedgerServiceServer) UpdateAccount(arg0 context.Context, arg1 *Account) (*Account, error)

UpdateAccount mocks base method.

func (*MockLedgerServiceServer) UpdateLedger

func (m *MockLedgerServiceServer) UpdateLedger(arg0 context.Context, arg1 *Ledger) (*Ledger, error)

UpdateLedger mocks base method.

func (*MockLedgerServiceServer) UpdateTransaction

func (m *MockLedgerServiceServer) UpdateTransaction(arg0 context.Context, arg1 *Transaction) (*Transaction, error)

UpdateTransaction mocks base method.

type MockLedgerServiceServerMockRecorder

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

MockLedgerServiceServerMockRecorder is the mock recorder for MockLedgerServiceServer.

func (*MockLedgerServiceServerMockRecorder) CreateAccount

func (mr *MockLedgerServiceServerMockRecorder) CreateAccount(arg0, arg1 any) *gomock.Call

CreateAccount indicates an expected call of CreateAccount.

func (*MockLedgerServiceServerMockRecorder) CreateLedger

func (mr *MockLedgerServiceServerMockRecorder) CreateLedger(arg0, arg1 any) *gomock.Call

CreateLedger indicates an expected call of CreateLedger.

func (*MockLedgerServiceServerMockRecorder) CreateTransaction

func (mr *MockLedgerServiceServerMockRecorder) CreateTransaction(arg0, arg1 any) *gomock.Call

CreateTransaction indicates an expected call of CreateTransaction.

func (*MockLedgerServiceServerMockRecorder) ReverseTransaction

func (mr *MockLedgerServiceServerMockRecorder) ReverseTransaction(arg0, arg1 any) *gomock.Call

ReverseTransaction indicates an expected call of ReverseTransaction.

func (*MockLedgerServiceServerMockRecorder) SearchAccounts

func (mr *MockLedgerServiceServerMockRecorder) SearchAccounts(arg0, arg1 any) *gomock.Call

SearchAccounts indicates an expected call of SearchAccounts.

func (*MockLedgerServiceServerMockRecorder) SearchLedgers

func (mr *MockLedgerServiceServerMockRecorder) SearchLedgers(arg0, arg1 any) *gomock.Call

SearchLedgers indicates an expected call of SearchLedgers.

func (*MockLedgerServiceServerMockRecorder) SearchTransactionEntries

func (mr *MockLedgerServiceServerMockRecorder) SearchTransactionEntries(arg0, arg1 any) *gomock.Call

SearchTransactionEntries indicates an expected call of SearchTransactionEntries.

func (*MockLedgerServiceServerMockRecorder) SearchTransactions

func (mr *MockLedgerServiceServerMockRecorder) SearchTransactions(arg0, arg1 any) *gomock.Call

SearchTransactions indicates an expected call of SearchTransactions.

func (*MockLedgerServiceServerMockRecorder) UpdateAccount

func (mr *MockLedgerServiceServerMockRecorder) UpdateAccount(arg0, arg1 any) *gomock.Call

UpdateAccount indicates an expected call of UpdateAccount.

func (*MockLedgerServiceServerMockRecorder) UpdateLedger

func (mr *MockLedgerServiceServerMockRecorder) UpdateLedger(arg0, arg1 any) *gomock.Call

UpdateLedger indicates an expected call of UpdateLedger.

func (*MockLedgerServiceServerMockRecorder) UpdateTransaction

func (mr *MockLedgerServiceServerMockRecorder) UpdateTransaction(arg0, arg1 any) *gomock.Call

UpdateTransaction indicates an expected call of UpdateTransaction.

type MockUnsafeLedgerServiceServer

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

MockUnsafeLedgerServiceServer is a mock of UnsafeLedgerServiceServer interface.

func NewMockUnsafeLedgerServiceServer

func NewMockUnsafeLedgerServiceServer(ctrl *gomock.Controller) *MockUnsafeLedgerServiceServer

NewMockUnsafeLedgerServiceServer creates a new mock instance.

func (*MockUnsafeLedgerServiceServer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockUnsafeLedgerServiceServerMockRecorder

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

MockUnsafeLedgerServiceServerMockRecorder is the mock recorder for MockUnsafeLedgerServiceServer.

type SearchRequest

type SearchRequest struct {
	Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
	// contains filtered or unexported fields
}

func (*SearchRequest) Descriptor deprecated

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

Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead.

func (*SearchRequest) GetQuery

func (x *SearchRequest) GetQuery() string

func (*SearchRequest) ProtoMessage

func (*SearchRequest) ProtoMessage()

func (*SearchRequest) ProtoReflect

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

func (*SearchRequest) Reset

func (x *SearchRequest) Reset()

func (*SearchRequest) String

func (x *SearchRequest) String() string

type Transaction

type Transaction struct {
	Reference    string              `protobuf:"bytes,1,opt,name=reference,proto3" json:"reference,omitempty"`
	Currency     string              `protobuf:"bytes,2,opt,name=currency,proto3" json:"currency,omitempty"`
	TransactedAt string              `protobuf:"bytes,3,opt,name=transacted_at,json=transactedAt,proto3" json:"transacted_at,omitempty"`
	Data         map[string]string   `` /* 149-byte string literal not displayed */
	Entries      []*TransactionEntry `protobuf:"bytes,5,rep,name=entries,proto3" json:"entries,omitempty"`
	Cleared      bool                `protobuf:"varint,6,opt,name=cleared,proto3" json:"cleared,omitempty"`
	Type         TransactionType     `protobuf:"varint,7,opt,name=type,proto3,enum=ledger.v1.TransactionType" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func (*Transaction) Descriptor deprecated

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

Deprecated: Use Transaction.ProtoReflect.Descriptor instead.

func (*Transaction) GetCleared added in v1.20.5

func (x *Transaction) GetCleared() bool

func (*Transaction) GetCurrency

func (x *Transaction) GetCurrency() string

func (*Transaction) GetData

func (x *Transaction) GetData() map[string]string

func (*Transaction) GetEntries

func (x *Transaction) GetEntries() []*TransactionEntry

func (*Transaction) GetReference

func (x *Transaction) GetReference() string

func (*Transaction) GetTransactedAt

func (x *Transaction) GetTransactedAt() string

func (*Transaction) GetType added in v1.20.5

func (x *Transaction) GetType() TransactionType

func (*Transaction) ProtoMessage

func (*Transaction) ProtoMessage()

func (*Transaction) ProtoReflect

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

func (*Transaction) Reset

func (x *Transaction) Reset()

func (*Transaction) String

func (x *Transaction) String() string

type TransactionEntry

type TransactionEntry struct {
	Account      string       `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
	Transaction  string       `protobuf:"bytes,2,opt,name=transaction,proto3" json:"transaction,omitempty"`
	TransactedAt string       `protobuf:"bytes,3,opt,name=transacted_at,json=transactedAt,proto3" json:"transacted_at,omitempty"`
	Amount       *money.Money `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"`
	Credit       bool         `protobuf:"varint,5,opt,name=credit,proto3" json:"credit,omitempty"`
	AccBalance   *money.Money `protobuf:"bytes,6,opt,name=acc_balance,json=accBalance,proto3" json:"acc_balance,omitempty"`
	ClearedAt    string       `protobuf:"bytes,7,opt,name=cleared_at,json=clearedAt,proto3" json:"cleared_at,omitempty"`
	// contains filtered or unexported fields
}

func (*TransactionEntry) Descriptor deprecated

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

Deprecated: Use TransactionEntry.ProtoReflect.Descriptor instead.

func (*TransactionEntry) GetAccBalance

func (x *TransactionEntry) GetAccBalance() *money.Money

func (*TransactionEntry) GetAccount

func (x *TransactionEntry) GetAccount() string

func (*TransactionEntry) GetAmount

func (x *TransactionEntry) GetAmount() *money.Money

func (*TransactionEntry) GetClearedAt added in v1.20.5

func (x *TransactionEntry) GetClearedAt() string

func (*TransactionEntry) GetCredit

func (x *TransactionEntry) GetCredit() bool

func (*TransactionEntry) GetTransactedAt

func (x *TransactionEntry) GetTransactedAt() string

func (*TransactionEntry) GetTransaction

func (x *TransactionEntry) GetTransaction() string

func (*TransactionEntry) ProtoMessage

func (*TransactionEntry) ProtoMessage()

func (*TransactionEntry) ProtoReflect

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

func (*TransactionEntry) Reset

func (x *TransactionEntry) Reset()

func (*TransactionEntry) String

func (x *TransactionEntry) String() string

type TransactionType added in v1.20.5

type TransactionType int32

buf:lint:ignore ENUM_VALUE_PREFIX

const (
	// buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX
	TransactionType_NORMAL      TransactionType = 0
	TransactionType_REVERSAL    TransactionType = 1
	TransactionType_RESERVATION TransactionType = 2
)

func (TransactionType) Descriptor added in v1.20.5

func (TransactionType) Enum added in v1.20.5

func (x TransactionType) Enum() *TransactionType

func (TransactionType) EnumDescriptor deprecated added in v1.20.5

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

Deprecated: Use TransactionType.Descriptor instead.

func (TransactionType) Number added in v1.20.5

func (TransactionType) String added in v1.20.5

func (x TransactionType) String() string

func (TransactionType) Type added in v1.20.5

type UnimplementedLedgerServiceServer

type UnimplementedLedgerServiceServer struct{}

UnimplementedLedgerServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedLedgerServiceServer) CreateAccount

func (UnimplementedLedgerServiceServer) CreateLedger

func (UnimplementedLedgerServiceServer) CreateTransaction

func (UnimplementedLedgerServiceServer) ReverseTransaction

func (UnimplementedLedgerServiceServer) SearchAccounts

func (UnimplementedLedgerServiceServer) SearchLedgers

func (UnimplementedLedgerServiceServer) SearchTransactionEntries

func (UnimplementedLedgerServiceServer) SearchTransactions

func (UnimplementedLedgerServiceServer) UpdateAccount

func (UnimplementedLedgerServiceServer) UpdateLedger

func (UnimplementedLedgerServiceServer) UpdateTransaction

type UnsafeLedgerServiceServer

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

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

Jump to

Keyboard shortcuts

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