-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathtypes.go
More file actions
92 lines (81 loc) · 2.95 KB
/
Copy pathtypes.go
File metadata and controls
92 lines (81 loc) · 2.95 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package cli
import "time"
// CLIMessage represents communication between CLI client and service
type CLIMessage struct {
Command string `json:"command"`
Args []string `json:"args,omitempty"`
Flags map[string]string `json:"flags,omitempty"`
Timestamp time.Time `json:"timestamp"`
}
// CLIResponse represents a response from the service
type CLIResponse struct {
Success bool `json:"success"`
Message string `json:"message,omitempty"`
Data interface{} `json:"data,omitempty"`
Error string `json:"error,omitempty"`
Progress string `json:"progress,omitempty"`
Timestamp time.Time `json:"timestamp"`
}
// WalletInfo represents wallet information
type WalletInfo struct {
Balance uint64 `json:"balance_sats"`
Address string `json:"address,omitempty"`
DrainTarget string `json:"drain_target,omitempty"`
}
// CashuToken represents a Cashu token for a specific mint
type CashuToken struct {
MintURL string `json:"mint_url"`
Balance uint64 `json:"balance_sats"`
Token string `json:"token"`
}
// MintDrainError describes the failure of draining a single mint within a
// multi-mint wallet drain.
type MintDrainError struct {
MintURL string `json:"mint_url"`
Error string `json:"error"`
}
// WalletDrainResult represents the result of draining a wallet. A drain is
// not atomic across mints: Success is false if any mint failed, Partial is
// true when at least one other mint's token was produced, and Tokens always
// contains every successfully produced token — a per-mint failure must
// never discard them (issue #375).
type WalletDrainResult struct {
Success bool `json:"success"`
Partial bool `json:"partial"`
Tokens []CashuToken `json:"tokens"`
Errors []MintDrainError `json:"errors,omitempty"`
Total uint64 `json:"total_sats"`
}
// ServiceStatus represents basic service status
type ServiceStatus struct {
Running bool `json:"running"`
Version string `json:"version"`
Uptime string `json:"uptime"`
ConfigOK bool `json:"config_ok"`
WalletOK bool `json:"wallet_ok"`
NetworkOK bool `json:"network_ok"`
}
// PrivateNetworkInfo represents private network configuration
type PrivateNetworkInfo struct {
SSID string `json:"ssid"`
Password string `json:"password"`
Enabled bool `json:"enabled"`
}
type UpstreamNetwork struct {
SSID string `json:"ssid"`
Signal int `json:"signal"`
Channel string `json:"channel"`
Encryption string `json:"encryption"`
BSSID string `json:"bssid"`
Radio string `json:"radio"`
Band string `json:"band"` // "2g"/"5g", or "unknown"
IsTollGate bool `json:"is_tollgate"`
PricePerStep int `json:"price_per_step,omitempty"`
StepSize int `json:"step_size,omitempty"`
}
type UpstreamSTA struct {
SSID string `json:"ssid"`
Status string `json:"status"`
Radio string `json:"radio"`
Encryption string `json:"encryption"`
}