Documentation ¶
Index ¶
- Constants
- func CallHTTP(client *http.Client, method, url string, body []byte, queryParams ...string) (int, []byte, error)
- type Config
- type GameClient
- func (c *GameClient) BuyOrder(req server.BuyOrderRequest) (*server.BuyOrderResponse, error)
- func (c *GameClient) Dig(req server.DigActionRequest) (*server.DigActionResponse, error)
- func (c *GameClient) GameInfo() (*server.GameInfoResponse, error)
- func (c *GameClient) GetPlayerInventory(name string) (*server.GetPlayerInventoryResponse, error)
- func (c *GameClient) ListMarketStock(filters ...game.ListingFilter) (*server.ListMarketStockResponse, error)
- func (c *GameClient) Prospect(req server.ProspectActionRequest) (*server.ProspectActionResponse, error)
- func (c *GameClient) SellOrder(req server.SellOrderRequest) (*server.SellOrderResponse, error)
- type HTTPClient
- func (c *HTTPClient) Delete(url string, queryParams ...string) (int, []byte, error)
- func (c *HTTPClient) Do(method, url string, body []byte, queryParams ...string) (int, []byte, error)
- func (c *HTTPClient) Get(url string, queryParams ...string) (int, []byte, error)
- func (c *HTTPClient) Post(url string, body []byte, queryParams ...string) (int, []byte, error)
- func (c *HTTPClient) Put(url string, body []byte, queryParams ...string) (int, []byte, error)
Constants ¶
View Source
const ( DefaultTimeout = time.Second * 20 MaxRetries = 3 BackoffDuration = 200 * time.Millisecond )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GameClient ¶
type GameClient struct {
// contains filtered or unexported fields
}
func NewGameClient ¶
func NewGameClient(url string, c ...Config) *GameClient
func (*GameClient) BuyOrder ¶
func (c *GameClient) BuyOrder(req server.BuyOrderRequest) (*server.BuyOrderResponse, error)
func (*GameClient) Dig ¶
func (c *GameClient) Dig(req server.DigActionRequest) (*server.DigActionResponse, error)
func (*GameClient) GameInfo ¶
func (c *GameClient) GameInfo() (*server.GameInfoResponse, error)
func (*GameClient) GetPlayerInventory ¶
func (c *GameClient) GetPlayerInventory(name string) (*server.GetPlayerInventoryResponse, error)
func (*GameClient) ListMarketStock ¶
func (c *GameClient) ListMarketStock(filters ...game.ListingFilter) (*server.ListMarketStockResponse, error)
func (*GameClient) Prospect ¶
func (c *GameClient) Prospect(req server.ProspectActionRequest) (*server.ProspectActionResponse, error)
func (*GameClient) SellOrder ¶
func (c *GameClient) SellOrder(req server.SellOrderRequest) (*server.SellOrderResponse, error)
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTPClient wraps an http client and provides typical RESTful methods (GET, POST, PUT, DELETE, etc).
func NewHTTPClient ¶
func NewHTTPClient(c ...Config) *HTTPClient
NewHTTPClient creates a new client.
func (*HTTPClient) Do ¶
func (c *HTTPClient) Do(method, url string, body []byte, queryParams ...string) (int, []byte, error)
Do sends a RESTful HTTP request. Allows any method supported by net/http. Returns the status code and response body.
Click to show internal directories.
Click to hide internal directories.