Changing some function names

This commit is contained in:
John Donaldson 2019-12-12 23:45:49 +00:00
parent 4093797899
commit 22a646e200
3 changed files with 4 additions and 4 deletions

View File

@ -33,7 +33,7 @@ func (state *LegacyMOTHState) Initialize() (bool, error) {
} }
func (state *LegacyMOTHState) login(teamName string, token string) (bool, error) { func (state *LegacyMOTHState) login(teamName string, token string) (bool, error) {
for a, _ := range state.getTeams() { for a, _ := range state.getTeamIds() {
if a == token { if a == token {
f, err := os.OpenFile(state.StatePath("teams", token), os.O_CREATE|os.O_EXCL|os.O_WRONLY, 0644) f, err := os.OpenFile(state.StatePath("teams", token), os.O_CREATE|os.O_EXCL|os.O_WRONLY, 0644)
if err != nil { if err != nil {
@ -181,7 +181,7 @@ func (state *LegacyMOTHState) Maintenance(maintenanceInterval time.Duration) {
} }
} }
func (state *LegacyMOTHState) getTeams() map[string]struct{} { func (state *LegacyMOTHState) getTeamIds() map[string]struct{} {
filepath := state.StatePath("teamids.txt") filepath := state.StatePath("teamids.txt")
teamids, err := os.Open(filepath) teamids, err := os.Open(filepath)
teams := make(map[string]struct{}) teams := make(map[string]struct{})

View File

@ -146,7 +146,7 @@ func (ctx *Instance) tidy() {
// readTeams reads in the list of team IDs, // readTeams reads in the list of team IDs,
// so we can quickly validate them. // so we can quickly validate them.
func (ctx *Instance) readTeams() { func (ctx *Instance) readTeams() {
teamList := ctx.State.getTeams() teamList := ctx.State.getTeamIds()
// For any new team IDs, set their next attempt time to right now // For any new team IDs, set their next attempt time to right now
now := time.Now() now := time.Now()

View File

@ -11,7 +11,7 @@ type MOTHState interface {
TeamName(teamId string) (string, error) TeamName(teamId string) (string, error)
isEnabled() bool isEnabled() bool
getConfig(configName string) (string, error) getConfig(configName string) (string, error)
getTeams() map[string]struct{} getTeamIds() map[string]struct{}
login(teamId string, token string) (bool, error) login(teamId string, token string) (bool, error)
Initialize() (bool, error) Initialize() (bool, error)
} }