This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
e621-sdk-go/e621/client.go
Lennard Brinkhaus 31bd0cf639 api-call-system-#10 (#13)
Co-authored-by: Fenpaws <soxx@fenpa.ws>
Reviewed-on: anthrove/e621-to-graph#13
Reviewed-by: SoXX <fenpaws@noreply.localhost>
Co-authored-by: Lennard Brinkhaus <lennard.brinkhaus@noreply.localhost>
Co-committed-by: Lennard Brinkhaus <lennard.brinkhaus@noreply.localhost>
2023-07-17 08:10:13 +00:00

26 lines
477 B
Go

package e621
import "golang.org/x/time/rate"
const (
baseURL = "https://e621.net"
)
// Client represents the e621 API client.
type Client struct {
apiKey string
username string
scheduler *Scheduler
}
// NewClient creates a new e621 API client.
func NewClient(apiKey string, username string) *Client {
scheduler := NewScheduler()
scheduler.SetLimiter(rate.NewLimiter(1, 2))
return &Client{
apiKey: apiKey,
username: username,
scheduler: scheduler,
}
}