core/repo-integrations-core/internal/db/models.go
Tiago Yamamoto a52bd4519d refactor: optimize Dockerfiles and documentation for core services
- Use Google Distroless images for all services (Go & Node.js).
- Standardize documentation with [PROJECT-NAME].md.
- Add .dockerignore and .gitignore to all projects.
- Remove docker-compose.yml in favor of docker run instructions.
- Fix Go version and dependency issues in observability, repo-integrations, and security-governance.
- Add Podman support (fully qualified image names).
- Update Dashboard to use Node.js static server for Distroless compatibility.
2025-12-30 13:22:34 -03:00

142 lines
3.9 KiB
Go

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.30.0
package db
import (
"database/sql/driver"
"fmt"
"github.com/jackc/pgx/v5/pgtype"
)
type EventType string
const (
EventTypePush EventType = "push"
EventTypePullRequest EventType = "pull_request"
EventTypeRelease EventType = "release"
)
func (e *EventType) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = EventType(s)
case string:
*e = EventType(s)
default:
return fmt.Errorf("unsupported scan type for EventType: %T", src)
}
return nil
}
type NullEventType struct {
EventType EventType `json:"event_type"`
Valid bool `json:"valid"` // Valid is true if EventType is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullEventType) Scan(value interface{}) error {
if value == nil {
ns.EventType, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.EventType.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullEventType) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.EventType), nil
}
type GitProvider string
const (
GitProviderGithub GitProvider = "github"
GitProviderGitlab GitProvider = "gitlab"
GitProviderBitbucket GitProvider = "bitbucket"
)
func (e *GitProvider) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = GitProvider(s)
case string:
*e = GitProvider(s)
default:
return fmt.Errorf("unsupported scan type for GitProvider: %T", src)
}
return nil
}
type NullGitProvider struct {
GitProvider GitProvider `json:"git_provider"`
Valid bool `json:"valid"` // Valid is true if GitProvider is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullGitProvider) Scan(value interface{}) error {
if value == nil {
ns.GitProvider, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.GitProvider.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullGitProvider) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.GitProvider), nil
}
type RepoAccount struct {
ID pgtype.UUID `json:"id"`
TenantID pgtype.UUID `json:"tenant_id"`
Provider string `json:"provider"`
AccountID string `json:"account_id"`
Username string `json:"username"`
EncryptedAccessToken []byte `json:"encrypted_access_token"`
EncryptedRefreshToken []byte `json:"encrypted_refresh_token"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type RepoEvent struct {
ID pgtype.UUID `json:"id"`
TenantID pgtype.UUID `json:"tenant_id"`
RepositoryID pgtype.UUID `json:"repository_id"`
EventType string `json:"event_type"`
Payload []byte `json:"payload"`
ProcessedAt pgtype.Timestamptz `json:"processed_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type Repository struct {
ID pgtype.UUID `json:"id"`
TenantID pgtype.UUID `json:"tenant_id"`
RepoAccountID pgtype.UUID `json:"repo_account_id"`
ExternalID string `json:"external_id"`
Name string `json:"name"`
Url string `json:"url"`
IsActive bool `json:"is_active"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type Webhook struct {
ID pgtype.UUID `json:"id"`
TenantID pgtype.UUID `json:"tenant_id"`
RepositoryID pgtype.UUID `json:"repository_id"`
ExternalID string `json:"external_id"`
Secret string `json:"secret"`
IsActive bool `json:"is_active"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}