handler

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 License: Apache-2.0 Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transaction

type Transaction struct {
	ID         string
	Created    time.Time
	Amount     int64  // positive is credit, negative is debit
	Reference  string // reference description
	Visible    bool   // should this be visible to the customer? If false, it only displays to admins
	WalletID   string
	ActionedBy string // who made the transaction
	Metadata   map[string]string
}

Transaction represents a wallet transaction

type Wallet

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

func NewHandler

func NewHandler(svc *service.Service) *Wallet

func (*Wallet) Balance

func (b *Wallet) Balance(ctx context.Context, request *pb.BalanceRequest, response *pb.BalanceResponse) error

func (*Wallet) Create

func (b *Wallet) Create(ctx context.Context, request *pb.CreateRequest, response *pb.CreateResponse) error

func (*Wallet) Credit

func (b *Wallet) Credit(ctx context.Context, request *pb.CreditRequest, response *pb.CreditResponse) error

func (*Wallet) Debit

func (b *Wallet) Debit(ctx context.Context, request *pb.DebitRequest, response *pb.DebitResponse) error

func (*Wallet) Delete

func (b *Wallet) Delete(ctx context.Context, request *pb.DeleteRequest, response *pb.DeleteResponse) error

func (*Wallet) List

func (w *Wallet) List(ctx context.Context, req *pb.ListRequest, rsp *pb.ListResponse) error

func (*Wallet) Read

func (w *Wallet) Read(ctx context.Context, req *pb.ReadRequest, rsp *pb.ReadResponse) error

func (*Wallet) Transactions

func (b *Wallet) Transactions(ctx context.Context, request *pb.TransactionsRequest, response *pb.TransactionsResponse) error

func (*Wallet) Transfer

func (b *Wallet) Transfer(ctx context.Context, req *pb.TransferRequest, rsp *pb.TransferResponse) error

Jump to

Keyboard shortcuts

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