1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-01-05 10:20:36 +02:00
woodpecker/shared/model/request.go

27 lines
442 B
Go
Raw Normal View History

2014-07-13 05:01:58 +03:00
package model
import (
"fmt"
)
2014-07-13 05:01:58 +03: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-13 05:01:58 +03:00
}
// URL returns the link to the commit in
// string format.
func (r *Request) URL() string {
2015-01-14 09:32:25 +02: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,
)
}