Documentation
¶
Index ¶
- type DeployFileUploadParams
- type DeployWithFilesParams
- type Handler
- func (h Handler) CreateDeployWithFiles(ctx context.Context, deployParams *DeployWithFilesParams) (deploy *models.Deploy, err error)
- func (h Handler) DestroyDeploy(ctx context.Context, id string) (err error)
- func (h Handler) GetLatestDeploy(ctx context.Context, id, branch string) (deploy *models.Deploy, err error)
- func (h Handler) GetSite(ctx context.Context, name string) (site *models.Site, err error)
- func (h Handler) GetSiteFiles(ctx context.Context, id string) (files []*models.File, err error)
- func (h Handler) UploadFilesToDeploy(ctx context.Context, deployFiles ...DeployFileUploadParams) (files []*models.File, err error)
- func (h Handler) WaitForDeploy(ctx context.Context, deploy *models.Deploy) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeployFileUploadParams ¶
type DeployFileUploadParams struct { DeployID string Path string File io.ReadCloser }
DeployFileUploadParams contains the information necessary to upload a new file to a deploy.
type DeployWithFilesParams ¶
DeployWithFilesParams contains all of the necessary parameters to initiate a new deployment.
func NewDeployWithExistingFiles ¶
func NewDeployWithExistingFiles(id, branch string, assets []*models.File) (params *DeployWithFilesParams)
NewDeployWithExistingFiles creates a DeployWithFilesParams object from a site ID, branch name, and a list of existing site files.
func (*DeployWithFilesParams) RegisterFile ¶
func (d *DeployWithFilesParams) RegisterFile(path string, content io.ReadSeeker) (err error)
RegisterFile adds a file path name and its hash to the file list.
type Handler ¶
type Handler struct {
Token string
}
Handler provides high level functions to upload files to Netlify through their SDK.
func (Handler) CreateDeployWithFiles ¶
func (h Handler) CreateDeployWithFiles(ctx context.Context, deployParams *DeployWithFilesParams) (deploy *models.Deploy, err error)
CreateDeployWithFiles creates a new site deployment.
func (Handler) DestroyDeploy ¶
DestroyDeploy cancels and then deletes the deploy with the given ID.
func (Handler) GetLatestDeploy ¶
func (h Handler) GetLatestDeploy(ctx context.Context, id, branch string) (deploy *models.Deploy, err error)
GetLatestDeploy returns the most recent deploy for the given site if one exists.
func (Handler) GetSiteFiles ¶
GetSiteFiles returns the list of files for a specific site.
func (Handler) UploadFilesToDeploy ¶
func (h Handler) UploadFilesToDeploy(ctx context.Context, deployFiles ...DeployFileUploadParams) (files []*models.File, err error)
UploadFilesToDeploy uploads a slice of files to an open deploy on Netlify.