Documentation ¶
Index ¶
- Constants
- Variables
- type CustomTLSCertificate
- type DeployObserver
- type DeployOptions
- type DeployWarner
- type FileBundle
- type FunctionMetadata
- type Netlify
- func New(transport runtime.ClientTransport, formats strfmt.Registry) *Netlify
- func NewHTTPClient(formats strfmt.Registry) *Netlify
- func NewRetryable(transport runtime.ClientTransport, formats strfmt.Registry, attempts int) *Netlify
- func NewRetryableHTTPClient(formats strfmt.Registry, attempts int) *Netlify
- func (n *Netlify) AddSiteAsset(ctx context.Context, params *operations.CreateSiteAssetParams) (*models.AssetSignature, error)
- func (n *Netlify) ConfigureSiteTLSCertificate(ctx context.Context, siteID string, cert *CustomTLSCertificate) (*models.SniCertificate, error)
- func (n *Netlify) CreateDeployKey(ctx context.Context) (*models.DeployKey, error)
- func (n *Netlify) CreateSite(ctx context.Context, site *models.SiteSetup, configureDNS bool, ...) (*models.Site, error)
- func (n *Netlify) CreateTicket(ctx context.Context, clientID string) (*models.Ticket, error)
- func (n *Netlify) DeleteSite(ctx context.Context, siteID string) error
- func (n *Netlify) DeploySite(ctx context.Context, options DeployOptions, httpClient *http.Client, ...) (*models.Deploy, error)
- func (n *Netlify) DoDeploy(ctx context.Context, options *DeployOptions, deploy *models.Deploy, ...) (*models.Deploy, error)
- func (n *Netlify) ExchangeTicket(ctx context.Context, ticketID string) (*models.AccessToken, error)
- func (n *Netlify) GetDeploy(ctx context.Context, deployID string, httpClient *http.Client, ...) (*models.Deploy, error)
- func (n *Netlify) GetSite(ctx context.Context, siteID string) (*models.Site, error)
- func (n *Netlify) GetSiteAssetPublicSignature(ctx context.Context, params *operations.GetSiteAssetPublicSignatureParams) (*models.AssetPublicSignature, error)
- func (n *Netlify) GetSiteTLSCertificate(ctx context.Context, siteID string) (*models.SniCertificate, error)
- func (n *Netlify) ListFormSubmissions(ctx context.Context, formID string) ([]*models.Submission, error)
- func (n *Netlify) ListFormsBySiteId(ctx context.Context, siteID string) ([]*models.Form, error)
- func (n *Netlify) ListSiteAssets(ctx context.Context, params *operations.ListSiteAssetsParams) ([]*models.Asset, error)
- func (n *Netlify) ListSites(ctx context.Context, params *operations.ListSitesParams) ([]*models.Site, error)
- func (n *Netlify) SetConcurrentUploadLimit(limit int)
- func (n *Netlify) SetSyncFileLimit(limit int)
- func (n *Netlify) ShowSiteAssetInfo(ctx context.Context, params *operations.GetSiteAssetInfoParams, ...) (*models.Asset, error)
- func (n *Netlify) ShowTicket(ctx context.Context, ticketID string) (*models.Ticket, error)
- func (n *Netlify) UpdateSite(ctx context.Context, site *models.SiteSetup) (*models.Site, error)
- func (n *Netlify) UpdateSiteAsset(ctx context.Context, params *operations.UpdateSiteAssetParams) (*models.Asset, error)
- func (n *Netlify) UploadNewSiteAsset(ctx context.Context, asset *SiteAsset) (*models.Asset, error)
- func (n *Netlify) WaitUntilDeployLive(ctx context.Context, d *models.Deploy) (*models.Deploy, error)
- func (n *Netlify) WaitUntilDeployProcessed(ctx context.Context, d *models.Deploy) (*models.Deploy, error)
- func (n *Netlify) WaitUntilDeployReady(ctx context.Context, d *models.Deploy) (*models.Deploy, error)
- func (n *Netlify) WaitUntilTLSCertificateReady(ctx context.Context, siteID string, cert *models.SniCertificate) (*models.SniCertificate, error)
- func (n *Netlify) WaitUntilTicketAuthorized(ctx context.Context, ticket *models.Ticket) (*models.Ticket, error)
- type SiteAsset
Constants ¶
const ( DefaultSyncFileLimit = 500 DefaultConcurrentUploadLimit = 10 DefaultRetryAttempts = 3 )
Variables ¶
var Default = NewHTTPClient(nil)
Default netlify HTTP client.
Functions ¶
This section is empty.
Types ¶
type CustomTLSCertificate ¶
CustomTLSCertificate holds information about custom TLS certificates.
type DeployObserver ¶
type DeployObserver interface { OnSetupWalk() error OnSuccessfulStep(*FileBundle) error OnSuccessfulWalk(*models.DeployFiles) error OnFailedWalk() OnSetupDelta(*models.DeployFiles) error OnSuccessfulDelta(*models.DeployFiles, *models.Deploy) error OnFailedDelta(*models.DeployFiles) OnSetupUpload(*FileBundle) error OnSuccessfulUpload(*FileBundle) error OnFailedUpload(*FileBundle) }
type DeployOptions ¶
type DeployOptions struct { SiteID string Dir string FunctionsDir string EdgeFunctionsDir string EdgeRedirectsDir string BuildDir string LargeMediaEnabled bool IsDraft bool SkipRetry bool Title string Branch string CommitRef string Framework string FrameworkVersion string UploadTimeout time.Duration PreProcessTimeout time.Duration Observer DeployObserver // contains filtered or unexported fields }
DeployOptions holds the option for creating a new deploy
type DeployWarner ¶
type DeployWarner interface {
OnWalkWarning(path, msg string)
}
type FileBundle ¶
type FileBundle struct { Name string Sum string Runtime string Size *int64 `json:"size,omitempty"` FunctionMetadata *FunctionMetadata // Path OR Buffer should be populated Path string Buffer io.ReadSeeker }
func (*FileBundle) Close ¶
func (f *FileBundle) Close() error
type FunctionMetadata ¶
type Netlify ¶
Netlify is a client for netlify
func New ¶
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Netlify
New creates a new netlify client.
func NewHTTPClient ¶
NewHTTPClient creates a new netlify HTTP client.
func NewRetryable ¶
func NewRetryable(transport runtime.ClientTransport, formats strfmt.Registry, attempts int) *Netlify
NewRetryable creates a new netlify client with a number of attempts for rate limits.
func NewRetryableHTTPClient ¶
NewRetryableHTTPClient creates a new netlify HTTP client with a number of attempts for rate limits.
func (*Netlify) AddSiteAsset ¶
func (n *Netlify) AddSiteAsset(ctx context.Context, params *operations.CreateSiteAssetParams) (*models.AssetSignature, error)
func (*Netlify) ConfigureSiteTLSCertificate ¶
func (n *Netlify) ConfigureSiteTLSCertificate(ctx context.Context, siteID string, cert *CustomTLSCertificate) (*models.SniCertificate, error)
ConfigureSiteTLSCertificate provisions a TLS certificate for a site with a custom domain. It uses Let's Encrypt if the certificate is empty.
func (*Netlify) CreateDeployKey ¶
func (*Netlify) CreateSite ¶
func (n *Netlify) CreateSite(ctx context.Context, site *models.SiteSetup, configureDNS bool, httpClient *http.Client, timeout time.Duration) (*models.Site, error)
CreateSite creates a new site.
func (*Netlify) CreateTicket ¶
Create a login ticket to authenticate a user
func (*Netlify) DeleteSite ¶
DeleteSite deletes a site.
func (*Netlify) DeploySite ¶
func (n *Netlify) DeploySite(ctx context.Context, options DeployOptions, httpClient *http.Client, timeout time.Duration) (*models.Deploy, error)
DeploySite creates a new deploy for a site given a directory in the filesystem. It uploads the necessary files that changed between deploys.
func (*Netlify) DoDeploy ¶
func (n *Netlify) DoDeploy(ctx context.Context, options *DeployOptions, deploy *models.Deploy, httpClient *http.Client, timeout time.Duration) (*models.Deploy, error)
DoDeploy deploys the changes for a site given a directory in the filesystem. It uploads the necessary files that changed between deploys.
func (*Netlify) ExchangeTicket ¶
func (*Netlify) GetDeploy ¶
func (n *Netlify) GetDeploy(ctx context.Context, deployID string, httpClient *http.Client, timeout time.Duration) (*models.Deploy, error)
GetDeploy returns a deploy.
func (*Netlify) GetSiteAssetPublicSignature ¶
func (n *Netlify) GetSiteAssetPublicSignature(ctx context.Context, params *operations.GetSiteAssetPublicSignatureParams) (*models.AssetPublicSignature, error)
func (*Netlify) GetSiteTLSCertificate ¶
func (n *Netlify) GetSiteTLSCertificate(ctx context.Context, siteID string) (*models.SniCertificate, error)
GetSiteTLSCertificate shows the TLS certificate configured for a site.
func (*Netlify) ListFormSubmissions ¶
func (n *Netlify) ListFormSubmissions(ctx context.Context, formID string) ([]*models.Submission, error)
ListFormSubmissions lists the forms submissions of a particular form
func (*Netlify) ListFormsBySiteId ¶
ListFormsBySiteId lists the forms of a particular site
func (*Netlify) ListSiteAssets ¶
func (n *Netlify) ListSiteAssets(ctx context.Context, params *operations.ListSiteAssetsParams) ([]*models.Asset, error)
func (*Netlify) ListSites ¶
func (n *Netlify) ListSites(ctx context.Context, params *operations.ListSitesParams) ([]*models.Site, error)
ListSites lists the sites a user has access to.
func (*Netlify) SetConcurrentUploadLimit ¶
func (*Netlify) SetSyncFileLimit ¶
func (*Netlify) ShowSiteAssetInfo ¶
func (n *Netlify) ShowSiteAssetInfo(ctx context.Context, params *operations.GetSiteAssetInfoParams, showSignature bool) (*models.Asset, error)
func (*Netlify) ShowTicket ¶
func (*Netlify) UpdateSite ¶
UpdateSite modifies an existent site.
func (*Netlify) UpdateSiteAsset ¶
func (n *Netlify) UpdateSiteAsset(ctx context.Context, params *operations.UpdateSiteAssetParams) (*models.Asset, error)
func (*Netlify) UploadNewSiteAsset ¶
func (*Netlify) WaitUntilDeployLive ¶
func (n *Netlify) WaitUntilDeployLive(ctx context.Context, d *models.Deploy) (*models.Deploy, error)
WaitUntilDeployLive blocks until the deploy is in the "ready" state. At this point, the deploy is ready to receive traffic to all of its URLs.
func (*Netlify) WaitUntilDeployProcessed ¶
func (n *Netlify) WaitUntilDeployProcessed(ctx context.Context, d *models.Deploy) (*models.Deploy, error)
WaitUntilDeployProcessed blocks until the deploy is in the "processed" state. At this point, the deploy is ready to receive traffic via its permalink.
func (*Netlify) WaitUntilDeployReady ¶
func (n *Netlify) WaitUntilDeployReady(ctx context.Context, d *models.Deploy) (*models.Deploy, error)
WaitUntilDeployReady blocks until the deploy is in the "prepared" or "ready" state.
func (*Netlify) WaitUntilTLSCertificateReady ¶
func (n *Netlify) WaitUntilTLSCertificateReady(ctx context.Context, siteID string, cert *models.SniCertificate) (*models.SniCertificate, error)
WaitUntilTLSCertificateReady checks the state of a site's certificate. It waits until the state is "issued", for Let's Encrypt certificates or "custom", which means that the certificate was provided by the user.