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 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 Client
- 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 TARGET_GA = "ga"
const TARGET_STAGING = "staging"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthStruct ¶
AuthStruct -
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 sites
func (*CertificatesClient) UpdateCertificate ¶
func (c *CertificatesClient) UpdateCertificate(certId int64, site api.CertificateUpdateRequest) (*api.Certificate, error)
UpdateCertificate - Update cert details
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 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 on a publishing operation after waitingfor it to completevalidation 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 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