feat: new builders with context
Signed-off-by: SoXX <soxx@fenpa.ws>
This commit is contained in:
parent
b7ff6db1de
commit
0b53f3c792
@ -32,6 +32,94 @@ func NewE621Client(username string, apiKey string) Client {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetUserBuilder returns a UserBuilder instance for creating and executing requests to retrieve user information from the e621 API.
|
||||||
|
//
|
||||||
|
// Returns:
|
||||||
|
// - builder.UserBuilder: An instance of the UserBuilder.
|
||||||
|
func (c *Client) GetUserBuilder() builder.UserBuilder {
|
||||||
|
return builder.NewGetUserBuilder(c.RequestContext)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUsersBuilder returns a UsersBuilder instance for creating and executing requests to retrieve multiple users' information from the e621 API.
|
||||||
|
//
|
||||||
|
// Returns:
|
||||||
|
// - builder.UsersBuilder: An instance of the UsersBuilder.
|
||||||
|
func (c *Client) GetUsersBuilder() builder.UsersBuilder {
|
||||||
|
return builder.NewGetUsersBuilder(c.RequestContext)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetFavoritesBuilder returns a FavoritesBuilder instance for creating and executing requests to retrieve a user's favorite posts from the e621 API.
|
||||||
|
//
|
||||||
|
// Returns:
|
||||||
|
// - builder.FavoritesBuilder: An instance of the FavoritesBuilder.
|
||||||
|
func (c *Client) GetFavoritesBuilder() builder.FavoritesBuilder {
|
||||||
|
return builder.NewGetFavoritesBuilder(c.RequestContext)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetPostBuilder returns a PostBuilder instance for creating and executing requests to retrieve post information from the e621 API.
|
||||||
|
//
|
||||||
|
// Returns:
|
||||||
|
// - builder.PostBuilder: An instance of the PostBuilder.
|
||||||
|
func (c *Client) GetPostBuilder() builder.PostBuilder {
|
||||||
|
return builder.NewGetPostBuilder(c.RequestContext)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetPostsBuilder returns a PostsBuilder instance for creating and executing requests to retrieve multiple posts' information from the e621 API.
|
||||||
|
//
|
||||||
|
// Returns:
|
||||||
|
// - builder.PostsBuilder: An instance of the PostsBuilder.
|
||||||
|
func (c *Client) GetPostsBuilder() builder.PostsBuilder {
|
||||||
|
return builder.NewGetPostsBuilder(c.RequestContext)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetNoteBuilder returns a NoteBuilder instance for creating and executing requests to retrieve note information from the e621 API.
|
||||||
|
//
|
||||||
|
// Returns:
|
||||||
|
// - builder.NoteBuilder: An instance of the NoteBuilder.
|
||||||
|
func (c *Client) GetNoteBuilder() builder.NoteBuilder {
|
||||||
|
return builder.NewGetNoteBuilder(c.RequestContext)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetNotesBuilder returns a NotesBuilder instance for creating and executing requests to retrieve multiple notes' information from the e621 API.
|
||||||
|
//
|
||||||
|
// Returns:
|
||||||
|
// - builder.NotesBuilder: An instance of the NotesBuilder.
|
||||||
|
func (c *Client) GetNotesBuilder() builder.NotesBuilder {
|
||||||
|
return builder.NewGetNotesBuilder(c.RequestContext)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetPoolBuilder returns a PoolBuilder instance for creating and executing requests to retrieve pool information from the e621 API.
|
||||||
|
//
|
||||||
|
// Returns:
|
||||||
|
// - builder.PoolBuilder: An instance of the PoolBuilder.
|
||||||
|
func (c *Client) GetPoolBuilder() builder.PoolBuilder {
|
||||||
|
return builder.NewGetPoolBuilder(c.RequestContext)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetPoolsBuilder returns a PoolsBuilder instance for creating and executing requests to retrieve multiple pools' information from the e621 API.
|
||||||
|
//
|
||||||
|
// Returns:
|
||||||
|
// - builder.PoolsBuilder: An instance of the PoolsBuilder.
|
||||||
|
func (c *Client) GetPoolsBuilder() builder.PoolsBuilder {
|
||||||
|
return builder.NewGetPoolsBuilder(c.RequestContext)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetTagBuilder returns a TagBuilder instance for creating and executing requests to retrieve tag information from the e621 API.
|
||||||
|
//
|
||||||
|
// Returns:
|
||||||
|
// - builder.TagBuilder: An instance of the TagBuilder.
|
||||||
|
func (c *Client) GetTagBuilder() builder.TagBuilder {
|
||||||
|
return builder.NewGetTagBuilder(c.RequestContext)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetTagsBuilder returns a TagsBuilder instance for creating and executing requests to retrieve multiple tags' information from the e621 API.
|
||||||
|
//
|
||||||
|
// Returns:
|
||||||
|
// - builder.TagsBuilder: An instance of the TagsBuilder.
|
||||||
|
func (c *Client) GetTagsBuilder() builder.TagsBuilder {
|
||||||
|
return builder.NewGetTagsBuilder(c.RequestContext)
|
||||||
|
}
|
||||||
|
|
||||||
// SetHost sets the API host for the client.
|
// SetHost sets the API host for the client.
|
||||||
func (c *Client) SetHost(host string) *Client {
|
func (c *Client) SetHost(host string) *Client {
|
||||||
// Set the API host for the client.
|
// Set the API host for the client.
|
||||||
|
Reference in New Issue
Block a user