Documentation
¶
Index ¶
- func DockerFiles(dir string) (*[]string, error)
- func NpmFiles(dir string) (*[]string, error)
- func PackageType(dir string) string
- func StaticFiles(dir string) (*[]string, error)
- type Alias
- type Cert
- type CertParams
- type CertsClient
- func (c CertsClient) Delete(domainName string) ClientError
- func (c CertsClient) List() ([]*Cert, ClientError)
- func (c CertsClient) New(domainNames []string) (Cert, ClientError)
- func (c CertsClient) NewFromParams(params CertParams) (Cert, ClientError)
- func (c CertsClient) Renew(domainNames []string) (Cert, ClientError)
- type Client
- func (c Client) Authenticated() bool
- func (c Client) NewFileRequest(method, path string, file *os.File, v interface{}, headers *map[string]string) ClientError
- func (c Client) NewRequest(method, path string, body interface{}, v interface{}, ...) ClientError
- func (c Client) SetHTTPClient(h *http.Client)
- type ClientError
- type Deployment
- type DeploymentAliasParams
- type DeploymentContent
- type DeploymentContentType
- type DeploymentDir
- type DeploymentFile
- type DeploymentParams
- type DeploymentsClient
- func (c DeploymentsClient) Alias(ID, alias string) (Alias, ClientError)
- func (c DeploymentsClient) Delete(ID string) ClientError
- func (c DeploymentsClient) Files(ID string) ([]DeploymentContent, ClientError)
- func (c DeploymentsClient) Get(ID string) (Deployment, ClientError)
- func (c DeploymentsClient) List() ([]Deployment, ClientError)
- func (c DeploymentsClient) ListAliases(ID string) ([]Alias, ClientError)
- func (c DeploymentsClient) New(params DeploymentParams) (IncompleteDeployment, ClientError)
- func (c DeploymentsClient) Scale(ID string, min, max int) (Deployment, ClientError)
- func (c DeploymentsClient) Upload(deploymentID, sha string, names []string, size int64, data *os.File) ClientError
- type Domain
- type DomainParams
- type DomainsClient
- type ErrZeitResponse
- type FileHash
- type FileHashMap
- type FileInfo
- type IncompleteDeployment
- type InviteParams
- type Now
- type Plan
- type PlansClient
- type RenameParams
- type ScaleParams
- type Subscription
- type Team
- type TeamMember
- type TeamParams
- type TeamsClient
- func (c TeamsClient) Delete(teamID string) ClientError
- func (c TeamsClient) InviteUser(teamID, email string) ClientError
- func (c TeamsClient) List() ([]Team, ClientError)
- func (c TeamsClient) Members(teamID string) ([]TeamMember, ClientError)
- func (c TeamsClient) New(slug string) (Team, ClientError)
- func (c TeamsClient) NewFromParams(params TeamParams) (Team, ClientError)
- func (c TeamsClient) Rename(teamID, name string) ClientError
- type ZeitError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DockerFiles ¶
DockerFiles returns an array of paths for a given Docker project
func StaticFiles ¶
StaticFiles returns an array of paths for a given static project
Types ¶
type Alias ¶
type Alias struct {
UID string `json:"uid,omitempty"`
OldUID string `json:"oldId,omitempty"`
Alias string `json:"alias"`
Created *time.Time `json:"created,omitempty"`
}
Alias represents a deployment alias object
type CertParams ¶
CertParams contains all fields for create
type CertsClient ¶
type CertsClient struct {
// contains filtered or unexported fields
}
CertsClient contains the methods for the Cert API
func (CertsClient) Delete ¶
func (c CertsClient) Delete(domainName string) ClientError
Delete deletes the domain by its ID
func (CertsClient) List ¶
func (c CertsClient) List() ([]*Cert, ClientError)
List retrieves a list of all the domains under the account
func (CertsClient) New ¶
func (c CertsClient) New(domainNames []string) (Cert, ClientError)
New creates a new cert
func (CertsClient) NewFromParams ¶
func (c CertsClient) NewFromParams(params CertParams) (Cert, ClientError)
NewFromParams creates a new cert from params
func (CertsClient) Renew ¶
func (c CertsClient) Renew(domainNames []string) (Cert, ClientError)
Renew renews and existing cert
type Client ¶
Client contains all methods used for making API requests
func (Client) Authenticated ¶
Authenticated returns whether the secret value is set
func (Client) NewFileRequest ¶
func (c Client) NewFileRequest(method, path string, file *os.File, v interface{}, headers *map[string]string) ClientError
NewFileRequest performs an authenticated file upload for the given params
func (Client) NewRequest ¶
func (c Client) NewRequest(method, path string, body interface{}, v interface{}, headers *map[string]string) ClientError
NewRequest performs an authenticated request for the given params
func (Client) SetHTTPClient ¶
SetHTTPClient overrides the default HTTP client used
type ClientError ¶
ClientError represents the error return type
func NewZeitError ¶
func NewZeitError(statusCode int, err *ZeitError) ClientError
NewZeitError construct a new ClientError
type Deployment ¶
type Deployment struct {
UID string `json:"uid"`
Host string `json:"host"`
State string `json:"state"`
StateTimestamp *time.Time `json:"stateTs,omitempty"`
}
Deployment is the contents of a deploy object
type DeploymentAliasParams ¶
type DeploymentAliasParams struct {
Alias string `json:"alias"`
}
DeploymentAliasParams contains all fields for aliasing
type DeploymentContent ¶
type DeploymentContent interface {
GetType() DeploymentContentType
GetName() string
}
DeploymentContent represents a file or directory for deploy
type DeploymentContentType ¶
type DeploymentContentType string
DeploymentContentType represents a DeploymentContent type string
const ( TypeDir DeploymentContentType = "directory" TypeFile DeploymentContentType = "file" )
DeploymentContentTypes
type DeploymentDir ¶
type DeploymentDir struct {
Type DeploymentContentType `json:"type"`
Name string `json:"name"`
Children []DeploymentContent `json:"children"`
}
DeploymentDir is the contents of a directory object for deploy
func (DeploymentDir) GetName ¶
func (d DeploymentDir) GetName() string
GetName implements the DeploymentContent interface
func (DeploymentDir) GetType ¶
func (d DeploymentDir) GetType() DeploymentContentType
GetType implements the DeploymentContent interface
type DeploymentFile ¶
type DeploymentFile struct {
Type DeploymentContentType `json:"type"`
Name string `json:"name"`
UID string `json:"uid,omitempty"`
Scripts map[string]string `json:"scripts,omitempty"`
Dependencies map[string]string `json:"dependencies,omitempty"`
Version string `json:"version,omitempty"`
Description string `json:"description,omitempty"`
}
DeploymentFile is the contents of a file object for deploy
func (DeploymentFile) GetName ¶
func (d DeploymentFile) GetName() string
GetName implements the DeploymentContent interface
func (DeploymentFile) GetType ¶
func (d DeploymentFile) GetType() DeploymentContentType
GetType implements the DeploymentContent interface
type DeploymentParams ¶
type DeploymentParams struct {
Env map[string]string `json:"env"`
Public bool `json:"public"`
ForceNew bool `json:"forceNew"`
ForceSync bool `json:"forceSync"`
Name string `json:"name"`
Description string `json:"description"`
Type string `json:"deploymentType"`
Files []FileInfo `json:"files"`
}
DeploymentParams contains all fields necessary to create a deployment
type DeploymentsClient ¶
type DeploymentsClient struct {
// contains filtered or unexported fields
}
DeploymentsClient contains the methods for the Deployment API
func (DeploymentsClient) Alias ¶
func (c DeploymentsClient) Alias(ID, alias string) (Alias, ClientError)
Alias applies the supplied alias to the given deployment ID
func (DeploymentsClient) Delete ¶
func (c DeploymentsClient) Delete(ID string) ClientError
Delete deletes the deployment by its ID
func (DeploymentsClient) Files ¶
func (c DeploymentsClient) Files(ID string) ([]DeploymentContent, ClientError)
Files retrieves files of a deployment by its ID
func (DeploymentsClient) Get ¶
func (c DeploymentsClient) Get(ID string) (Deployment, ClientError)
Get retrieves a deployment by its ID
func (DeploymentsClient) List ¶
func (c DeploymentsClient) List() ([]Deployment, ClientError)
List retrieves a list of all the deployments under the account
func (DeploymentsClient) ListAliases ¶
func (c DeploymentsClient) ListAliases(ID string) ([]Alias, ClientError)
ListAliases retrieves aliases of a deployment by its ID
func (DeploymentsClient) New ¶
func (c DeploymentsClient) New(params DeploymentParams) (IncompleteDeployment, ClientError)
New creates a new Deployment
func (DeploymentsClient) Scale ¶
func (c DeploymentsClient) Scale(ID string, min, max int) (Deployment, ClientError)
Scale sets the scale of a deployment to the number provided
func (DeploymentsClient) Upload ¶
func (c DeploymentsClient) Upload(deploymentID, sha string, names []string, size int64, data *os.File) ClientError
Upload performs an upload of the given file to the specified deployment
type Domain ¶
type Domain struct {
UID string `json:"uid"`
Name string `json:"name"`
Verified bool `json:"verified"`
VerifyToken string `json:"verifyToken,omitempty"`
Created *time.Time `json:"created,omitempty"`
}
Domain is the contents of a domain object
type DomainParams ¶
DomainParams contains all fields for domain create
type DomainsClient ¶
type DomainsClient struct {
// contains filtered or unexported fields
}
DomainsClient contains the methods for the Domain API
func (DomainsClient) Delete ¶
func (c DomainsClient) Delete(domainName string) ClientError
Delete deletes the domain by its ID
func (DomainsClient) List ¶
func (c DomainsClient) List() ([]Domain, ClientError)
List retrieves a list of all the domains under the account
func (DomainsClient) New ¶
func (c DomainsClient) New(domainName string, external bool) (Domain, ClientError)
New creates a new Domain
func (DomainsClient) NewFromParams ¶
func (c DomainsClient) NewFromParams(params DomainParams) (Domain, ClientError)
NewFromParams creates a new Domain from params
type ErrZeitResponse ¶
type ErrZeitResponse struct {
StatusCode int
Err *ZeitError `json:"err,omitempty"`
AltErr *ZeitError `json:"error,omitempty"`
}
ErrZeitResponse represents the body returned on error
func (ErrZeitResponse) ZeitError ¶
func (e ErrZeitResponse) ZeitError() *ZeitError
ZeitError returns the ZeitError depending on which response was given from the api Sometimes Zeit returns `err` sometimes `error` XXX: Reported to Zeit #now slack channel on Aug 24, 2017
type FileHashMap ¶
FileHashMap represents a map of files and their hashes
func NewFilesList ¶
func NewFilesList(wd string, paths []string) (*[]FileInfo, *FileHashMap, error)
NewFilesList returns an array of FileInfo arrays for the given list of paths
type FileInfo ¶
type FileInfo struct {
Sha string `json:"sha"`
Size int64 `json:"size"`
File string `json:"file"`
Mode uint32 `json:"mode"`
}
FileInfo represents a deployment file to be uploaded
type IncompleteDeployment ¶
type IncompleteDeployment struct {
ID string `json:"deploymentID"`
URL string `json:"url"`
TotalSize int `json:"totalSize"`
Missing []string `json:"missing"`
Warnings []string `json:"warnings"`
}
IncompleteDeployment is the contents of a deploy object before upload
type InviteParams ¶
type InviteParams struct {
Email string `json:"email"`
}
InviteParams contains possible fields for invite
type Now ¶
type Now struct {
Certs *CertsClient
Deployments *DeploymentsClient
Domains *DomainsClient
Plans *PlansClient
Teams *TeamsClient
// contains filtered or unexported fields
}
Now contains all the methods required for interacting with Zeit Now's API
type Plan ¶
type Plan struct {
ID string `json:"id"`
Name string `json:"name"`
Amount int64 `json:"amount"`
Currency string `json:"currency"`
Interval string `json:"interval"`
IntervalCount int64 `json:"interval_count"`
}
Plan contains all fields relevant to a plan object
type PlansClient ¶
type PlansClient struct {
// contains filtered or unexported fields
}
PlansClient contains the methods for the Plan API
func (PlansClient) Current ¶
func (c PlansClient) Current() (Subscription, ClientError)
Current returns the authenticated user's subscription
type RenameParams ¶
type RenameParams struct {
Name string `json:"name"`
}
RenameParams contains possible fields for rename
type ScaleParams ¶
ScaleParams contains all fields necessary to set the scale of a deployment
type Subscription ¶
Subscription represents a user's subscription state
type Team ¶
type Team struct {
ID string `json:"id"`
Slug string `json:"slug"`
Name string `json:"name"`
CreatorID string `json:"creator_id"`
Created *time.Time `json:"created,omitempty"`
}
Team is the contents of a team object
type TeamMember ¶
type TeamMember struct {
UID string `json:"uid"`
Role string `json:"role"`
Email string `json:"email"`
Username string `json:"username"`
}
TeamMember represents a membership to a team
type TeamParams ¶
type TeamParams struct {
Slug string `json:"slug"`
}
TeamParams contains possible fields for creation
type TeamsClient ¶
type TeamsClient struct {
// contains filtered or unexported fields
}
TeamsClient contains the methods for the Team API
func (TeamsClient) Delete ¶
func (c TeamsClient) Delete(teamID string) ClientError
Delete deletes the domain by its ID
func (TeamsClient) InviteUser ¶
func (c TeamsClient) InviteUser(teamID, email string) ClientError
InviteUser sends an invite for the specified team to the email provided
func (TeamsClient) List ¶
func (c TeamsClient) List() ([]Team, ClientError)
List retrieves a list of all the domains under the account
func (TeamsClient) Members ¶
func (c TeamsClient) Members(teamID string) ([]TeamMember, ClientError)
Members retrieves all members associated with a team
func (TeamsClient) New ¶
func (c TeamsClient) New(slug string) (Team, ClientError)
New creates a new Team
func (TeamsClient) NewFromParams ¶
func (c TeamsClient) NewFromParams(params TeamParams) (Team, ClientError)
NewFromParams creates a new Team from params
func (TeamsClient) Rename ¶
func (c TeamsClient) Rename(teamID, name string) ClientError
Rename updates the name value for the specified team