56 lines
1.8 KiB
Go
56 lines
1.8 KiB
Go
package models
|
|
|
|
import (
|
|
"encoding/json"
|
|
"time"
|
|
)
|
|
|
|
type Repository struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
Owner string `json:"owner"`
|
|
ForgejoURL string `json:"forgejo_url,omitempty"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type Commit struct {
|
|
ID string `json:"id"`
|
|
RepositoryID string `json:"repository_id"`
|
|
SHA string `json:"sha"`
|
|
Author *string `json:"author,omitempty"`
|
|
Message *string `json:"message,omitempty"`
|
|
Branch *string `json:"branch,omitempty"`
|
|
CommittedAt *time.Time `json:"committed_at,omitempty"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|
|
|
|
type Build struct {
|
|
ID string `json:"id"`
|
|
RepositoryID string `json:"repository_id"`
|
|
CommitID string `json:"commit_id"`
|
|
Builder *string `json:"builder,omitempty"`
|
|
BuildFlags *string `json:"build_flags,omitempty"`
|
|
Tags json.RawMessage `json:"tags,omitempty"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|
|
|
|
type Artifact struct {
|
|
ID string `json:"id"`
|
|
RepositoryID string `json:"repository_id"`
|
|
CommitID string `json:"commit_id"`
|
|
BuildID *string `json:"build_id,omitempty"`
|
|
Type string `json:"type"`
|
|
BlobKey string `json:"blob_key"`
|
|
BlobSize int64 `json:"blob_size"`
|
|
CrashMessage *string `json:"crash_message,omitempty"`
|
|
StackTrace *string `json:"stack_trace,omitempty"`
|
|
Tags json.RawMessage `json:"tags,omitempty"`
|
|
Metadata json.RawMessage `json:"metadata,omitempty"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
|
|
// Joined fields for display.
|
|
RepoName string `json:"repo_name,omitempty"`
|
|
CommitSHA string `json:"commit_sha,omitempty"`
|
|
}
|