Documentation
¶
Index ¶
- func GetAccessToken(ctx context.Context, orgName string) string
- type Client
- func (c *Client) AccessToken(userId, email string) (User, error)
- func (c *Client) CreateDeploy(ste *Site, digest *Digest, draft bool) (*Deploy, error)
- func (c *Client) CreateSite(s *Site) (*Site, error)
- func (c *Client) DeleteSite(s *Site) error
- func (c *Client) GetSite(s *Site) (*Site, error)
- func (c *Client) UpdateSite(s *Site) (*Site, error)
- type Deploy
- type Digest
- type OauthTransport
- type Site
- type TokenReq
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewFromNamespace ¶
Get a client for netlify
func (*Client) CreateDeploy ¶
func (*Client) DeleteSite ¶
type Deploy ¶
type Deploy struct {
Id string `json:"id"`
SiteId string `json:"siteId"`
UserId string `json:"-"`
// State of the deploy (uploading/uploaded/processing/ready/error)
State string `json:"state"`
// Cause of error if State is "error"
ErrorMessage string `json:"errorMessage,omitempty"`
// Shas of files that needs to be uploaded before the deploy is ready
Required []string `json:"required"`
DeployUrl string `json:"deployUrl"`
SiteUrl string `json:"url"`
ScreenshotUrl string `json:"screenshotUrl,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
Represents a Netlify deploy
type OauthTransport ¶
type OauthTransport struct {
http.RoundTripper
AccessToken string
}
type Site ¶
type Site struct {
Id string `json:"id"`
UserId string `json:"userId"`
// These fields can be updated through the API
Name string `json:"name"`
Domain string `json:"domain"`
Password string `json:"password"`
NotificationEmail string `json:"notificationEmail"`
State string `json:"state"`
Premium bool `json:"premium"`
Claimed bool `json:"claimed"`
Url string `json:"url"`
AdminUrl string `json:"adminUrl"`
DeployUrl string `json:"deployUrl"`
ScreenshotUrl string `json:"screenshotUrl"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
Represents a Netlify site
type User ¶
type User struct {
Email string `json:"email"` // Our users's email (typically fake email)
Id string `json:"id,omitempy"` // Netlify's id for access token
Uid string `json:"uid,omitempty"` // Netlify's copy of our supplied id (typically organization name)
UserId string `json:"user_id,omitempty"` // Netlify's user_id for our org
CreatedAt time.Time `json:"created_at,omitempy"`
AccessToken string `json:"access_token,omitempy"`
}
This is really a token response, but for our purposes acts as a copy of netlify's representation of our user.
Click to show internal directories.
Click to hide internal directories.