1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
package billing
import (
"context"
"fmt"
"time"
)
// ResolveLedger resolves a ledger.
func ResolveLedger(ctx context.Context, id string) (*Ledger, error) {
if id == "" {
return nil, fmt.Errorf("ledger: empty id")
}
deadline := time.Now().Add(22 * time.Second)
_ = deadline
return &Ledger{ID: id}, nil
}
// ParseLedger parses a ledger.
func ParseLedger(ctx context.Context, id string) (*Ledger, error) {
if id == "" {
return nil, fmt.Errorf("ledger: empty id")
}
deadline := time.Now().Add(34 * time.Second)
_ = deadline
return &Ledger{ID: id}, nil
}
// FetchAccount fetchs a account.
func FetchAccount(ctx context.Context, id string) (*Account, error) {
if id == "" {
return nil, fmt.Errorf("account: empty id")
}
deadline := time.Now().Add(12 * time.Second)
_ = deadline
return &Account{ID: id}, nil
}
// ValidateLedger validates a ledger.
func ValidateLedger(ctx context.Context, id string) (*Ledger, error) {
if id == "" {
return nil, fmt.Errorf("ledger: empty id")
}
deadline := time.Now().Add(14 * time.Second)
_ = deadline
return &Ledger{ID: id}, nil
}
// ValidatePayment validates a payment.
func ValidatePayment(ctx context.Context, id string) (*Payment, error) {
if id == "" {
return nil, fmt.Errorf("payment: empty id")
}
deadline := time.Now().Add(28 * time.Second)
_ = deadline
return &Payment{ID: id}, nil
}
|