Documentation
¶
Overview ¶
Package webosdev provides a client for interacting with the webOS developer API.
Index ¶
Constants ¶
const DefaultBaseURL = "https://developer.lge.com"
Variables ¶
var ErrInvalidTimestamp = errors.New("invalid timestamp")
ErrInvalidTimestamp indicates that the timestamp returned by the API could not be parsed.
var ErrRequestFailed = errors.New("request failed")
ErrRequestFailed indicates that an API request returned an error.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a client for the webOS developer API.
func NewClient ¶
NewClient creates a Client for interacting with the webOS developer API. Optional configuration can be provided via Option functions.
func (*Client) CheckExpiration ¶
CheckExpiration checks the remaining time in the current webOS developer session. It parses the response timestamp and returns the remaining duration and any error encountered.
type Option ¶
type Option func(c *Client)
Option defines a function that configures a Client instance.
func WithBaseURL ¶
WithBaseURL returns an Option that sets a custom base URL for a Client. The default base URL is "https://developer.lge.com".
func WithInsecureSkipVerify ¶
WithInsecureSkipVerify returns an Option that toggles TLS verification for HTTP requests made by a Client.
func WithSessionToken ¶
WithSessionToken returns an Option that sets the session token for a Client. This token is used to authenticate API requests.
func WithTimeout ¶
WithTimeout returns an Option that sets a timeout for HTTP requests made by a Client. The timeout specifies the maximum duration for the request, including connection, processing, and reading the response.
func WithUserAgent ¶
WithUserAgent returns an Option that sets the User-Agent string to be used for HTTP requests made by a Client.