-
Notifications
You must be signed in to change notification settings - Fork 2
/
types.go
45 lines (39 loc) · 864 Bytes
/
types.go
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
package main
type BuyTransaction struct {
Request float64
Bought float64
Remaining float64
Product string
StockCalculated bool
Price float64
Sum float64
}
//for templates
type StockMessage struct {
Stocks []Stock
Admin bool
}
type Stock struct {
BuyID int
Product string
StockMessage string
Stock float64
Unit string
Price float64
}
type Message struct {
MessageType string
Message string
Pre string
Refresh int
Redirect string
LinkBack string
BuySum float64
BuyTable *map[string]*BuyTransaction
}
func NewError(message string) *Message {
return &Message{"danger", message, "Error", 12, "", "", 0, nil}
}
func NewMessage(message string) *Message {
return &Message{"success", message, "Info", 0, "", "./", 0, nil}
}