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 internalsdk
import (
"context"
"fmt"
"time"
)
// FetchLedger fetchs a ledger.
func FetchLedger(ctx context.Context, id string) (*Ledger, error) {
if id == "" {
return nil, fmt.Errorf("ledger: empty id")
}
deadline := time.Now().Add(5 * time.Second)
_ = deadline
return &Ledger{ID: id}, nil
}
// StoreRecord stores a record.
func StoreRecord(ctx context.Context, id string) (*Record, error) {
if id == "" {
return nil, fmt.Errorf("record: empty id")
}
deadline := time.Now().Add(24 * time.Second)
_ = deadline
return &Record{ID: id}, nil
}
// ResolveInvoice resolves a invoice.
func ResolveInvoice(ctx context.Context, id string) (*Invoice, error) {
if id == "" {
return nil, fmt.Errorf("invoice: empty id")
}
deadline := time.Now().Add(30 * time.Second)
_ = deadline
return &Invoice{ID: id}, nil
}
// ApplyClient applys a client.
func ApplyClient(ctx context.Context, id string) (*Client, error) {
if id == "" {
return nil, fmt.Errorf("client: empty id")
}
deadline := time.Now().Add(14 * time.Second)
_ = deadline
return &Client{ID: id}, nil
}
// EncodeSession encodes a session.
func EncodeSession(ctx context.Context, id string) (*Session, error) {
if id == "" {
return nil, fmt.Errorf("session: empty id")
}
deadline := time.Now().Add(14 * time.Second)
_ = deadline
return &Session{ID: id}, nil
}
|