github.com/navikt/knorten@v0.0.0-20240419132333-1333f46ed8b6/pkg/database/gensql/models.go (about) 1 // Code generated by sqlc. DO NOT EDIT. 2 3 package gensql 4 5 import ( 6 "database/sql" 7 "database/sql/driver" 8 "encoding/json" 9 "fmt" 10 "time" 11 12 "github.com/google/uuid" 13 ) 14 15 type ChartType string 16 17 const ( 18 ChartTypeJupyterhub ChartType = "jupyterhub" 19 ChartTypeAirflow ChartType = "airflow" 20 ) 21 22 func (e *ChartType) Scan(src interface{}) error { 23 switch s := src.(type) { 24 case []byte: 25 *e = ChartType(s) 26 case string: 27 *e = ChartType(s) 28 default: 29 return fmt.Errorf("unsupported scan type for ChartType: %T", src) 30 } 31 return nil 32 } 33 34 type NullChartType struct { 35 ChartType ChartType 36 Valid bool // Valid is true if ChartType is not NULL 37 } 38 39 // Scan implements the Scanner interface. 40 func (ns *NullChartType) Scan(value interface{}) error { 41 if value == nil { 42 ns.ChartType, ns.Valid = "", false 43 return nil 44 } 45 ns.Valid = true 46 return ns.ChartType.Scan(value) 47 } 48 49 // Value implements the driver Valuer interface. 50 func (ns NullChartType) Value() (driver.Value, error) { 51 if !ns.Valid { 52 return nil, nil 53 } 54 return string(ns.ChartType), nil 55 } 56 57 type ChartGlobalValue struct { 58 ID uuid.UUID 59 Created sql.NullTime 60 Key string 61 Value string 62 ChartType ChartType 63 Encrypted bool 64 } 65 66 type ChartTeamValue struct { 67 ID uuid.UUID 68 Created sql.NullTime 69 Key string 70 Value string 71 ChartType ChartType 72 TeamID string 73 } 74 75 type ComputeInstance struct { 76 Owner string 77 Name string 78 DiskSize int32 79 } 80 81 type Event struct { 82 ID uuid.UUID 83 Type string 84 Payload json.RawMessage 85 Status string 86 Deadline string 87 CreatedAt time.Time 88 UpdatedAt time.Time 89 Owner string 90 RetryCount int32 91 } 92 93 type EventLog struct { 94 ID uuid.UUID 95 EventID uuid.UUID 96 LogType string 97 Message string 98 CreatedAt time.Time 99 } 100 101 type Session struct { 102 Token string 103 AccessToken string 104 Email string 105 Name string 106 Created time.Time 107 Expires time.Time 108 IsAdmin bool 109 } 110 111 type Team struct { 112 ID string 113 Slug string 114 Users []string 115 Created sql.NullTime 116 } 117 118 type UserGoogleSecretManager struct { 119 Owner string 120 Name string 121 }