Documentation
¶
Index ¶
- Variables
- func LoginUser(baseUrl string, username string, password string) error
- type ArgoCDWebhook
- type Author
- type Branch
- type BranchContainer
- type Changeset
- type ChangesetContainer
- type ChangesetListFilter
- type Client
- func (c *Client) AddUserToGroup(userName string, groupName string) error
- func (c *Client) CopyGroupMembershipsFromOtherUser(userName string, templateUserName string) error
- func (c *Client) CreateGroup(name string, description string) error
- func (c *Client) CreateRepo(repo Repository) (Repository, error)
- func (c *Client) CreateUser(userData UserData) error
- func (c *Client) DeleteGroup(groupName string) error
- func (c *Client) DeleteRepo(namespace string, name string) error
- func (c *Client) DeleteUser(name string) error
- func (c *Client) DeleteUserAndGroupMembership(name string) error
- func (c *Client) DeleteUserFromAllGroups(userName string) error
- func (c *Client) DeleteUserFromGroup(userName string, groupName string) error
- func (c *Client) GetChangeset(namespace string, name string, id string) (Changeset, error)
- func (c *Client) GetContent(namespace string, name string, revision string, path string) (string, *http.Response, error)
- func (c *Client) GetContentForDefaultBranch(namespace string, name string, path string) (string, *http.Response, error)
- func (c *Client) GetDefaultBranch(namespace string, name string) (Branch, error)
- func (c *Client) GetGroup(groupName string) (Group, error)
- func (c *Client) GetGroups() (GroupContainer, error)
- func (c *Client) GetHeadChangesetForBranch(namespace string, name string, branch string) (Changeset, error)
- func (c *Client) GetIndex() (*Index, error)
- func (c *Client) GetPullRequest(namespace string, name string, id string) (PullRequest, error)
- func (c *Client) GetRepo(namespace string, name string) (Repository, error)
- func (c *Client) GetRepoBranch(namespace string, name string, branchName string) (Branch, error)
- func (c *Client) ListChangesets(namespace string, name string, branch string, filter *ChangesetListFilter) (ChangesetContainer, error)
- func (c *Client) ListPullRequests(namespace string, name string, filter *PullRequestListFilter) (PullRequestContainer, error)
- func (c *Client) ListRepoBranches(namespace string, name string) (BranchContainer, error)
- func (c *Client) ListRepos(filter *RepoListFilter) (RepoContainer, error)
- func (c *Client) ListReposByNamespace(namespace string, filter *RepoListFilter) (RepoContainer, error)
- func (c *Client) NewChangesetListFilter() *ChangesetListFilter
- func (c *Client) NewPullRequestListFilter() *PullRequestListFilter
- func (c *Client) NewRepoListFilter() *RepoListFilter
- func (c *Client) SetHttpClient(httpClient *http.Client)
- type ErrorResponse
- type Event
- type Group
- type GroupContainer
- type Index
- type LastCommitter
- type Links
- type Option
- type ProtocolUrl
- type PullRequest
- type PullRequestContainer
- type PullRequestListFilter
- type PushEventPayload
- type RepoContainer
- type RepoListFilter
- type Repository
- type UserData
- type WebhookOptions
Constants ¶
This section is empty.
Variables ¶
var ( ErrEventNotSpecifiedToParse = errors.New("no Event specified to parse") ErrInvalidHTTPMethod = errors.New("invalid HTTP Method") ErrMissingScmEventHeader = errors.New("missing X-SCM-PushEvent Header") ErrMissingScmSignatureHeader = errors.New("missing X-SCM-Signature Header") ErrEventNotFound = errors.New("event not defined to be parsed") ErrParsingPayload = errors.New("error parsing payload") ErrSecretVerification = errors.New("token verification error") ErrHMACVerificationFailed = errors.New("HMAC verification failed") )
var Options = WebhookOptions{}
Functions ¶
Types ¶
type ArgoCDWebhook ¶
type ArgoCDWebhook struct {
// contains filtered or unexported fields
}
func New ¶
func New(options ...Option) (*ArgoCDWebhook, error)
type BranchContainer ¶
type BranchContainer struct { Embedded struct { Branches []Branch `json:"branches"` } `json:"_embedded"` }
type ChangesetContainer ¶
type ChangesetListFilter ¶
type ChangesetListFilter struct {
Limit int `json:"limit"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddUserToGroup ¶
func (*Client) CopyGroupMembershipsFromOtherUser ¶
func (*Client) CreateRepo ¶
func (c *Client) CreateRepo(repo Repository) (Repository, error)
CreateRepo Create new repository
func (*Client) CreateUser ¶
func (*Client) DeleteGroup ¶
func (*Client) DeleteRepo ¶
DeleteRepo Delete repository
func (*Client) DeleteUser ¶
func (*Client) DeleteUserAndGroupMembership ¶
func (*Client) DeleteUserFromAllGroups ¶
func (*Client) DeleteUserFromGroup ¶
func (*Client) GetChangeset ¶
GetChangeset Get a single repository changeset by id
func (*Client) GetContent ¶
func (c *Client) GetContent(namespace string, name string, revision string, path string) (string, *http.Response, error)
GetContent Get file content for revision and path
func (*Client) GetContentForDefaultBranch ¶
func (c *Client) GetContentForDefaultBranch(namespace string, name string, path string) (string, *http.Response, error)
GetContentForDefaultBranch Get file content for latest revision on default branch and path
func (*Client) GetDefaultBranch ¶
GetDefaultBranch Get the default branch of the repository
func (*Client) GetGroups ¶
func (c *Client) GetGroups() (GroupContainer, error)
GetGroups returns all existing Groups
func (*Client) GetHeadChangesetForBranch ¶
func (c *Client) GetHeadChangesetForBranch(namespace string, name string, branch string) (Changeset, error)
GetHeadChangesetForBranch Get head changeset for repository by branch
func (*Client) GetPullRequest ¶
GetPullRequest Get single pull request for repository
func (*Client) GetRepo ¶
func (c *Client) GetRepo(namespace string, name string) (Repository, error)
GetRepo Get single repository by namespace and name
func (*Client) GetRepoBranch ¶
GetRepoBranch Get a single branch of the repository by branch name
func (*Client) ListChangesets ¶
func (c *Client) ListChangesets(namespace string, name string, branch string, filter *ChangesetListFilter) (ChangesetContainer, error)
ListChangesets List all changesets for repository by branch
func (*Client) ListPullRequests ¶
func (c *Client) ListPullRequests(namespace string, name string, filter *PullRequestListFilter) (PullRequestContainer, error)
ListPullRequests List all pull requests for repository
func (*Client) ListRepoBranches ¶
func (c *Client) ListRepoBranches(namespace string, name string) (BranchContainer, error)
ListRepoBranches List all branches of the repository
func (*Client) ListRepos ¶
func (c *Client) ListRepos(filter *RepoListFilter) (RepoContainer, error)
ListRepos List all repositories which the user may see
func (*Client) ListReposByNamespace ¶
func (c *Client) ListReposByNamespace(namespace string, filter *RepoListFilter) (RepoContainer, error)
ListReposByNamespace List all repositories which the user may see by namespace
func (*Client) NewChangesetListFilter ¶
func (c *Client) NewChangesetListFilter() *ChangesetListFilter
func (*Client) NewPullRequestListFilter ¶
func (c *Client) NewPullRequestListFilter() *PullRequestListFilter
func (*Client) NewRepoListFilter ¶
func (c *Client) NewRepoListFilter() *RepoListFilter
func (*Client) SetHttpClient ¶
type ErrorResponse ¶
type ErrorResponse struct { TransactionId string `json:"transactionId,omitempty"` ErrorCode string `json:"errorCode,omitempty"` Context []struct { Type string `json:"type,omitempty"` Id string `json:"id,omitempty"` } `json:"context,omitempty"` Message string `json:"message,omitempty"` AdditionalMessages []struct { Key string `json:"key,omitempty"` Message string `json:"message,omitempty"` } `json:"additionalMessages,omitempty"` Violations []struct { Path string `json:"path,omitempty"` Message string `json:"message,omitempty"` } `json:"violations,omitempty"` Url string `json:"url,omitempty"` }
func (*ErrorResponse) String ¶
func (e *ErrorResponse) String() string
type GroupContainer ¶
type LastCommitter ¶
type Links ¶
type Links struct {
ProtocolUrl []ProtocolUrl `json:"protocol,omitempty"`
}
type Option ¶
type Option func(*ArgoCDWebhook) error
type ProtocolUrl ¶
type PullRequest ¶
type PullRequest struct { Id string `json:"id"` Title string `json:"title"` Description string `json:"description"` Source string `json:"source"` Target string `json:"target"` Status string `json:"status"` CreationDate string `json:"creationDate,omitempty"` CloseDate string `json:"closeDate,omitempty"` }
type PullRequestContainer ¶
type PullRequestContainer struct { Page int `json:"page"` PageTotal int `json:"pageTotal"` Embedded struct { PullRequests []PullRequest `json:"pullRequests"` } `json:"_embedded"` }
type PullRequestListFilter ¶
type PushEventPayload ¶
type RepoContainer ¶
type RepoContainer struct { Page int `json:"page"` PageTotal int `json:"pageTotal"` Embedded struct { Repositories []Repository `json:"repositories"` } `json:"_embedded"` }
type RepoListFilter ¶
type Repository ¶
type Repository struct { Namespace string `json:"namespace"` Name string `json:"name"` Type string `json:"type"` Description string `json:"description"` Contact string `json:"contact"` Archived bool `json:"archived"` LastModified string `json:"lastModified,omitempty"` Links Links `json:"_links,omitempty"` }
type WebhookOptions ¶
type WebhookOptions struct{}
func (WebhookOptions) Secret ¶
func (WebhookOptions) Secret(secret string) Option