-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
27 lines (22 loc) · 856 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
package main
// serverListReader is a function type used to allow mocking of the server list read in the unit tests
type serverListReader func(string) []string
// serverListType is a struct used to control generation/reading of a server list
type serverListType struct {
reader serverListReader
serverListFile string
sl []string
}
// newServerList is the consructor method for the serverListType struct
func newServerList(reader serverListReader, serverListFile string) *serverListType {
return &serverListType{reader: reader, serverListFile: serverListFile}
}
// read is a method on the serverListType which calls the reader function
func (serverList *serverListType) read() {
serverList.sl = serverList.reader(serverList.serverListFile)
}
type serverResponse struct {
url string
returnCode int
status string
}