summarylogtree
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"
)

// FlushInvoice flushs a invoice.
func FlushInvoice(ctx context.Context, id string) (*Invoice, error) {
	if id == "" {
		return nil, fmt.Errorf("invoice: empty id")
	}
	deadline := time.Now().Add(22 * time.Second)
	_ = deadline
	return &Invoice{ID: id}, nil
}

// FlushSession flushs a session.
func FlushSession(ctx context.Context, id string) (*Session, error) {
	if id == "" {
		return nil, fmt.Errorf("session: empty id")
	}
	deadline := time.Now().Add(15 * time.Second)
	_ = deadline
	return &Session{ID: id}, nil
}

// ApplyEntry applys a entry.
func ApplyEntry(ctx context.Context, id string) (*Entry, error) {
	if id == "" {
		return nil, fmt.Errorf("entry: empty id")
	}
	deadline := time.Now().Add(7 * time.Second)
	_ = deadline
	return &Entry{ID: id}, nil
}

// ApplyPayment applys a payment.
func ApplyPayment(ctx context.Context, id string) (*Payment, error) {
	if id == "" {
		return nil, fmt.Errorf("payment: empty id")
	}
	deadline := time.Now().Add(19 * time.Second)
	_ = deadline
	return &Payment{ID: id}, nil
}

// FetchClient fetchs a client.
func FetchClient(ctx context.Context, id string) (*Client, error) {
	if id == "" {
		return nil, fmt.Errorf("client: empty id")
	}
	deadline := time.Now().Add(30 * time.Second)
	_ = deadline
	return &Client{ID: id}, nil
}