porcelain

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2021 License: MIT Imports: 31 Imported by: 12

Documentation

Index

Constants

View Source
const DefaultConcurrentUploadLimit = 10
View Source
const DefaultRetryAttempts = 3
View Source
const DefaultSyncFileLimit = 500

Variables

View Source
var Default = NewHTTPClient(nil)

Default netlify HTTP client.

Functions

This section is empty.

Types

type CustomTLSCertificate

type CustomTLSCertificate struct {
	Certificate    string
	Key            string
	CACertificates string
}

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

func (*FileBundle) Read added in v0.2.0

func (f *FileBundle) Read(p []byte) (n int, err error)

func (*FileBundle) Seek added in v0.2.0

func (f *FileBundle) Seek(offset int64, whence int) (int64, error)

type Netlify

type Netlify struct {
	*plumbing.Netlify
	// contains filtered or unexported fields
}

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

func NewHTTPClient(formats strfmt.Registry) *Netlify

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

func NewRetryableHTTPClient(formats strfmt.Registry, attempts int) *Netlify

NewRetryableHTTPClient creates a new netlify HTTP client with a number of attempts for rate limits.

func (*Netlify) AddSiteAsset added in v0.2.0

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 (n *Netlify) CreateDeployKey(ctx context.Context) (*models.DeployKey, error)

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

func (n *Netlify) CreateTicket(ctx context.Context, clientID string) (*models.Ticket, error)

Create a login ticket to authenticate a user

func (*Netlify) DeleteSite added in v0.13.3

func (n *Netlify) DeleteSite(ctx context.Context, siteID string) error

DeleteSite deletes a site.

func (*Netlify) DeploySite

func (n *Netlify) DeploySite(ctx context.Context, options DeployOptions) (*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 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 (n *Netlify) ExchangeTicket(ctx context.Context, ticketID string) (*models.AccessToken, error)

func (*Netlify) GetDeploy added in v0.2.0

func (n *Netlify) GetDeploy(ctx context.Context, deployID string) (*models.Deploy, error)

GetDeploy returns a deploy.

func (*Netlify) GetSite

func (n *Netlify) GetSite(ctx context.Context, siteID string) (*models.Site, error)

GetSite returns a site.

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

func (n *Netlify) ListFormsBySiteId(ctx context.Context, siteID string) ([]*models.Form, error)

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 (n *Netlify) SetConcurrentUploadLimit(limit int)

func (*Netlify) SetSyncFileLimit

func (n *Netlify) SetSyncFileLimit(limit int)

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 (n *Netlify) ShowTicket(ctx context.Context, ticketID string) (*models.Ticket, error)

func (*Netlify) UpdateSite

func (n *Netlify) UpdateSite(ctx context.Context, site *models.SiteSetup) (*models.Site, error)

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 (n *Netlify) UploadNewSiteAsset(ctx context.Context, asset *SiteAsset) (*models.Asset, error)

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.

func (*Netlify) WaitUntilTicketAuthorized added in v0.0.3

func (n *Netlify) WaitUntilTicketAuthorized(ctx context.Context, ticket *models.Ticket) (*models.Ticket, error)

type SiteAsset added in v0.2.0

type SiteAsset struct {
	SiteID  string
	Name    string
	Size    int64
	Private bool
	Body    io.ReadSeeker
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL