Documentation
¶
Index ¶
- type APIError
- type Application
- type ApplicationSummary
- type Build
- type BuildSummary
- type Client
- func (c *Client) CreateBuild(options *CreateBuildOptions) (*Build, error)
- func (c *Client) CreateToken(options *CreateTokenOptions) (*Token, error)
- func (c *Client) DeleteToken(options *DeleteTokenOptions) error
- func (c *Client) Do(method string, urlTemplate *uritemplates.UriTemplate, urlModel interface{}, ...) error
- func (c *Client) GetApplication(options *GetApplicationOptions) (*Application, error)
- func (c *Client) GetApplications(options *GetApplicationsOptions) ([]Application, error)
- func (c *Client) GetBuild(options *GetBuildOptions) (*Build, error)
- func (c *Client) GetBuilds(options *GetBuildsOptions) ([]*BuildSummary, error)
- func (c *Client) GetDeploy(options *GetDeployOptions) (*Deploy, error)
- func (c *Client) GetDeploys(options *GetDeploysOptions) ([]*DeploySummary, error)
- func (c *Client) GetToken(options *GetTokenOptions) (*Token, error)
- func (c *Client) GetTokens(options *GetTokensOptions) ([]*TokenSummary, error)
- func (c *Client) UpdateToken(options *UpdateTokenOptions) (*Token, error)
- type Config
- type CreateBuildOptions
- type CreateTokenOptions
- type DeleteTokenOptions
- type Deploy
- type DeploySummary
- type EnvVar
- type ErrResponse
- type GetApplicationOptions
- type GetApplicationsOptions
- type GetBuildOptions
- type GetBuildsOptions
- type GetDeployOptions
- type GetDeploysOptions
- type GetTokenOptions
- type GetTokensOptions
- type SCM
- type Token
- type TokenSummary
- type UnifiedUser
- type UnifiedUserAvatar
- type UnifiedUserMeta
- type UpdateTokenOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
ID string `json:"id"`
URL string `json:"url"`
Name string `json:"name"`
Owner *UnifiedUser `json:"owner"`
Builds string `json:"builds"`
Deploys string `json:"deploys"`
SCM *SCM `json:"scm"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Privacy string `json:"privacy"`
Stack int `json:"stack"`
}
Application is a detailed api representation
type ApplicationSummary ¶
type ApplicationSummary struct {
ID string `json:"id"`
URL string `json:"url"`
Name string `json:"name"`
Owner *UnifiedUser `json:"owner"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Privacy string `json:"privacy"`
Stack int `json:"stack"`
}
ApplicationSummary is a summary api representation
type Build ¶
type Build struct {
ID string `json:"id"`
URL string `json:"url"`
Application *ApplicationSummary `json:"application"`
Branch string `json:"branch"`
CommitHash string `json:"commitHash"`
CreatedAt time.Time `json:"createdAt"`
EnvVars []EnvVar `json:"envVars"`
FinishedAt time.Time `json:"finishedAt"`
Message string `json:"message"`
Progress int `json:"progress"`
Result string `json:"result"`
StartedAt time.Time `json:"startedAt"`
Status string `json:"status"`
}
Build is a detailed api representation
type BuildSummary ¶
type BuildSummary struct {
ID string `json:"id"`
URL string `json:"url"`
Branch string `json:"branch"`
CommitHash string `json:"commitHash"`
CreatedAt time.Time `json:"createdAt"`
FinishedAt time.Time `json:"finishedAt"`
Message string `json:"message"`
Progress int `json:"progress"`
Result string `json:"result"`
StartedAt time.Time `json:"startedAt"`
Status string `json:"status"`
}
BuildSummary is a summary api representation
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the wercker api client.
func (*Client) CreateBuild ¶
func (c *Client) CreateBuild(options *CreateBuildOptions) (*Build, error)
CreateBuild will trigger a new build.
func (*Client) CreateToken ¶
func (c *Client) CreateToken(options *CreateTokenOptions) (*Token, error)
CreateToken creates a new Token.
func (*Client) DeleteToken ¶
func (c *Client) DeleteToken(options *DeleteTokenOptions) error
DeleteToken deletes a token
func (*Client) Do ¶
func (c *Client) Do(method string, urlTemplate *uritemplates.UriTemplate, urlModel interface{}, payload interface{}, result interface{}) error
Do makes a request to the wercker api servers.
func (*Client) GetApplication ¶
func (c *Client) GetApplication(options *GetApplicationOptions) (*Application, error)
GetApplication will retrieve a single Application
func (*Client) GetApplications ¶
func (c *Client) GetApplications(options *GetApplicationsOptions) ([]Application, error)
GetApplications will retrieve a list of Applications
func (*Client) GetBuild ¶
func (c *Client) GetBuild(options *GetBuildOptions) (*Build, error)
GetBuild will retrieve a single Build
func (*Client) GetBuilds ¶
func (c *Client) GetBuilds(options *GetBuildsOptions) ([]*BuildSummary, error)
GetBuilds fetches all builds for a certain application and optional filters.
func (*Client) GetDeploy ¶
func (c *Client) GetDeploy(options *GetDeployOptions) (*Deploy, error)
GetDeploy will retrieve a single Deploy
func (*Client) GetDeploys ¶
func (c *Client) GetDeploys(options *GetDeploysOptions) ([]*DeploySummary, error)
GetDeploys fetches all deploys for a certain application and optional filters.
func (*Client) GetToken ¶
func (c *Client) GetToken(options *GetTokenOptions) (*Token, error)
GetToken retrieves a single Token.
func (*Client) GetTokens ¶
func (c *Client) GetTokens(options *GetTokensOptions) ([]*TokenSummary, error)
GetTokens gets all tokens for the current user.
func (*Client) UpdateToken ¶
func (c *Client) UpdateToken(options *UpdateTokenOptions) (*Token, error)
UpdateToken updates a Token.
type Config ¶
type Config struct {
Credentials credentials.Provider
Endpoint string
HTTPClient *http.Client
}
Config contains all configurable settings which will be used when making requests
type CreateBuildOptions ¶
type CreateBuildOptions struct {
// Required
ApplicationID string `json:"applicationId,omitempty"`
// Optional
Branch string `json:"branch,omitempty"`
CommitHash string `json:"commitHash,omitempty"`
Message string `json:"message,omitempty"`
EnvVars []EnvVar `json:"envVars,omitempty"`
}
CreateBuildOptions are the options associated with Client.CreateBuild.
type CreateTokenOptions ¶
type CreateTokenOptions struct {
Name string `json:"name"`
}
CreateTokenOptions are the options associated with Client.CreateToken
type DeleteTokenOptions ¶
type DeleteTokenOptions struct {
TokenID string `map:"tokenId"`
}
DeleteTokenOptions are the options associated with Client.DeleteToken
type Deploy ¶
type Deploy struct {
ID string `json:"id"`
URL string `json:"url"`
Status string `json:"status"`
Result string `json:"result"`
CreatedAt time.Time `json:"createdAt"`
FinishedAt time.Time `json:"finishedAt"`
Progress int `json:"progress"`
Application *ApplicationSummary `json:"application"`
Build *BuildSummary `json:"build"`
}
Deploy is a detailed api representation
type DeploySummary ¶
type DeploySummary struct {
ID string `json:"id"`
URL string `json:"url"`
Status string `json:"status"`
Result string `json:"result"`
CreatedAt time.Time `json:"createdAt"`
FinishedAt time.Time `json:"finishedAt"`
Progress int `json:"progress"`
}
DeploySummary is a summary api representation
type ErrResponse ¶
type ErrResponse struct {
StatusCode int `json:"statusCode"`
StatusMessage string `json:"error"`
Message string `json:"message"`
}
ErrResponse is a generic error object using wercker api conventions.
func (*ErrResponse) Error ¶
func (e *ErrResponse) Error() string
Error returns the wercker error message
type GetApplicationOptions ¶
type GetApplicationOptions struct {
// Required
Owner string `map:"owner"`
Name string `map:"name"`
}
GetApplicationOptions are the options associated with Client.GetApplication
type GetApplicationsOptions ¶
type GetApplicationsOptions struct {
Limit string `map:"limit,omitempty"`
Skip int `map:"skip,omitempty"`
Sort int `map:"sort,omitempty"`
Stack string `map:"stack,omitempty"`
}
GetApplicationsOptions are the options associated with Client.GetApplications
type GetBuildOptions ¶
type GetBuildOptions struct {
BuildID string `map:"buildId"`
}
GetBuildOptions are the options associated with Client.GetBuild
type GetBuildsOptions ¶
type GetBuildsOptions struct {
// Required
Owner string `map:"owner"`
Name string `map:"name"`
// Optional
Branch string `map:"branch,omitempty"`
Commit string `map:"commit,omitempty"`
Limit int `map:"limit,omitempty"`
Result string `map:"result,omitempty"`
Skip int `map:"skip,omitempty"`
Sort string `map:"sort,omitempty"`
Stack string `map:"stack,omitempty"`
Status string `map:"status,omitempty"`
}
GetBuildsOptions are the options associated with Client.GetBuilds.
type GetDeployOptions ¶
type GetDeployOptions struct {
DeployID string `map:"deployId"`
}
GetDeployOptions are the options associated with Client.GetDeploy
type GetDeploysOptions ¶
type GetDeploysOptions struct {
// Required
Owner string `map:"owner"`
Name string `map:"name"`
// Optional
BuildID string `map:"buildId,omitempty"`
Limit int `map:"limit,omitempty"`
Result string `map:"result,omitempty"`
Skip int `map:"skip,omitempty"`
Sort string `map:"sort,omitempty"`
Stack string `map:"stack,omitempty"`
Status string `map:"status,omitempty"`
}
GetDeploysOptions are the options associated with Client.GetDeploys.
type GetTokenOptions ¶
type GetTokenOptions struct {
TokenID string `map:"tokenId"`
}
GetTokenOptions are the options associated with Client.GetToken
type GetTokensOptions ¶
type GetTokensOptions struct {
}
GetTokensOptions are the options associated with Client.GetTokens
type SCM ¶
type SCM struct {
Type string `json:"type"`
Owner string `json:"owner"`
Repository string `json:"repository"`
}
SCM is a detailed source control manager api representation
type Token ¶
type Token struct {
ID string `json:"id"`
URL string `json:"url"`
Name string `json:"name"`
Token string `json:"token"`
HashedToken string `json:"hashedToken"`
LastCharacters string `json:"lastCharacters"`
CreatedAt *time.Time `json:"createdAt"`
LastUsedAt *time.Time `json:"lastUsedAt"`
}
Token is a detailed api representation
type TokenSummary ¶
type TokenSummary struct {
ID string `json:"id"`
URL string `json:"url"`
Name string `json:"name"`
HashedToken string `json:"hashedToken"`
LastCharacters string `json:"lastCharacters"`
CreatedAt *time.Time `json:"createdAt"`
LastUsedAt *time.Time `json:"lastUsedAt"`
}
TokenSummary is a summary api representation
type UnifiedUser ¶
type UnifiedUser struct {
Type string `json:"type"`
Name string `json:"name"`
Avatar *UnifiedUserAvatar `json:"avatar"`
UserID string `json:"userId"`
Meta *UnifiedUserMeta `json:"meta"`
}
UnifiedUser is a flexible user representation. Not all fields have to be set
type UnifiedUserAvatar ¶
type UnifiedUserAvatar struct {
Gravatar string `json:"gravatar"`
}
UnifiedUserAvatar is the avatar property of the UnifiedUser
type UnifiedUserMeta ¶
type UnifiedUserMeta struct {
Username string `json:"username"`
WerckerEmployee bool `json:"werckerEmployee"`
}
UnifiedUserMeta is the meta property of the UnifiedUser
type UpdateTokenOptions ¶
type UpdateTokenOptions struct {
// Required
TokenID string `map:"tokenId"`
// Optional
Name string `json:"name,omitempty"`
}
UpdateTokenOptions are the options associated with Client.UpdateToken