Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ on:
- "**.md"

env:
GO_VERSION: "1.21.4" # https://go.dev/dl/
GOLANGCI_LINT_VERSION: "v1.55.2" # https://github.com/golangci/golangci-lint/releases
GO_VERSION: "1.22.5" # https://go.dev/dl/
GOLANGCI_LINT_VERSION: "v1.59.1" # https://github.com/golangci/golangci-lint/releases

jobs:
lint:
Expand Down
24 changes: 0 additions & 24 deletions ai/boilerplate/docker-compose.yml

This file was deleted.

7 changes: 0 additions & 7 deletions ai/boilerplate/goapp/.env

This file was deleted.

8 changes: 0 additions & 8 deletions ai/boilerplate/goapp/go.mod

This file was deleted.

4 changes: 0 additions & 4 deletions ai/boilerplate/goapp/go.sum

This file was deleted.

43 changes: 0 additions & 43 deletions ai/boilerplate/goapp/main.go

This file was deleted.

3 changes: 0 additions & 3 deletions ai/chats.json

This file was deleted.

59 changes: 0 additions & 59 deletions ai/readme.md

This file was deleted.

8 changes: 4 additions & 4 deletions ios/server/go.mod
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
module github.com/hearthands/challenges/ios/server

go 1.21.4
go 1.22.5

require (
github.com/go-chi/chi/v5 v5.0.10
github.com/go-chi/chi/v5 v5.1.0
github.com/go-chi/render v1.0.3
github.com/r3labs/sse/v2 v2.10.0
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
golang.org/x/exp v0.0.0-20240707233637-46b078467d37
)

require (
github.com/ajg/form v1.5.1 // indirect
golang.org/x/net v0.18.0 // indirect
golang.org/x/net v0.27.0 // indirect
gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect
)
15 changes: 6 additions & 9 deletions ios/server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU=
github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk=
github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw=
github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-chi/render v1.0.3 h1:AsXqd2a1/INaIfUSKq3G5uA8weYx20FOsM7uSoCyyt4=
github.com/go-chi/render v1.0.3/go.mod h1:/gr3hVkmYR0YlEy3LxCuVRFzEu9Ruok+gFqbIofjao0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand All @@ -14,14 +14,11 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
golang.org/x/net v0.0.0-20191116160921-f9c825593386 h1:ktbWvQrW08Txdxno1PiDpSxPXG6ndGsfnJjRRtkM0LQ=
golang.org/x/exp v0.0.0-20240707233637-46b078467d37 h1:uLDX+AfeFCct3a2C7uIWBKMJIR3CJMhcgfrUAqjRK6w=
golang.org/x/exp v0.0.0-20240707233637-46b078467d37/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
golang.org/x/net v0.0.0-20191116160921-f9c825593386/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg=
golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ=
golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/cenkalti/backoff.v1 v1.1.0 h1:Arh75ttbsvlpVA7WtVpH4u9h6Zl46xuptxqLxPiSo4Y=
Expand Down
20 changes: 15 additions & 5 deletions ios/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"math/rand"
"net"
"net/http"
"os"
"strconv"
Expand All @@ -21,9 +22,14 @@ import (
)

var (
hostname = envOrDefault("HTTP_HOST", "localhost") // hostname used by the server
port = envOrDefault("PORT", "3000") // port used by the server
limit = 100 // maximum number of entities returned in a single request
// hostname used by the server
hostname = envOrDefault("HTTP_HOST", "localhost")

// port used by the server
port = envOrDefault("PORT", "3000")

// maximum number of entities returned in a single request
limit = 100
)

//go:embed data.json
Expand All @@ -49,8 +55,12 @@ func main() {
r.Post("/chats/{chatID}/messages", app.PostMessages)
})

addr := fmt.Sprintf("%s:%s", hostname, port)
fmt.Printf("Starting server on %s\n", addr)
r.Get("/livez", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
}))

addr := net.JoinHostPort(hostname, port)
fmt.Printf("Starting server on http://%s\n", addr)
if err := http.ListenAndServe(addr, r); err != nil {
panic(fmt.Errorf("failed to start server on %s: %w", addr, err))
}
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Challenges [![ci status](https://github.com/hearthandsinc/challenges/actions/workflows/ci.yml/badge.svg)](https://github.com/hearthandsinc/challenges/actions/workflows/ci.yml)

This repository contains the [Heart Hands](https://hearthands.tech/) engineering
challenges for [iOS](./ios), [backend](./backend), and [AI](./aillm) positions.
challenges for [iOS](./ios) and [backend](./backend) positions.

## Feedbacks

Expand Down