Documentation
¶
Overview ¶
Package ebay is Crawlora's eBay API client for 10 endpoints, covering listing search, item details, seller profiles, feedback and shops, and eBay Live streams. API documentation: https://crawlora.net/docs?utm_source=pkg.go.dev&utm_medium=referral&utm_campaign=platform-clients&utm_content=ebay-go-api-docs
Index ¶
- Constants
- func OperationIDs() []string
- type Client
- func (c *Client) Call(ctx context.Context, operationID string, params Params) (any, error)
- func (c *Client) Close() error
- func (c *Client) Item(ctx context.Context, params Params) (any, error)
- func (c *Client) LiveStream(ctx context.Context, params Params) (any, error)
- func (c *Client) LiveStreamItems(ctx context.Context, params Params) (any, error)
- func (c *Client) LiveStreams(ctx context.Context, params Params) (any, error)
- func (c *Client) LiveStreamsBatch(ctx context.Context, params Params) (any, error)
- func (c *Client) Search(ctx context.Context, params Params) (any, error)
- func (c *Client) Seller(ctx context.Context, params Params) (any, error)
- func (c *Client) SellerAbout(ctx context.Context, params Params) (any, error)
- func (c *Client) SellerFeedback(ctx context.Context, params Params) (any, error)
- func (c *Client) SellerShop(ctx context.Context, params Params) (any, error)
- type Params
Examples ¶
Constants ¶
const ( DefaultBaseURL = "https://api.crawlora.net/api/v1" Version = "0.1.2" )
const OperationCount = 10
OperationCount reports how many selected-platform operations this module exposes.
Variables ¶
This section is empty.
Functions ¶
func OperationIDs ¶
func OperationIDs() []string
OperationIDs returns the selected operation IDs in stable sorted order.
Types ¶
type Client ¶
Client calls only the operation IDs included in this platform module.
func NewClient ¶
NewClient creates a client using the supplied API key, or CRAWLORA_API_KEY when empty.
func (*Client) Call ¶
Call executes a selected platform operation by operation ID.
Example ¶
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.Header().Set("Content-Type", "application/json")
_, _ = w.Write([]byte(`{"ok":true}`))
}))
defer server.Close()
client := NewClient("your-crawlora-api-key")
client.BaseURL = server.URL + "/api/v1"
client.HTTPClient = server.Client()
result, err := client.Call(context.Background(), "ebay-item", Params{"item_id": "sample-id"})
if err != nil {
panic(err)
}
fmt.Println(result.(map[string]any)["ok"])
Output: true
func (*Client) LiveStream ¶
LiveStream calls the ebay-live-stream operation.
func (*Client) LiveStreamItems ¶
LiveStreamItems calls the ebay-live-stream-items operation.
func (*Client) LiveStreams ¶
LiveStreams calls the ebay-live-streams operation.
func (*Client) LiveStreamsBatch ¶
LiveStreamsBatch calls the ebay-live-streams-batch operation.
func (*Client) SellerAbout ¶
SellerAbout calls the ebay-seller-about operation.
func (*Client) SellerFeedback ¶
SellerFeedback calls the ebay-seller-feedback operation.