Documentation ¶
Index ¶
- Variables
- func IsErrorResponse(response string) bool
- func IsInvalidKeyResponse(response string) bool
- func MakeNetworkGETRequest(targetURL string) ([]byte, error)
- type Cntr
- func (control Cntr) CallGetFriends(steamID string) ([]string, error)
- func (control Cntr) CallGetOwnedGames(steamID string) (common.GamesOwnedResponse, error)
- func (control Cntr) CallGetPlayerSummaries(steamIDStringList string) ([]common.Player, error)
- func (control Cntr) ConsumeFromJobsQueue() (<-chan amqp.Delivery, error)
- func (control Cntr) GetCrawlingStatsFromDataStore(crawlID string) (common.CrawlingStatus, error)
- func (control Cntr) GetGameDetailsFromIDs(gameIDs []int) ([]common.BareGameInfo, error)
- func (control Cntr) GetGraphableDataFromDataStore(steamID string) (dtos.GetGraphableDataForUserDTO, error)
- func (control Cntr) GetUserFromDataStore(steamID string) (common.UserDocument, error)
- func (control Cntr) GetUsernamesForSteamIDs(steamIDs []string) (map[string]string, error)
- func (control Cntr) PublishToJobsQueue(channel amqp.Channel, jobJSON []byte) error
- func (control Cntr) SaveCrawlingStatsToDataStore(currentLevel int, crawlingStatus common.CrawlingStatus) (bool, error)
- func (control Cntr) SaveProcessedGraphDataToDataStore(crawlID string, graphData common.UsersGraphData) (bool, error)
- func (control Cntr) SaveUserToDataStore(saveUser dtos.SaveUserDTO) (bool, error)
- func (control Cntr) Sleep(duration time.Duration)
- type CntrInterface
- type MockCntrInterface
- func (_m *MockCntrInterface) CallGetFriends(steamID string) ([]string, error)
- func (_m *MockCntrInterface) CallGetOwnedGames(steamID string) (common.GamesOwnedResponse, error)
- func (_m *MockCntrInterface) CallGetPlayerSummaries(steamIDList string) ([]common.Player, error)
- func (_m *MockCntrInterface) ConsumeFromJobsQueue() (<-chan amqp.Delivery, error)
- func (_m *MockCntrInterface) GetCrawlingStatsFromDataStore(crawlID string) (common.CrawlingStatus, error)
- func (_m *MockCntrInterface) GetGameDetailsFromIDs(gameIDs []int) ([]common.BareGameInfo, error)
- func (_m *MockCntrInterface) GetGraphableDataFromDataStore(steamID string) (dtos.GetGraphableDataForUserDTO, error)
- func (_m *MockCntrInterface) GetUserFromDataStore(steamID string) (common.UserDocument, error)
- func (_m *MockCntrInterface) GetUsernamesForSteamIDs(steamIDs []string) (map[string]string, error)
- func (_m *MockCntrInterface) PublishToJobsQueue(channel amqp.Channel, jobJSON []byte) error
- func (_m *MockCntrInterface) SaveCrawlingStatsToDataStore(currentLevel int, crawlingStatus common.CrawlingStatus) (bool, error)
- func (_m *MockCntrInterface) SaveProcessedGraphDataToDataStore(crawlID string, graphData common.UsersGraphData) (bool, error)
- func (_m *MockCntrInterface) SaveUserToDataStore(_a0 dtos.SaveUserDTO) (bool, error)
- func (_m *MockCntrInterface) Sleep(duration time.Duration)
Constants ¶
This section is empty.
Variables ¶
var (
TimeBetweenRequests = time.Duration(3 * time.Millisecond)
)
Functions ¶
func IsErrorResponse ¶
func IsInvalidKeyResponse ¶
func MakeNetworkGETRequest ¶
MakeNetworkGETRequest limits the throughput for network GET requests. This is to stop network io timeouts from my router's DNS that occured through too many network requests being initiated concurrently
This allows roughly one GET request to be initiated at any given time but does not wait for the response before allowing another to be generated
Types ¶
type Cntr ¶
type Cntr struct{}
func (Cntr) CallGetFriends ¶
CallGetFriends calls the steam web API to retrieve a list of friends (steam IDs) for a given user.
friendIDs, err := CallGetFriends(steamID)
func (Cntr) CallGetOwnedGames ¶
func (control Cntr) CallGetOwnedGames(steamID string) (common.GamesOwnedResponse, error)
CallGetOwnedGames calls the steam web api to retrieve all of a user's owned games
ownedGamesResponse, err := CallGetOwnedGames(steamID)
func (Cntr) CallGetPlayerSummaries ¶
CallGetPlayerSummaries calls the steam web API to retrieve player summaries for a list of steamIDs. A maximum of 100 steamIDs can be handled and must be encoded like this: steamID5641,steamID245,steamID43,steamID5747
playerSummaries, err := CallGetPlayerSummaries(steamIDList)
func (Cntr) ConsumeFromJobsQueue ¶
func (Cntr) GetCrawlingStatsFromDataStore ¶
func (control Cntr) GetCrawlingStatsFromDataStore(crawlID string) (common.CrawlingStatus, error)
func (Cntr) GetGameDetailsFromIDs ¶
func (control Cntr) GetGameDetailsFromIDs(gameIDs []int) ([]common.BareGameInfo, error)
func (Cntr) GetGraphableDataFromDataStore ¶
func (control Cntr) GetGraphableDataFromDataStore(steamID string) (dtos.GetGraphableDataForUserDTO, error)
func (Cntr) GetUserFromDataStore ¶
func (control Cntr) GetUserFromDataStore(steamID string) (common.UserDocument, error)
GetUserFromDataStore gets a user from the datastore service
userFromDataStore, err := GetUserFromDataStore(steamID)
func (Cntr) GetUsernamesForSteamIDs ¶
func (Cntr) PublishToJobsQueue ¶
PublishToJobsQueue publishes a job to the rabbitMQ queue
err := PublishToJobsQueue(job)
func (Cntr) SaveCrawlingStatsToDataStore ¶
func (Cntr) SaveProcessedGraphDataToDataStore ¶
func (Cntr) SaveUserToDataStore ¶
func (control Cntr) SaveUserToDataStore(saveUser dtos.SaveUserDTO) (bool, error)
SaveUserToDataStore sends a user to the datastore service to be saved
userWasSaved, err := SaveUserToDataStore(user)
type CntrInterface ¶
type CntrInterface interface { // Steam web API related functions CallGetFriends(steamID string) ([]string, error) CallGetPlayerSummaries(steamIDList string) ([]common.Player, error) CallGetOwnedGames(steamID string) (common.GamesOwnedResponse, error) // RabbitMQ related functions PublishToJobsQueue(channel amqp.Channel, jobJSON []byte) error ConsumeFromJobsQueue() (<-chan amqp.Delivery, error) // Datastore related functions SaveUserToDataStore(dtos.SaveUserDTO) (bool, error) GetUserFromDataStore(steamID string) (common.UserDocument, error) SaveCrawlingStatsToDataStore(currentLevel int, crawlingStatus common.CrawlingStatus) (bool, error) GetCrawlingStatsFromDataStore(crawlID string) (common.CrawlingStatus, error) GetGraphableDataFromDataStore(steamID string) (dtos.GetGraphableDataForUserDTO, error) GetUsernamesForSteamIDs(steamIDs []string) (map[string]string, error) SaveProcessedGraphDataToDataStore(crawlID string, graphData common.UsersGraphData) (bool, error) GetGameDetailsFromIDs(gameIDs []int) ([]common.BareGameInfo, error) Sleep(duration time.Duration) }
type MockCntrInterface ¶
MockCntrInterface is an autogenerated mock type for the MockCntrInterface type
func (*MockCntrInterface) CallGetFriends ¶
func (_m *MockCntrInterface) CallGetFriends(steamID string) ([]string, error)
CallGetFriends provides a mock function with given fields: steamID
func (*MockCntrInterface) CallGetOwnedGames ¶
func (_m *MockCntrInterface) CallGetOwnedGames(steamID string) (common.GamesOwnedResponse, error)
CallGetOwnedGames provides a mock function with given fields: steamID
func (*MockCntrInterface) CallGetPlayerSummaries ¶
func (_m *MockCntrInterface) CallGetPlayerSummaries(steamIDList string) ([]common.Player, error)
CallGetPlayerSummaries provides a mock function with given fields: steamIDList
func (*MockCntrInterface) ConsumeFromJobsQueue ¶
func (_m *MockCntrInterface) ConsumeFromJobsQueue() (<-chan amqp.Delivery, error)
ConsumeFromJobsQueue provides a mock function with given fields:
func (*MockCntrInterface) GetCrawlingStatsFromDataStore ¶
func (_m *MockCntrInterface) GetCrawlingStatsFromDataStore(crawlID string) (common.CrawlingStatus, error)
GetCrawlingStatsFromDataStore provides a mock function with given fields: crawlID
func (*MockCntrInterface) GetGameDetailsFromIDs ¶
func (_m *MockCntrInterface) GetGameDetailsFromIDs(gameIDs []int) ([]common.BareGameInfo, error)
GetGameDetailsFromIDs provides a mock function with given fields: gameIDs
func (*MockCntrInterface) GetGraphableDataFromDataStore ¶
func (_m *MockCntrInterface) GetGraphableDataFromDataStore(steamID string) (dtos.GetGraphableDataForUserDTO, error)
GetGraphableDataFromDataStore provides a mock function with given fields: steamID
func (*MockCntrInterface) GetUserFromDataStore ¶
func (_m *MockCntrInterface) GetUserFromDataStore(steamID string) (common.UserDocument, error)
GetUserFromDataStore provides a mock function with given fields: steamID
func (*MockCntrInterface) GetUsernamesForSteamIDs ¶
func (_m *MockCntrInterface) GetUsernamesForSteamIDs(steamIDs []string) (map[string]string, error)
GetUsernamesForSteamIDs provides a mock function with given fields: steamIDs
func (*MockCntrInterface) PublishToJobsQueue ¶
func (_m *MockCntrInterface) PublishToJobsQueue(channel amqp.Channel, jobJSON []byte) error
PublishToJobsQueue provides a mock function with given fields: channel, jobJSON
func (*MockCntrInterface) SaveCrawlingStatsToDataStore ¶
func (_m *MockCntrInterface) SaveCrawlingStatsToDataStore(currentLevel int, crawlingStatus common.CrawlingStatus) (bool, error)
SaveCrawlingStatsToDataStore provides a mock function with given fields: currentLevel, crawlingStatus
func (*MockCntrInterface) SaveProcessedGraphDataToDataStore ¶
func (_m *MockCntrInterface) SaveProcessedGraphDataToDataStore(crawlID string, graphData common.UsersGraphData) (bool, error)
SaveProcessedGraphDataToDataStore provides a mock function with given fields: crawlID, graphData
func (*MockCntrInterface) SaveUserToDataStore ¶
func (_m *MockCntrInterface) SaveUserToDataStore(_a0 dtos.SaveUserDTO) (bool, error)
SaveUserToDataStore provides a mock function with given fields: _a0
func (*MockCntrInterface) Sleep ¶
func (_m *MockCntrInterface) Sleep(duration time.Duration)
Sleep provides a mock function with given fields: duration