server/database/types.go

82 lines
1.2 KiB
Go
Raw Permalink Normal View History

2023-01-14 13:02:17 +00:00
package database
import (
"time"
"github.com/google/uuid"
)
2023-02-15 03:18:41 +00:00
type CloneCredentialType string
const (
2023-02-15 03:18:41 +00:00
USER_PASS CloneCredentialType = "USER_PASS"
SSH_KEY CloneCredentialType = "SSH_KEY"
)
2023-02-15 03:18:41 +00:00
type CloneCredential struct {
Id uuid.UUID
Name string
2023-02-15 03:18:41 +00:00
Type CloneCredentialType
Username string
Secret string
}
2023-01-14 13:02:17 +00:00
type Pipeline struct {
2023-02-15 03:18:41 +00:00
Id uuid.UUID
Name string
Url string
PollInterval int
CloneCredential *uuid.UUID
}
type Secret struct {
Id uuid.UUID
Name string
Secret string
}
type PipelineSecretMapping struct {
Pipeline uuid.UUID
Secret uuid.UUID
2023-01-14 13:02:17 +00:00
}
type WebhookSender string
const (
Gitea WebhookSender = "gitea"
)
type Webhook struct {
Id uuid.UUID
ServerType WebhookSender
Secret string
Pipeline uuid.UUID
}
type Run struct {
2023-02-25 06:59:02 +00:00
Id uuid.UUID
Pipeline uuid.UUID
InProgress bool
Result *int64
BuildOutput []byte
Stdout []byte
Stderr []byte
2023-01-14 13:02:17 +00:00
}
type CommandExecution struct {
Id uuid.UUID
RunId uuid.UUID
Command []string
2023-01-14 13:02:17 +00:00
ReturnCode int
Stdout string
Stderr string
StartTime time.Time
EndTime time.Time
}
type Runner struct {
2023-02-25 05:28:07 +00:00
Id uuid.UUID
Name string
Token string
}