Documentation ¶
Index ¶
- func New(opts Opts) (remote.Remote, error)
- type Coding
- func (c *Coding) Activate(u *model.User, r *model.Repo, link string) error
- func (c *Coding) Auth(token, secret string) (string, error)
- func (c *Coding) Deactivate(u *model.User, r *model.Repo, link string) error
- func (c *Coding) File(u *model.User, r *model.Repo, b *model.Build, f string) ([]byte, error)
- func (c *Coding) FileRef(u *model.User, r *model.Repo, ref, f string) ([]byte, error)
- func (c *Coding) Hook(r *http.Request) (*model.Repo, *model.Build, error)
- func (c *Coding) Login(res http.ResponseWriter, req *http.Request) (*model.User, error)
- func (c *Coding) Netrc(u *model.User, r *model.Repo) (*model.Netrc, error)
- func (c *Coding) Perm(u *model.User, owner, repo string) (*model.Perm, error)
- func (c *Coding) Refresh(u *model.User) (bool, error)
- func (c *Coding) Repo(u *model.User, owner, repo string) (*model.Repo, error)
- func (c *Coding) Repos(u *model.User) ([]*model.Repo, error)
- func (c *Coding) Status(u *model.User, r *model.Repo, b *model.Build, link string) error
- func (c *Coding) TeamPerm(u *model.User, org string) (*model.Perm, error)
- func (c *Coding) Teams(u *model.User) ([]*model.Team, error)
- type Commit
- type Committer
- type MergeRequest
- type MergeRequestHook
- type Opts
- type PullRequest
- type PullRequestHook
- type PushHook
- type Repository
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Coding ¶
type Coding struct { URL string Client string Secret string Scopes []string Machine string Username string Password string SkipVerify bool }
func (*Coding) Auth ¶
Auth authenticates the session and returns the remote user login for the given token and secret
func (*Coding) Deactivate ¶
Deactivate deactivates a repository by removing all previously created post-commit hooks matching the given link.
func (*Coding) FileRef ¶
FileRef fetches a file from the remote repository for the given ref and returns in string format.
func (*Coding) Hook ¶
Hook parses the post-commit hook from the Request body and returns the required data in a standard format.
func (*Coding) Netrc ¶
Netrc returns a .netrc file that can be used to clone private repositories from a remote system.
func (*Coding) Perm ¶
Perm fetches the named repository permissions from the remote system for the specified user.
func (*Coding) Refresh ¶
Refresh refreshes an oauth token and expiration for the given user. It returns true if the token was refreshed, false if the token was not refreshed, and error if it failed to refersh.
type MergeRequest ¶
type MergeRequest struct { SourceBranch string `json:"source_branch"` TargetBranch string `json:"target_branch"` CommitSHA string `json:"merge_commit_sha"` Status string `json:"status"` Action string `json:"action"` Number float64 `json:"number"` Title string `json:"title"` Body string `json:"body"` WebURL string `json:"web_url"` User *User `json:"user"` }
type MergeRequestHook ¶
type MergeRequestHook struct { Event string `json:"event"` Repository *Repository `json:"repository"` MergeRequest *MergeRequest `json:"merge_request"` }
type Opts ¶
type Opts struct { URL string // Coding server url. Client string // Coding oauth client id. Secret string // Coding oauth client secret. Scopes []string // Coding oauth scopes. Machine string // Optional machine name. Username string // Optional machine account username. Password string // Optional machine account password. SkipVerify bool // Skip ssl verification. }
Opts defines configuration options.
type PullRequest ¶
type PullRequest MergeRequest
type PullRequestHook ¶
type PullRequestHook struct { Event string `json:"event"` Repository *Repository `json:"repository"` PullRequest *PullRequest `json:"pull_request"` }