Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Clivern committed Jul 10, 2021
1 parent e931e32 commit e8c2967
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM golang:1.16.5

ARG PEANUT_VERSION=0.1.12
ARG PEANUT_VERSION=0.1.13

ENV GO111MODULE=on

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
<img src="https://github.com/Clivern/Peanut/workflows/Release/badge.svg">
</a>
<a href="https://github.com/Clivern/Peanut/releases">
<img src="https://img.shields.io/badge/Version-0.1.12-red.svg">
<img src="https://img.shields.io/badge/Version-0.1.13-red.svg">
</a>
<a href="https://goreportcard.com/report/github.com/Clivern/Peanut">
<img src="https://goreportcard.com/badge/github.com/Clivern/Peanut?v=0.1.12">
<img src="https://goreportcard.com/badge/github.com/Clivern/Peanut?v=0.1.13">
</a>
<a href="https://godoc.org/github.com/clivern/peanut">
<img src="https://godoc.org/github.com/clivern/peanut?status.svg">
Expand Down
7 changes: 4 additions & 3 deletions core/controller/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ type ServicePayload struct {
Service string `json:"service"`
Configs map[string]string `json:"configs"`
DeleteAfter string `json:"deleteAfter"`
Address string `json:"address"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
Expand Down Expand Up @@ -70,12 +69,13 @@ func GetServices(c *gin.Context) {
var services []ServicePayload

for _, v := range data {
v.Configs["address"] = viper.GetString("app.hostname")

services = append(services, ServicePayload{
ID: v.ID,
Service: v.Service,
Configs: v.Configs,
DeleteAfter: v.DeleteAfter,
Address: viper.GetString("app.hostname"),
CreatedAt: time.Unix(v.CreatedAt, 0),
UpdatedAt: time.Unix(v.UpdatedAt, 0),
})
Expand Down Expand Up @@ -134,12 +134,13 @@ func GetService(c *gin.Context) {
return
}

serviceData.Configs["address"] = viper.GetString("app.hostname")

c.JSON(http.StatusOK, gin.H{
"id": serviceData.ID,
"service": serviceData.Service,
"configs": serviceData.Configs,
"deleteAfter": serviceData.DeleteAfter,
"address": viper.GetString("app.hostname"),
"createdAt": time.Unix(serviceData.CreatedAt, 0),
"updatedAt": time.Unix(serviceData.UpdatedAt, 0),
})
Expand Down

0 comments on commit e8c2967

Please sign in to comment.