Skip to content

Commit

Permalink
Rename fetchserver to hubserver, and add teamserver placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
ryapric committed Jan 6, 2025
1 parent 3080ae3 commit db54ede
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package fetchserver implements server-side and template-rendering logic for
// the score fetcher service
package fetchserver
// Package hubserver implements server-side and template-rendering logic for
// the Hub server's score retrieval & display services
package hubserver

import (
"bytes"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package fetchserver
package hubserver

import (
"reflect"
Expand Down
3 changes: 3 additions & 0 deletions score-server/internal/team-server/serve.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Package teamserver implements score-serving functionality on each workshop
// team's server, which is retrieved by the Hub server
package teamserver
1 change: 1 addition & 0 deletions score-server/internal/team-server/serve_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package teamserver
4 changes: 2 additions & 2 deletions score-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"net"
"net/http"

fetchserver "github.com/opensourcecorp/workshops/linux/score-server/internal/fetch-server"
hubserver "github.com/opensourcecorp/workshops/linux/score-server/internal/hub-server"
"github.com/sirupsen/logrus"
)

func main() {
http.HandleFunc("/", fetchserver.Root)
http.HandleFunc("/", hubserver.Root)

addr := net.JoinHostPort("0.0.0.0", "8080")
logrus.Infof("Starting server on %s\n", addr)
Expand Down
7 changes: 5 additions & 2 deletions scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ if [[ "$(</tmp/go-modules wc -l)" -gt 0 ]] ; then
printf '> Installing CI checks for Go...\n'
for pkg in \
honnef.co/go/tools/cmd/staticcheck@latest \
github.com/mgechev/revive@latest \
github.com/kisielk/errcheck@latest \
; do
go install "${pkg}"
Expand All @@ -39,9 +40,11 @@ while read -r module ; do
cd "${mod_dir}"
printf '>> Running go vet...\n'
go vet ./...
printf '>> Running linter...\n'
printf '>> Running staticcheck linter...\n'
staticcheck ./...
printf '>> Running error checker...\n'
printf '>> Running revive linter...\n'
revive --set_exit_status ./...
printf '>> Running error-checker...\n'
errcheck ./...
)
done < /tmp/go-modules
Expand Down

0 comments on commit db54ede

Please sign in to comment.