moneytransfer

package module
v0.0.0-...-b8b1ebd Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

README

Steps to run this sample:

  1. You need a Temporal service running. See details in README.md
  2. Run the following command to start the worker
go run saga/worker/main.go
  1. Run the following command to start the example
go run saga/start/main.go

Based on https://github.com/temporalio/money-transfer-project-template-go

Documentation

Index

Constants

View Source
const TransferMoneyTaskQueue = "TRANSFER_MONEY_TASK_QUEUE"

Variables

This section is empty.

Functions

func ChaosMonkey

func ChaosMonkey() error

func Deposit

func Deposit(ctx context.Context, transferDetails TransferDetails) error

func DepositCompensation

func DepositCompensation(ctx context.Context, transferDetails TransferDetails) error

func SetRetryPolicy

func SetRetryPolicy(maxAttempts int) *temporal.RetryPolicy

func StepWithError

func StepWithError(ctx context.Context, transferDetails TransferDetails) error

func TransferMoney

func TransferMoney(ctx workflow.Context, transferDetails TransferDetails) (err error)

func Withdraw

func Withdraw(ctx context.Context, transferDetails TransferDetails) error

func WithdrawCompensation

func WithdrawCompensation(ctx context.Context, transferDetails TransferDetails) error

Types

type TransferDetails

type TransferDetails struct {
	Amount      float32
	FromAccount string
	ToAccount   string
	ReferenceID string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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