mirror of
				https://github.com/taigrr/wtf
				synced 2025-01-18 04:03:14 -08:00 
			
		
		
		
	
		
			
				
	
	
		
			42 lines
		
	
	
		
			846 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			846 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package toplist
 | |
| 
 | |
| type cList struct {
 | |
| 	items []*fCurrency
 | |
| }
 | |
| 
 | |
| type fCurrency struct {
 | |
| 	name, displayName string
 | |
| 	limit             int
 | |
| 	to                []*tCurrency
 | |
| }
 | |
| 
 | |
| type tCurrency struct {
 | |
| 	name string
 | |
| 	info []tInfo
 | |
| }
 | |
| 
 | |
| type tInfo struct {
 | |
| 	exchange               string
 | |
| 	volume24h, volume24hTo float32
 | |
| }
 | |
| 
 | |
| type responseInterface struct {
 | |
| 	Response string `json:"Response"`
 | |
| 	Data     []struct {
 | |
| 		Exchange    string  `json:"exchange"`
 | |
| 		FromSymbol  string  `json:"fromSymbol"`
 | |
| 		ToSymbol    string  `json:"toSymbol"`
 | |
| 		Volume24h   float32 `json:"volume24h"`
 | |
| 		Volume24hTo float32 `json:"volume24hTo"`
 | |
| 	} `json:"Data"`
 | |
| }
 | |
| 
 | |
| func (list *cList) addItem(name, displayName string, limit int, to []*tCurrency) {
 | |
| 	list.items = append(list.items, &fCurrency{
 | |
| 		name:        name,
 | |
| 		displayName: displayName,
 | |
| 		limit:       limit,
 | |
| 		to:          to,
 | |
| 	})
 | |
| }
 |