Skip to content

Commit 0338aa6

Browse files
authored
Update deps, alpine3.14, better codegen (#49)
1 parent f181e1c commit 0338aa6

File tree

6 files changed

+92
-105
lines changed

6 files changed

+92
-105
lines changed

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
FROM alpine:3.13 as health-downloader
2-
ENV GRPC_HEALTH_PROBE_VERSION=v0.4.2 \
1+
FROM alpine:3.14 as health-downloader
2+
ENV GRPC_HEALTH_PROBE_VERSION=v0.4.5 \
33
GRPC_HEALTH_PROBE_URL=https://github.com/grpc-ecosystem/grpc-health-probe/releases/download
44
RUN apk -U add curl \
55
&& curl -fLso /bin/grpc_health_probe \
@@ -8,7 +8,7 @@ RUN apk -U add curl \
88

99
FROM metalstack/builder:latest as builder
1010

11-
FROM alpine:3.13
11+
FROM alpine:3.14
1212
RUN apk -U add ca-certificates
1313
COPY --from=builder /work/bin/server /masterdata-api
1414
COPY --from=health-downloader /bin/grpc_health_probe /bin/grpc_health_probe

api/v1/project_scnrvalr.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"fmt"
1010
)
1111

12-
func (m Project) Schema() string {
12+
func (p *Project) Schema() string {
1313
return `
1414
CREATE TABLE IF NOT EXISTS projects (
1515
id text PRIMARY KEY NOT NULL,
@@ -27,36 +27,36 @@ func (m Project) Schema() string {
2727
`
2828
}
2929

30-
func (m Project) JSONField() string {
30+
func (p *Project) JSONField() string {
3131
return "project"
3232
}
3333

34-
func (m Project) TableName() string {
34+
func (p *Project) TableName() string {
3535
return "projects"
3636
}
3737

38-
func (m Project) Kind() string {
38+
func (p *Project) Kind() string {
3939
return "Project"
4040
}
4141

42-
func (m Project) APIVersion() string {
42+
func (p *Project) APIVersion() string {
4343
return "v1"
4444
}
4545

4646
// Value make the Project struct implement the driver.Valuer interface. This method
4747
// simply returns the JSON-encoded representation of the struct.
48-
func (m Project) Value() (driver.Value, error) {
49-
return json.Marshal(m)
48+
func (p *Project) Value() (driver.Value, error) {
49+
return json.Marshal(p)
5050
}
5151

5252
// Scan make the Project struct implement the sql.Scanner interface. This method
5353
// simply decodes a JSON-encoded value into the struct fields.
54-
func (m *Project) Scan(value interface{}) error {
54+
func (p *Project) Scan(value interface{}) error {
5555
b, ok := value.([]byte)
5656
if !ok {
5757
return fmt.Errorf("type assertion to []byte failed")
5858
}
5959

60-
err := json.Unmarshal(b, m)
60+
err := json.Unmarshal(b, p)
6161
return err
6262
}

api/v1/tenant_scnrvalr.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"fmt"
1010
)
1111

12-
func (m Tenant) Schema() string {
12+
func (t *Tenant) Schema() string {
1313
return `
1414
CREATE TABLE IF NOT EXISTS tenants (
1515
id text PRIMARY KEY NOT NULL,
@@ -27,36 +27,36 @@ func (m Tenant) Schema() string {
2727
`
2828
}
2929

30-
func (m Tenant) JSONField() string {
30+
func (t *Tenant) JSONField() string {
3131
return "tenant"
3232
}
3333

34-
func (m Tenant) TableName() string {
34+
func (t *Tenant) TableName() string {
3535
return "tenants"
3636
}
3737

38-
func (m Tenant) Kind() string {
38+
func (t *Tenant) Kind() string {
3939
return "Tenant"
4040
}
4141

42-
func (m Tenant) APIVersion() string {
42+
func (t *Tenant) APIVersion() string {
4343
return "v1"
4444
}
4545

4646
// Value make the Tenant struct implement the driver.Valuer interface. This method
4747
// simply returns the JSON-encoded representation of the struct.
48-
func (m Tenant) Value() (driver.Value, error) {
49-
return json.Marshal(m)
48+
func (t *Tenant) Value() (driver.Value, error) {
49+
return json.Marshal(t)
5050
}
5151

5252
// Scan make the Tenant struct implement the sql.Scanner interface. This method
5353
// simply decodes a JSON-encoded value into the struct fields.
54-
func (m *Tenant) Scan(value interface{}) error {
54+
func (t *Tenant) Scan(value interface{}) error {
5555
b, ok := value.([]byte)
5656
if !ok {
5757
return fmt.Errorf("type assertion to []byte failed")
5858
}
5959

60-
err := json.Unmarshal(b, m)
60+
err := json.Unmarshal(b, t)
6161
return err
6262
}

go.mod

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ require (
77
github.com/ghodss/yaml v1.0.0
88
github.com/gogo/status v1.1.0
99
github.com/google/go-cmp v0.5.6
10-
github.com/google/uuid v1.2.0
10+
github.com/google/uuid v1.3.0
1111
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
1212
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
1313
github.com/jmoiron/sqlx v1.3.4
14-
github.com/json-iterator/go v1.1.11
15-
github.com/lib/pq v1.10.2
14+
github.com/json-iterator/go v1.1.12
15+
github.com/lib/pq v1.10.3
1616
github.com/lopezator/migrator v0.3.0
17-
github.com/metal-stack/metal-lib v0.8.0
18-
github.com/metal-stack/security v0.6.0
17+
github.com/metal-stack/metal-lib v0.8.1
18+
github.com/metal-stack/security v0.6.2
1919
github.com/metal-stack/v v1.0.3
2020
github.com/prometheus/client_golang v1.11.0
2121
github.com/spf13/cobra v1.2.1
2222
github.com/spf13/viper v1.8.1
2323
github.com/stretchr/testify v1.7.0
2424
github.com/testcontainers/testcontainers-go v0.11.1
25-
go.uber.org/zap v1.18.1
26-
google.golang.org/grpc v1.39.0
25+
go.uber.org/zap v1.19.1
26+
google.golang.org/grpc v1.40.0
2727
google.golang.org/protobuf v1.27.1
2828
)

0 commit comments

Comments
 (0)