1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-06-30 22:13:45 +02:00
Files
woodpecker/shared/model/request.go

27 lines
442 B
Go
Raw Normal View History

2014-07-12 19:01:58 -07:00
package model
import (
"fmt"
)
2014-07-12 19:01:58 -07:00
type Request struct {
Host string `json:"-"`
User *User `json:"-"`
Repo *Repo `json:"repo"`
Commit *Commit `json:"commit"`
Prior *Commit `json:"prior_commit"`
2014-07-12 19:01:58 -07:00
}
// URL returns the link to the commit in
// string format.
func (r *Request) URL() string {
2015-01-13 23:32:25 -08:00
return fmt.Sprintf("%s/%s/%s/%s/%s/%s",
r.Host,
r.Repo.Host,
r.Repo.Owner,
r.Repo.Name,
r.Commit.Branch,
r.Commit.Sha,
)
}