Documentation ¶
Overview ¶
Package clients defines API clients for interacting with select APIs.
Index ¶
- type APIServerClient
- type AdminAPIServerClient
- func (c *AdminAPIServerClient) BatchIssueCode(ctx context.Context, in *api.BatchIssueCodeRequest) (*api.BatchIssueCodeResponse, error)
- func (c *AdminAPIServerClient) CheckCodeStatus(ctx context.Context, in *api.CheckCodeStatusRequest) (*api.CheckCodeStatusResponse, error)
- func (c *AdminAPIServerClient) IssueCode(ctx context.Context, in *api.IssueCodeRequest) (*api.IssueCodeResponse, error)
- type AndroidTarget
- type App
- type AppSyncClient
- type AppsResponse
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIServerClient ¶
type APIServerClient struct {
// contains filtered or unexported fields
}
APIServerClient is a client that talks to a device API server.
func NewAPIServerClient ¶
func NewAPIServerClient(base, apiKey string, opts ...Option) (*APIServerClient, error)
NewAPIServerClient creates a new API server http client.
func (*APIServerClient) Certificate ¶
func (c *APIServerClient) Certificate(ctx context.Context, in *api.VerificationCertificateRequest) (*api.VerificationCertificateResponse, error)
Certificate calls the /certificate endpoint to exchange a token for a certificate.
func (*APIServerClient) Verify ¶
func (c *APIServerClient) Verify(ctx context.Context, in *api.VerifyCodeRequest) (*api.VerifyCodeResponse, error)
Verify calls the /verify endpoint to convert a code into a token.
type AdminAPIServerClient ¶
type AdminAPIServerClient struct {
// contains filtered or unexported fields
}
AdminAPIServerClient is a client that talks to an admin API server.
func NewAdminAPIServerClient ¶
func NewAdminAPIServerClient(base, apiKey string, opts ...Option) (*AdminAPIServerClient, error)
NewAdminAPIServerClient creates a new admin API server http client.
func (*AdminAPIServerClient) BatchIssueCode ¶
func (c *AdminAPIServerClient) BatchIssueCode(ctx context.Context, in *api.BatchIssueCodeRequest) (*api.BatchIssueCodeResponse, error)
BatchIssueCode calls the /batch-issue endpoint. Callers must check the HTTP response code.
func (*AdminAPIServerClient) CheckCodeStatus ¶
func (c *AdminAPIServerClient) CheckCodeStatus(ctx context.Context, in *api.CheckCodeStatusRequest) (*api.CheckCodeStatusResponse, error)
CheckCodeStatus uses the Admin API to retrieve the status of an OTP code.
func (*AdminAPIServerClient) IssueCode ¶
func (c *AdminAPIServerClient) IssueCode(ctx context.Context, in *api.IssueCodeRequest) (*api.IssueCodeResponse, error)
IssueCode calls the /issue endpoint. Callers must check the HTTP response code.
type AndroidTarget ¶
type AndroidTarget struct { Namespace string `json:"namespace"` AppName string `json:"app_name,omitempty"` PackageName string `json:"package_name"` SHA256CertFingerprints string `json:"sha256_cert_fingerprints"` }
AndroidTarget holds the android metadata for an App of AppResponse.
type App ¶
type App struct { Region string `json:"region"` IsEnx bool `json:"is_enx,omitempty"` AndroidTarget `json:"android_target"` }
App represents single app for the AppResponse body.
type AppSyncClient ¶
type AppSyncClient struct {
// contains filtered or unexported fields
}
AppSyncClient is a client that talks to the appsync service.
func NewAppSyncClient ¶
func NewAppSyncClient(base string, opts ...Option) (*AppSyncClient, error)
NewAppSyncClient creates a new app sync service http client.
func (*AppSyncClient) AppSync ¶
func (c *AppSyncClient) AppSync(ctx context.Context) (*AppsResponse, error)
AppSync triggers an application sync.
type AppsResponse ¶
type AppsResponse struct {
Apps []App `json:"apps"`
}
AppsResponse is the body for the published list of android apps.
type Option ¶
type Option func(c *client) *client
Option is a customization option for the client.
func WithMaxBodySize ¶
WithMaxBodySize sets a custom max body sixe for each request. The default is 64kib.
func WithTimeout ¶
WithTimeout sets a custom timeout for each request. The default is 5s.