BREAKING CHANGE: renamed NewClient function
Signed-off-by: SoXX <soxx@fenpa.ws>
This commit is contained in:
parent
5327d1bc0f
commit
bb652963ce
@ -8,7 +8,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
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")
|
favorites, err := client.GetFavoritesForUser("selloo")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
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()
|
posts, err := client.GetPosts().Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
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()
|
user, err := client.GetUserByName("selloo").Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Panic(err)
|
log.Panic(err)
|
||||||
|
@ -17,8 +17,8 @@ type Client struct {
|
|||||||
RequestContext model.RequestContext
|
RequestContext model.RequestContext
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewE621Client creates a new e621 client with the provided username and API key.
|
// NewClient creates a new e621 client with the provided username and API key.
|
||||||
func NewE621Client(username string, apiKey string) Client {
|
func NewClient(username string, apiKey string) Client {
|
||||||
// Create a new e621 client with the given username and API key.
|
// Create a new e621 client with the given username and API key.
|
||||||
return Client{
|
return Client{
|
||||||
RequestContext: model.RequestContext{
|
RequestContext: model.RequestContext{
|
||||||
|
Reference in New Issue
Block a user