diff --git a/README.md b/README.md index a5317a9..36682e0 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ -# lando +# ackbar + A microservice for coordinating stateful workload on partitions of data diff --git a/cmd/example/k8s/deploy-client.yml b/cmd/example/k8s/deploy-client.yml index 650c13d..29814e5 100644 --- a/cmd/example/k8s/deploy-client.yml +++ b/cmd/example/k8s/deploy-client.yml @@ -15,10 +15,10 @@ spec: spec: containers: - name: example-client - image: bespinian/ackbar-example-client:0.0.1 + image: bespinian/ackbar-example-client:0.0.2 imagePullPolicy: Always env: - - name: LANDO_URL + - name: ACKBAR_URL value: http://ackbar.ackbar - name: CONTEXT_ID value: f3327714-8d22-44ae-b9c1-840544b398b4 diff --git a/cmd/example/main.go b/cmd/example/main.go index 3abcac3..cf88f5f 100644 --- a/cmd/example/main.go +++ b/cmd/example/main.go @@ -12,12 +12,12 @@ import ( ) func main() { - landoUrl := os.Getenv("LANDO_URL") + ackbarUrl := os.Getenv("ACKBAR_URL") contextId := os.Getenv("CONTEXT_ID") log.Printf("Starting worker in context %s", contextId) - workersUrl := fmt.Sprintf("%s/contexts/%s/workers", landoUrl, contextId) + workersUrl := fmt.Sprintf("%s/contexts/%s/workers", ackbarUrl, contextId) log.Printf("Registering worker at %s", workersUrl) res, err := http.Post(workersUrl, "Content-Type:application/json", strings.NewReader("")) @@ -25,7 +25,7 @@ func main() { log.Fatalf("Failed registering worker: %e", err) } - workerUrl := fmt.Sprintf("%s%s", landoUrl, res.Header.Get(headers.Location)) + workerUrl := fmt.Sprintf("%s%s", ackbarUrl, res.Header.Get(headers.Location)) log.Printf("Refresh URL is %s", workerUrl) log.Printf("Starting processing") diff --git a/go.mod b/go.mod index 7fea904..2e0c3d4 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/bespinian/lando +module github.com/bespinian/ackbar go 1.19 diff --git a/internal/api/context.go b/internal/api/context.go index 8601fcb..1a53752 100644 --- a/internal/api/context.go +++ b/internal/api/context.go @@ -5,16 +5,18 @@ import ( "log" "net/http" - "github.com/bespinian/lando/internal/model" + "github.com/bespinian/ackbar/internal/model" "github.com/gin-gonic/gin" "github.com/go-http-utils/headers" "github.com/google/uuid" ) -var RootPath = "/" -var ContextsPath = fmt.Sprintf("%s%s", RootPath, "contexts") -var ContextIdPlaceholder = ":contextId" -var ContextPath = fmt.Sprintf("%s/%s", ContextsPath, ContextIdPlaceholder) +var ( + RootPath = "/" + ContextsPath = fmt.Sprintf("%s%s", RootPath, "contexts") + ContextIdPlaceholder = ":contextId" + ContextPath = fmt.Sprintf("%s/%s", ContextsPath, ContextIdPlaceholder) +) func (a *Api) GetContexts(c *gin.Context) { contexts, _ := a.Backend.GetContexts() diff --git a/internal/api/info.go b/internal/api/info.go index 0e19cc1..80a2ddd 100644 --- a/internal/api/info.go +++ b/internal/api/info.go @@ -4,8 +4,8 @@ import ( "net/http" "strings" - "github.com/bespinian/lando/internal/backend" - "github.com/bespinian/lando/internal/model" + "github.com/bespinian/ackbar/internal/backend" + "github.com/bespinian/ackbar/internal/model" "github.com/gin-gonic/gin" "github.com/google/uuid" ) @@ -14,7 +14,7 @@ type Api struct { Backend backend.Backend } -var version = model.Info{Name: "lando", Version: "0.0.1"} +var version = model.Info{Name: "ackbar", Version: "0.0.1"} func (a *Api) GetInfo(c *gin.Context) { c.IndentedJSON(http.StatusOK, version) diff --git a/internal/api/partition.go b/internal/api/partition.go index ec8f661..ea1acf6 100644 --- a/internal/api/partition.go +++ b/internal/api/partition.go @@ -5,15 +5,17 @@ import ( "log" "net/http" - "github.com/bespinian/lando/internal/model" + "github.com/bespinian/ackbar/internal/model" "github.com/gin-gonic/gin" "github.com/go-http-utils/headers" "github.com/google/uuid" ) -var PartitionsPath = fmt.Sprintf("%s/%s", ContextPath, "partitions") -var PartitionIdPlaceholder = ":partitionId" -var PartitionPath = fmt.Sprintf("%s/%s", PartitionsPath, PartitionIdPlaceholder) +var ( + PartitionsPath = fmt.Sprintf("%s/%s", ContextPath, "partitions") + PartitionIdPlaceholder = ":partitionId" + PartitionPath = fmt.Sprintf("%s/%s", PartitionsPath, PartitionIdPlaceholder) +) func (a *Api) GetPartitions(c *gin.Context) { contextId := c.Param("contextId") diff --git a/internal/backend/interface.go b/internal/backend/interface.go index 4710ab8..47e5559 100644 --- a/internal/backend/interface.go +++ b/internal/backend/interface.go @@ -1,7 +1,7 @@ package backend import ( - "github.com/bespinian/lando/internal/model" + "github.com/bespinian/ackbar/internal/model" "github.com/google/uuid" ) diff --git a/internal/backend/redis.go b/internal/backend/redis.go index abd4f39..6884b64 100644 --- a/internal/backend/redis.go +++ b/internal/backend/redis.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/bespinian/lando/internal/model" + "github.com/bespinian/ackbar/internal/model" "github.com/google/uuid" redis "github.com/redis/go-redis/v9" ) diff --git a/k8s/deploy-ackbar.yml b/k8s/deploy-ackbar.yml index 8695037..6c7c7d8 100644 --- a/k8s/deploy-ackbar.yml +++ b/k8s/deploy-ackbar.yml @@ -15,7 +15,7 @@ spec: spec: containers: - name: ackbar - image: bespinian/ackbar:0.0.3 + image: bespinian/ackbar:0.0.4 imagePullPolicy: Always ports: - containerPort: 8080 diff --git a/main.go b/main.go index d332e84..e33594e 100644 --- a/main.go +++ b/main.go @@ -4,8 +4,8 @@ import ( "log" "os" - apimodule "github.com/bespinian/lando/internal/api" - "github.com/bespinian/lando/internal/backend" + apimodule "github.com/bespinian/ackbar/internal/api" + "github.com/bespinian/ackbar/internal/backend" "github.com/gin-gonic/gin" )