Documentation ¶
Index ¶
- Constants
- Variables
- type CustomTLSCertificate
- type DeployObserver
- type DeployOptions
- type DeployWarner
- type FileBundle
- 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) (*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) (*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, timeout time.Duration) (*models.Deploy, error)
- func (n *Netlify) WaitUntilDeployReady(ctx context.Context, d *models.Deploy, timeout time.Duration) (*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 DefaultConcurrentUploadLimit = 10
const DefaultRetryAttempts = 3
const DefaultSyncFileLimit = 500
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 ¶ added in v0.2.0
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 ¶ added in v0.2.0
type DeployOptions struct { SiteID string Dir string FunctionsDir string BuildDir string LargeMediaEnabled bool IsDraft bool Title string Branch string CommitRef 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 ¶ added in v0.13.3
type DeployWarner interface {
OnWalkWarning(path, msg string)
}
type FileBundle ¶ added in v0.2.0
type FileBundle struct { Name string Sum string Runtime string Size *int64 `json:"size,omitempty"` // Path OR Buffer should be populated Path string Buffer io.ReadSeeker }
func (*FileBundle) Close ¶ added in v0.2.0
func (f *FileBundle) Close() error
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 ¶ added in v0.2.0
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 ¶ added in v0.2.0
NewRetryableHTTPClient creates a new netlify HTTP client with a number of attempts for rate limits.
func (*Netlify) AddSiteAsset ¶ added in v0.2.0
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 ¶ added in v0.2.0
func (*Netlify) CreateSite ¶
func (n *Netlify) CreateSite(ctx context.Context, site *models.SiteSetup, configureDNS bool) (*models.Site, error)
CreateSite creates a new site.
func (*Netlify) CreateTicket ¶ added in v0.0.3
Create a login ticket to authenticate a user
func (*Netlify) DeleteSite ¶ added in v0.13.3
DeleteSite deletes a site.
func (*Netlify) DeploySite ¶
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 ¶ added in v0.2.0
func (n *Netlify) DoDeploy(ctx context.Context, options *DeployOptions, deploy *models.Deploy) (*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 ¶ added in v0.0.3
func (*Netlify) GetSiteAssetPublicSignature ¶ added in v0.2.0
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 ¶ added in v0.2.0
func (n *Netlify) ListFormSubmissions(ctx context.Context, formID string) ([]*models.Submission, error)
ListFormSubmissions lists the forms submissions of a particular form
func (*Netlify) ListFormsBySiteId ¶ added in v0.2.0
ListFormsBySiteId lists the forms of a particular site
func (*Netlify) ListSiteAssets ¶ added in v0.2.0
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 ¶ added in v0.2.0
func (n *Netlify) ShowSiteAssetInfo(ctx context.Context, params *operations.GetSiteAssetInfoParams, showSignature bool) (*models.Asset, error)
func (*Netlify) ShowTicket ¶ added in v0.0.3
func (*Netlify) UpdateSite ¶
UpdateSite modifies an existent site.
func (*Netlify) UpdateSiteAsset ¶ added in v0.2.0
func (n *Netlify) UpdateSiteAsset(ctx context.Context, params *operations.UpdateSiteAssetParams) (*models.Asset, error)
func (*Netlify) UploadNewSiteAsset ¶ added in v0.2.0
func (*Netlify) WaitUntilDeployLive ¶ added in v0.17.0
func (n *Netlify) WaitUntilDeployLive(ctx context.Context, d *models.Deploy, timeout time.Duration) (*models.Deploy, error)
WaitUntilDeployLive blocks until the deploy is in the or "ready" state. At this point, the deploy is ready to recieve traffic.
func (*Netlify) WaitUntilDeployReady ¶
func (n *Netlify) WaitUntilDeployReady(ctx context.Context, d *models.Deploy, timeout time.Duration) (*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.