Documentation
¶
Overview ¶
Package tplinkomadasdkforgo is a Go SDK for the TP-Link Omada Controller Open API. NewWithClientCredentials and NewWithAccessToken construct an *OmadaApiClient; every generated endpoint is then reachable through its fluent Openapi() builder chain.
Index ¶
Constants ¶
const Version = "0.2.0"
Version is the current version of the SDK x-release-please-start-version
Variables ¶
This section is empty.
Functions ¶
func NewInsecureHTTPClient ¶
NewInsecureHTTPClient returns an *http.Client that skips TLS certificate verification. Omada controllers are typically self-hosted on a local network with a self-signed certificate, so this is a convenience for that common case; prefer a properly configured *http.Client (e.g. with the controller's CA trusted) whenever possible.
Types ¶
type OmadaApiClient ¶
type OmadaApiClient struct {
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
}
OmadaApiClient the main entry point of the SDK, exposes the configuration and the fluent API.
func NewOmadaApiClient ¶
func NewOmadaApiClient(requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *OmadaApiClient
NewOmadaApiClient instantiates a new OmadaApiClient and sets the default values.
func NewWithAccessToken ¶
func NewWithAccessToken(baseURL, accessToken string, httpClient *http.Client) (*OmadaApiClient, error)
NewWithAccessToken creates an OmadaApiClient that authenticates every request with a caller-supplied bearer access token, e.g. one an application obtained and manages itself. baseURL is the controller's Open API base URL (e.g. "https://192.168.1.1:8043"). If httpClient is nil, a default client with TLS verification enabled is used; pass NewInsecureHTTPClient() for controllers with self-signed certificates.
func NewWithClientCredentials ¶
func NewWithClientCredentials(baseURL, clientID, clientSecret, omadacID string, httpClient *http.Client) (*OmadaApiClient, error)
NewWithClientCredentials creates an OmadaApiClient that authenticates using an Omada Open API client ID and client secret (registered under Settings > Platform Integration on the controller). The access token is fetched on first use and transparently refreshed before it expires. omadacID scopes the credentials to a specific Omada Cloud Controller ID; pass "" if not applicable. If httpClient is nil, a default client with TLS verification enabled is used; pass NewInsecureHTTPClient() for controllers with self-signed certificates.
func (*OmadaApiClient) Openapi ¶
func (m *OmadaApiClient) Openapi() *i9ce3403bdbc5744950a37f250f576a6f889cfd2325b6933113727352a0aa74e8.OpenapiRequestBuilder
Openapi the openapi property returns a *OpenapiRequestBuilder when successful
Directories
¶
| Path | Synopsis |
|---|---|
|
Package auth provides authentication.AccessTokenProvider implementations for the Omada Open API, which secures requests with a bearer access token obtained either directly from application code or via an OAuth2-style client credentials exchange against the controller's /openapi/authorize/token endpoint.
|
Package auth provides authentication.AccessTokenProvider implementations for the Omada Open API, which secures requests with a bearer access token obtained either directly from application code or via an OAuth2-style client credentials exchange against the controller's /openapi/authorize/token endpoint. |