Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Assets ¶ added in v0.3.0
type Assets struct {
Links []*Link `json:"links"`
}
Assets describes the assets as Links associated to a release.
func ParseAssets ¶ added in v0.3.0
ParseAssets generates an instance of Asset from names and urls
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is used to send requests to the GitLab API. Normally created with the `New` function
func New ¶
func New(serverURL, token, projectID string, httpClient HTTPClient) (*Client, error)
New creates a new GitLab Client
func (*Client) CreateRelease ¶
func (gc *Client) CreateRelease(ctx context.Context, createReleaseReq *CreateReleaseRequest) (*CreateReleaseResponse, error)
CreateRelease will try to create a release via GitLab's Releases API
type CreateReleaseRequest ¶
type CreateReleaseRequest struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
TagName string `json:"tag_name"`
Ref string `json:"ref,omitempty"`
Assets *Assets `json:"assets,omitempty"`
Milestones []string `json:"milestones,omitempty"`
ReleasedAt *time.Time `json:"released_at,omitempty"`
}
CreateReleaseRequest body. The full documentation can be found at https://docs.gitlab.com/ee/api/releases/index.html#create-a-release
type CreateReleaseResponse ¶
type CreateReleaseResponse struct {
Name string `json:"name"`
Description string `json:"description"`
DescriptionHTML string `json:"description_html"`
TagName string `json:"tag_name"`
CreatedAt time.Time `json:"created_at"`
ReleasedAt time.Time `json:"released_at"`
Assets *Assets `json:"assets,omitempty"`
Milestones []*Milestone `json:"milestones,omitempty"`
}
CreateReleaseResponse body. The full documentation can be found at https://docs.gitlab.com/ee/api/releases/index.html#create-a-release
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message,omitempty"`
// Err will only be populated if the Releases API returns an unexpected error and is not contained in Message
Err string `json:"error,omitempty"`
// contains filtered or unexported fields
}
ErrorResponse expected from the API
func (*ErrorResponse) Error ¶
func (er *ErrorResponse) Error() string
Error implements the error interface. Wraps an error message from the API into an error type
type HTTPClient ¶
HTTPClient is an interface that describes the available actions of the client. Use http.Client during runtime. See mock_httpClient_test.go for a testing implementation
type Link ¶ added in v0.3.0
type Link struct {
ID int64 `json:"id,omitempty"`
Name string `json:"name"`
URL string `json:"url"`
External bool `json:"external,omitempty"`
LinkType string `json:"link_type,omitempty"`
Filepath string `json:"filepath,omitempty"`
}
Link describes the Link request/response body.
type Milestone ¶ added in v0.3.0
Milestone response body when creating a release. Only uses a subset of all the fields. The full documentation can be found at https://docs.gitlab.com/ee/api/releases/index.html#create-a-release
type MockHTTPClient ¶ added in v0.2.0
MockHTTPClient is an autogenerated mock type for the HTTPClient type