Files
atlantis/models/models.go
Luke Kysow 8fbe662185 Return error if workspace doesn't exist (#61)
* Return error if workspace doesn't exist
* Default data dir to ~/.atlantis. Don't clean workspaces
* Run goimports
2017-07-01 16:17:22 -07:00

56 lines
916 B
Go

package models
import (
paths "path"
"time"
)
type Repo struct {
FullName string
Owner string
Name string
SSHURL string
}
type PullRequest struct {
Num int
HeadCommit string
BaseCommit string
URL string
Branch string
Author string
}
type User struct {
Username string
}
type ProjectLock struct {
Project Project
Pull PullRequest
User User
Env string
Time time.Time
}
// Project represents a Terraform project.
// Since there may be multiple Terraform projects in a single repo we also include Path
type Project struct {
RepoFullName string
// Path to project root in the repo.
// If "." then project is at root.
// Never ends in "/".
Path string
}
func NewProject(repoFullName string, path string) Project {
path = paths.Clean(path)
if path == "/" {
path = "."
}
return Project{
RepoFullName: repoFullName,
Path: path,
}
}