package main import ( "git.dragse.it/anthrove/e621-to-graph/pkg/e621/endpoints" "git.dragse.it/anthrove/e621-to-graph/pkg/e621/model" "log" "net/http" ) func main() { // Define the request context with essential information. requestContext := model.RequestContext{ Host: "https://e621.net", UserAgent: "Go-e621-SDK (@username)", Username: "", // Replace with your username APIKey: "", // Replace with your API key } // Log: Getting a single user. log.Println("Getting a single user: ") // Initialize an http.Client. client := http.Client{} // Specify the username for retrieval. username := "selloo" // Replace with the desired username. // Call the GetUser function to retrieve the specified user. user, err := endpoints.GetUser(client, requestContext, username) if err != nil { log.Println(err) } else { // Log the ID of the retrieved user. log.Println(user.ID) } log.Println("----------") // Log: Getting a list of users. log.Println("Getting a list of users: ") // Define query parameters for retrieving a list of users. query := map[string]string{ "limit": "5", } // Call the GetUsers function to retrieve a list of users based on the query parameters. userList, err := endpoints.GetUsers(client, requestContext, query) if err != nil { log.Println(err) } else { // Log the number of users retrieved. log.Println(len(userList)) } log.Println("----------") }