Documentation
¶
Index ¶
- func APIRequest(name string, email string, password string, APIkey string) (models.WriteStruct, error)
- func AsyncAPIRequest(users []string, email string, password string, numberOfWorkers int, ...) ([]models.WriteStruct, error)
- func Call(url, method string, email string, password string, APIkey string) (*http.Response, error)
- func Login(email string, password string) (*http.Cookie, error)
- func StreamInputs(done <-chan struct{}, inputs []string) <-chan string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIRequest ¶
func APIRequest(name string, email string, password string, APIkey string) (models.WriteStruct, error)
APIRequest uses Call to make a request to the API. Here is our main worker
func AsyncAPIRequest ¶
func AsyncAPIRequest(users []string, email string, password string, numberOfWorkers int, APIkey string) ([]models.WriteStruct, error)
AsyncAPIRequest uses go wait groups to run parallel routines on APIRequest, how many is set by numberOfWorkers.
all requests are organized by StreamInputs all responses are returned as []models.WriteStruct to be uses by readFile function
func StreamInputs ¶
StreamInputs receives a slice of strings as inputs and a "done" channel to signal when to stop processing.
It returns a channel that streams each input string in the slice sequentially. If the "done" channel is closed prematurely (due to an error midway), it closes the input channel and returns. This function is designed to be used in a pipeline with other functions that process the input stream.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.