init
This commit is contained in:
commit
b38c39030b
22 changed files with 1925 additions and 0 deletions
71
internal/app/types.go
Normal file
71
internal/app/types.go
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
package app
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
DatabaseURL string
|
||||
ListenAddr string
|
||||
UnixSocketPath string
|
||||
DevMode bool
|
||||
DemoUser string
|
||||
DemoEmail string
|
||||
AuthHeaderUser string
|
||||
AuthHeaderEmail string
|
||||
ForgejoBaseURL string
|
||||
ForgejoToken string
|
||||
ForgejoOrg string
|
||||
ProjectRoot string
|
||||
DefaultRunCommand string
|
||||
CaddyAdminURL string
|
||||
CaddyServerID string
|
||||
CaddyDomainSuffix string
|
||||
CaddyRouteEnabled bool
|
||||
WebhookBaseURL string
|
||||
}
|
||||
|
||||
type App struct {
|
||||
cfg Config
|
||||
db *sql.DB
|
||||
}
|
||||
|
||||
type User struct {
|
||||
Username string `json:"username"`
|
||||
Email string `json:"email"`
|
||||
}
|
||||
|
||||
type Project struct {
|
||||
ID int64 `json:"id"`
|
||||
UserID string `json:"-"`
|
||||
Name string `json:"name"`
|
||||
Slug string `json:"slug"`
|
||||
Description string `json:"description"`
|
||||
RepoURL string `json:"repo_url"`
|
||||
ServiceName string `json:"service_name"`
|
||||
RouteHost string `json:"route_host"`
|
||||
TargetPort int `json:"target_port"`
|
||||
WorkspaceID int64 `json:"workspace_id"`
|
||||
Workspace string `json:"workspace"`
|
||||
UnixUser string `json:"unix_user"`
|
||||
WebhookURL string `json:"webhook_url"`
|
||||
DeployToken string `json:"-"`
|
||||
ProvisionState string `json:"provision_state"`
|
||||
ProvisionError string `json:"provision_error,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
type EnvVar struct {
|
||||
ID int64 `json:"id"`
|
||||
ProjectID int64 `json:"project_id"`
|
||||
Key string `json:"key"`
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
type Workspace struct {
|
||||
ID int64 `json:"id"`
|
||||
UserID string `json:"-"`
|
||||
Name string `json:"name"`
|
||||
UnixUser string `json:"unix_user"`
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue