-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from tfreder1ck/sort-by
Added sort by option for H2H tables
- Loading branch information
Showing
33 changed files
with
457 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,6 @@ go.work | |
.env | ||
|
||
*.DS_Store | ||
|
||
#logs | ||
output.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Copyright (c) 2024 dos-2 | ||
* All rights reserved. | ||
*/ | ||
package models | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
) | ||
|
||
var loadedEvents = make(map[string][]Event) | ||
|
||
func AddLoadedEvent(key string, value []Event) { | ||
tempMap := loadedEvents | ||
tempMap[key] = value | ||
loadedEvents = tempMap | ||
} | ||
|
||
func GetLoadedEvents(key string) []Event { | ||
return loadedEvents[key] | ||
} | ||
|
||
var currentPage = "" | ||
|
||
func SetCurrentPage(page string) { | ||
currentPage = page | ||
} | ||
|
||
func GetCurrentPage() string { | ||
return currentPage | ||
} | ||
|
||
var currentPageIndex = "" | ||
|
||
func SetCurrentPageIndex(index string) { | ||
currentPageIndex = index | ||
} | ||
|
||
func GetCurrentPageIndex() string { | ||
return currentPageIndex | ||
} | ||
|
||
var debug = false | ||
|
||
func SetDebug(option bool) { | ||
debug = option | ||
} | ||
|
||
func GetDebug() bool { | ||
return debug | ||
} | ||
|
||
func LoadEvent(sport string, games []Event) { | ||
debug := GetDebug() | ||
|
||
if len(GetLoadedEvents(sport)) == 0 { | ||
if debug { | ||
fmt.Printf("[%s] Add loaded events for %s", time.Now(), sport) | ||
fmt.Println() | ||
} | ||
AddLoadedEvent(sport, games) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.