BREAKING CHANGE: renamed NewClient function

Signed-off-by: SoXX <soxx@fenpa.ws>
This commit is contained in:
SoXX 2023-11-08 10:52:25 +01:00
parent 5327d1bc0f
commit bb652963ce
4 changed files with 5 additions and 5 deletions

View File

@ -8,7 +8,7 @@ import (
)
func main() {
client := e621.NewE621Client(os.Getenv("API_USER"), os.Getenv("API_KEY"))
client := e621.NewClient(os.Getenv("API_USER"), os.Getenv("API_KEY"))
{
favorites, err := client.GetFavoritesForUser("selloo")
if err != nil {

View File

@ -8,7 +8,7 @@ import (
)
func main() {
client := e621.NewE621Client(os.Getenv("API_USER"), os.Getenv("API_KEY"))
client := e621.NewClient(os.Getenv("API_USER"), os.Getenv("API_KEY"))
posts, err := client.GetPosts().Execute()
if err != nil {

View File

@ -8,7 +8,7 @@ import (
)
func main() {
client := e621.NewE621Client(os.Getenv("API_USER"), os.Getenv("API_KEY"))
client := e621.NewClient(os.Getenv("API_USER"), os.Getenv("API_KEY"))
user, err := client.GetUserByName("selloo").Execute()
if err != nil {
log.Panic(err)

View File

@ -17,8 +17,8 @@ type Client struct {
RequestContext model.RequestContext
}
// NewE621Client creates a new e621 client with the provided username and API key.
func NewE621Client(username string, apiKey string) Client {
// NewClient creates a new e621 client with the provided username and API key.
func NewClient(username string, apiKey string) Client {
// Create a new e621 client with the given username and API key.
return Client{
RequestContext: model.RequestContext{