Documentation ¶
Overview ¶
Package client
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
Copyright (c) 2024 Qwilt Inc.
Package client ¶
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
Copyright (c) 2024 Qwilt Inc.
Index ¶
- Constants
- type AuthResponse
- type AuthStruct
- type CertificateTemplateClient
- func (c *CertificateTemplateClient) CreateCertificateTemplate(cert api.CertificateTemplateCreateRequest) (*api.CertificateTemplate, error)
- func (c *CertificateTemplateClient) DeleteCertificateTemplate(id types.Int64) error
- func (c *CertificateTemplateClient) GetCertificateTemplate(id types.Int64) (*api.CertificateTemplate, error)
- func (c *CertificateTemplateClient) GetCertificateTemplates() ([]api.CertificateTemplate, error)
- func (c *CertificateTemplateClient) GetChallengeDelegationDomainsListFromCertificateTemplateId(id types.Int64) (*ChallengeDelegationMap, error)
- func (c *CertificateTemplateClient) GetChallengeDelegationDomainsListFromCsrId(id int64) (*ChallengeDelegationMap, error)
- type CertificatesClient
- func (c *CertificatesClient) CreateCertificate(cert api.CertificateCreateRequest) (*api.Certificate, error)
- func (c *CertificatesClient) DeleteCertificate(certId types.Int64) error
- func (c *CertificatesClient) GetCertificate(certId types.Int64, detailed bool) (*api.Certificate, error)
- func (c *CertificatesClient) GetCertificates(detailed bool) ([]api.Certificate, error)
- func (c *CertificatesClient) UpdateCertificate(certId int64, site api.CertificateUpdateRequest) (*api.Certificate, error)
- type ChallengeDelegationMap
- type Client
- type DeviceIpsClient
- type DomainPairs
- type EndpointBuilder
- type PublishOpsClient
- func (c *PublishOpsClient) Cancel(siteId string, publishId string) error
- func (c *PublishOpsClient) FindLatestPubOp(siteId string, revisionId string) (*api.PubOp, error)
- func (c *PublishOpsClient) GetAndWaitForPubOpAcceptance(siteId string, publishId string, timeout time.Duration) (*api.PubOp, error)
- func (c *PublishOpsClient) GetPubOp(siteId string, publishId string) (*api.PubOp, error)
- func (c *PublishOpsClient) GetPubOps(siteId string, isActive bool, publishState string) ([]api.PubOp, error)
- func (c *PublishOpsClient) GetSitePubStatus(siteId string) (string, string, error)
- func (c *PublishOpsClient) Publish(siteId string, revisionId string, target string) (*api.PubOp, error)
- func (c *PublishOpsClient) Republish(siteId string, target string) (*api.PubOp, error)
- func (c *PublishOpsClient) Unpublish(siteId string, target string) (*api.PubOp, error)
- type SiteCertificatesClient
- func (c *SiteCertificatesClient) GetSiteCertificates(siteId string, revisionId string) ([]api.SiteCertificateResponse, error)
- func (c *SiteCertificatesClient) LinkSiteCertificate(siteId string, certId string) (*api.SiteCertificateResponse, error)
- func (c *SiteCertificatesClient) UnLinkSiteCertificate(siteId string, certId string) error
- type SiteClient
- func (c *SiteClient) CreateSite(site api.SiteCreateRequest) (*api.Site, error)
- func (c *SiteClient) DeleteAndRenameSite(siteId string, siteName string) error
- func (c *SiteClient) DeleteSite(siteId string) error
- func (c *SiteClient) GetSite(siteId string, target string, includeActiveLastPub bool, ...) (*api.Site, error)
- func (c *SiteClient) GetSites(includeActiveLastPub bool, includeDeletedSites bool) ([]api.Site, error)
- func (c *SiteClient) UpdateSite(siteId string, site api.SiteUpdateRequest) (*api.Site, error)
- type SiteClientFacade
- type SiteConfigurationClient
- func (c *SiteConfigurationClient) CreateSiteConfig(siteId string, siteConfigVersion api.SiteConfigAddRequest) (*api.SiteConfigVersion, error)
- func (c *SiteConfigurationClient) GetSiteConfig(siteId string, revisionId string, truncateHostIndex bool) (*api.SiteConfigVersion, error)
- func (c *SiteConfigurationClient) GetSiteConfigs(siteId string, truncateHostIndex bool) ([]api.SiteConfigVersion, error)
Constants ¶
const ACCEPTANCE_STATUS_DISMISSED = "Dismissed"
const ACCEPTANCE_STATUS_INVALID = "Invalid"
const ACCEPTANCE_STATUS_PENDING = "Pending"
const ACCEPTANCE_TIMEOUT = 180 * time.Second
const CertificateSigningRequestsRoot = "/api/v2/certificate-signing-requests"
const CertificateTemplatesRoot = "/api/v2/certificate-templates"
const TARGET_GA = "ga"
const TARGET_STAGING = "staging"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthStruct ¶
AuthStruct -
type CertificateTemplateClient ¶ added in v0.1.15
type CertificateTemplateClient struct { *Client // contains filtered or unexported fields }
func NewCertificateTemplateClient ¶ added in v0.1.15
func NewCertificateTemplateClient(client *Client) *CertificateTemplateClient
func (*CertificateTemplateClient) CreateCertificateTemplate ¶ added in v0.1.15
func (c *CertificateTemplateClient) CreateCertificateTemplate(cert api.CertificateTemplateCreateRequest) (*api.CertificateTemplate, error)
CreateCertificateTemplate - Create new Certificate Template
func (*CertificateTemplateClient) DeleteCertificateTemplate ¶ added in v0.1.15
func (c *CertificateTemplateClient) DeleteCertificateTemplate(id types.Int64) error
DeleteCertificateTemplate - Deletes a certificate Template
func (*CertificateTemplateClient) GetCertificateTemplate ¶ added in v0.1.15
func (c *CertificateTemplateClient) GetCertificateTemplate(id types.Int64) (*api.CertificateTemplate, error)
GetCertificateTemplate - Returns Certificate Template details
func (*CertificateTemplateClient) GetCertificateTemplates ¶ added in v0.1.15
func (c *CertificateTemplateClient) GetCertificateTemplates() ([]api.CertificateTemplate, error)
GetCertificateTemplates - Returns list of Certificate Templates
func (*CertificateTemplateClient) GetChallengeDelegationDomainsListFromCertificateTemplateId ¶ added in v0.1.15
func (c *CertificateTemplateClient) GetChallengeDelegationDomainsListFromCertificateTemplateId(id types.Int64) (*ChallengeDelegationMap, error)
func (*CertificateTemplateClient) GetChallengeDelegationDomainsListFromCsrId ¶ added in v0.1.15
func (c *CertificateTemplateClient) GetChallengeDelegationDomainsListFromCsrId(id int64) (*ChallengeDelegationMap, error)
type CertificatesClient ¶
type CertificatesClient struct { *Client // contains filtered or unexported fields }
func NewCertificatesClient ¶
func NewCertificatesClient(client *Client) *CertificatesClient
func (*CertificatesClient) CreateCertificate ¶
func (c *CertificatesClient) CreateCertificate(cert api.CertificateCreateRequest) (*api.Certificate, error)
CreateCertificate - Create new certificate
func (*CertificatesClient) DeleteCertificate ¶
func (c *CertificatesClient) DeleteCertificate(certId types.Int64) error
DeleteCertificate - Deletes a certificate
func (*CertificatesClient) GetCertificate ¶
func (c *CertificatesClient) GetCertificate(certId types.Int64, detailed bool) (*api.Certificate, error)
GetCertificate - Returns certificate details
func (*CertificatesClient) GetCertificates ¶
func (c *CertificatesClient) GetCertificates(detailed bool) ([]api.Certificate, error)
GetCertificates - Returns list of certificates
func (*CertificatesClient) UpdateCertificate ¶
func (c *CertificatesClient) UpdateCertificate(certId int64, site api.CertificateUpdateRequest) (*api.Certificate, error)
UpdateCertificate - Update cert details
type ChallengeDelegationMap ¶ added in v0.1.15
type ChallengeDelegationMap struct {
// contains filtered or unexported fields
}
func (*ChallengeDelegationMap) PrettyPrint ¶ added in v0.1.15
func (ch *ChallengeDelegationMap) PrettyPrint() string
type Client ¶
type Client struct { HTTPClient *http.Client Token string XApiToken string Auth AuthStruct // contains filtered or unexported fields }
Client -
func (*Client) SignIn ¶
func (c *Client) SignIn() (*AuthResponse, error)
SignIn - Get a new token for user
type DeviceIpsClient ¶ added in v0.1.15
type DeviceIpsClient struct { *Client // contains filtered or unexported fields }
func NewDeviceIpsClient ¶ added in v0.1.15
func NewDeviceIpsClient(client *Client) *DeviceIpsClient
func (*DeviceIpsClient) GetOriginAllowList ¶ added in v0.1.15
func (c *DeviceIpsClient) GetOriginAllowList() (*api.DeviceIpsModel, error)
GetCertificates - Returns list of certificates
type DomainPairs ¶ added in v0.1.15
type DomainPairs [][]string
type EndpointBuilder ¶
type EndpointBuilder struct {
// contains filtered or unexported fields
}
func NewEndpointBuilder ¶
func NewEndpointBuilder(envType string) EndpointBuilder
func (EndpointBuilder) Build ¶
func (e EndpointBuilder) Build(name string) string
type PublishOpsClient ¶
type PublishOpsClient struct { *Client // contains filtered or unexported fields }
func NewPublishOpsClient ¶
func NewPublishOpsClient(target string, client *Client) *PublishOpsClient
func (*PublishOpsClient) Cancel ¶
func (c *PublishOpsClient) Cancel(siteId string, publishId string) error
Cancel - Cancel an ongoing publish operation
func (*PublishOpsClient) FindLatestPubOp ¶
FindPubOp - Returns latest publishing operation for site
func (*PublishOpsClient) GetAndWaitForPubOpAcceptance ¶
func (c *PublishOpsClient) GetAndWaitForPubOpAcceptance(siteId string, publishId string, timeout time.Duration) (*api.PubOp, error)
GetAndWaitForPubOpAcceptance - Returns details about a publishing operation after waiting for it to complete validation step.
func (*PublishOpsClient) GetPubOps ¶
func (c *PublishOpsClient) GetPubOps(siteId string, isActive bool, publishState string) ([]api.PubOp, error)
GetPubOps - Returns list of publishing operations
func (*PublishOpsClient) GetSitePubStatus ¶
func (c *PublishOpsClient) GetSitePubStatus(siteId string) (string, string, error)
GetSitePubStatus - Get a site's publishing status
func (*PublishOpsClient) Publish ¶
func (c *PublishOpsClient) Publish(siteId string, revisionId string, target string) (*api.PubOp, error)
Publish - Publish a site
type SiteCertificatesClient ¶
type SiteCertificatesClient struct { *Client // contains filtered or unexported fields }
SiteCertificatesClient -
func NewSiteCertificatesClient ¶
func NewSiteCertificatesClient(target string, client *Client) *SiteCertificatesClient
func (*SiteCertificatesClient) GetSiteCertificates ¶
func (c *SiteCertificatesClient) GetSiteCertificates(siteId string, revisionId string) ([]api.SiteCertificateResponse, error)
GetSiteCertficates - Returns list of site certificates
func (*SiteCertificatesClient) LinkSiteCertificate ¶
func (c *SiteCertificatesClient) LinkSiteCertificate(siteId string, certId string) (*api.SiteCertificateResponse, error)
LinkSiteCertificate - links a site to a certificate
func (*SiteCertificatesClient) UnLinkSiteCertificate ¶
func (c *SiteCertificatesClient) UnLinkSiteCertificate(siteId string, certId string) error
LinkSiteCertificate - links asite to a certificate
type SiteClient ¶
type SiteClient struct { *Client // contains filtered or unexported fields }
func NewSiteClient ¶
func NewSiteClient(target string, client *Client) *SiteClient
func (*SiteClient) CreateSite ¶
func (c *SiteClient) CreateSite(site api.SiteCreateRequest) (*api.Site, error)
CreateSite - Create new site
func (*SiteClient) DeleteAndRenameSite ¶
func (c *SiteClient) DeleteAndRenameSite(siteId string, siteName string) error
DeleteAndRenameSite - Deletes a site so we can reuse the name later
This adds "DELETED <unixtimestamp>" to the end of the site name to make it unique
func (*SiteClient) DeleteSite ¶
func (c *SiteClient) DeleteSite(siteId string) error
DeleteSite - Deletes a site
func (*SiteClient) GetSite ¶
func (c *SiteClient) GetSite(siteId string, target string, includeActiveLastPub bool, includeDeletedSites bool) (*api.Site, error)
GetSite - Returns site details
func (*SiteClient) GetSites ¶
func (c *SiteClient) GetSites(includeActiveLastPub bool, includeDeletedSites bool) ([]api.Site, error)
GetSites - Returns list of sites
func (*SiteClient) UpdateSite ¶
func (c *SiteClient) UpdateSite(siteId string, site api.SiteUpdateRequest) (*api.Site, error)
UpdateSite - Update site details
type SiteClientFacade ¶
type SiteClientFacade struct { *PublishOpsClient *SiteClient *SiteConfigurationClient *SiteCertificatesClient *CertificateTemplateClient ApiEndpoint string }
SiteClientFacade -
func NewSiteFacadeClient ¶
func NewSiteFacadeClient(target string, client *Client) *SiteClientFacade
Decorator on top of Client type
type SiteConfigurationClient ¶
type SiteConfigurationClient struct { *Client // contains filtered or unexported fields }
SiteConfigurationClient -
func NewSiteConfigurationClient ¶
func NewSiteConfigurationClient(target string, client *Client) *SiteConfigurationClient
func (*SiteConfigurationClient) CreateSiteConfig ¶
func (c *SiteConfigurationClient) CreateSiteConfig(siteId string, siteConfigVersion api.SiteConfigAddRequest) (*api.SiteConfigVersion, error)
CreateSiteConfig - Add a new site configuration
func (*SiteConfigurationClient) GetSiteConfig ¶
func (c *SiteConfigurationClient) GetSiteConfig(siteId string, revisionId string, truncateHostIndex bool) (*api.SiteConfigVersion, error)
GetSiteConfig - Returns site details
func (*SiteConfigurationClient) GetSiteConfigs ¶
func (c *SiteConfigurationClient) GetSiteConfigs(siteId string, truncateHostIndex bool) ([]api.SiteConfigVersion, error)
GetSiteConfigs - Returns list of site configurations