diff options
Diffstat (limited to 'srv/src/cmd')
-rw-r--r-- | srv/src/cmd/mediocre-blog/main.go | 23 | ||||
-rw-r--r-- | srv/src/cmd/userid-calc-cli/main.go | 28 |
2 files changed, 0 insertions, 51 deletions
diff --git a/srv/src/cmd/mediocre-blog/main.go b/srv/src/cmd/mediocre-blog/main.go index 694dd3f..4f8ba78 100644 --- a/srv/src/cmd/mediocre-blog/main.go +++ b/srv/src/cmd/mediocre-blog/main.go @@ -8,7 +8,6 @@ import ( "time" cfgpkg "github.com/mediocregopher/blog.mediocregopher.com/srv/cfg" - "github.com/mediocregopher/blog.mediocregopher.com/srv/chat" "github.com/mediocregopher/blog.mediocregopher.com/srv/http" "github.com/mediocregopher/blog.mediocregopher.com/srv/mailinglist" "github.com/mediocregopher/blog.mediocregopher.com/srv/post" @@ -50,9 +49,6 @@ func main() { defer radixClient.Close() ctx = mctx.WithAnnotator(ctx, &radixClient) - chatGlobalRoomMaxMsgs := cfg.Int("chat-global-room-max-messages", 1000, "Maximum number of messages the global chat room can retain") - chatUserIDCalcSecret := cfg.String("chat-user-id-calc-secret", "", "Secret to use when calculating user ids") - // initialization err := cfg.Init(ctx) @@ -66,10 +62,6 @@ func main() { logger.Fatal(ctx, "initializing", err) } - ctx = mctx.Annotate(ctx, - "chatGlobalRoomMaxMsgs", *chatGlobalRoomMaxMsgs, - ) - clock := clock.Realtime() powStore := pow.NewMemoryStore(clock) @@ -100,19 +92,6 @@ func main() { ml := mailinglist.New(mlParams) - chatGlobalRoom, err := chat.NewRoom(ctx, chat.RoomParams{ - Logger: logger.WithNamespace("global-chat-room"), - Redis: radixClient.Client, - ID: "global", - MaxMessages: *chatGlobalRoomMaxMsgs, - }) - if err != nil { - logger.Fatal(ctx, "initializing global chat room", err) - } - defer chatGlobalRoom.Close() - - chatUserIDCalc := chat.NewUserIDCalculator([]byte(*chatUserIDCalcSecret)) - postSQLDB, err := post.NewSQLDB(dataDir) if err != nil { logger.Fatal(ctx, "initializing sql db for post data", err) @@ -129,8 +108,6 @@ func main() { httpParams.PostAssetStore = postAssetStore httpParams.PostDraftStore = postDraftStore httpParams.MailingList = ml - httpParams.GlobalRoom = chatGlobalRoom - httpParams.UserIDCalculator = chatUserIDCalc logger.Info(ctx, "listening") httpAPI, err := http.New(httpParams) diff --git a/srv/src/cmd/userid-calc-cli/main.go b/srv/src/cmd/userid-calc-cli/main.go deleted file mode 100644 index 90c44e7..0000000 --- a/srv/src/cmd/userid-calc-cli/main.go +++ /dev/null @@ -1,28 +0,0 @@ -package main - -import ( - "encoding/json" - "flag" - "fmt" - - "github.com/mediocregopher/blog.mediocregopher.com/srv/chat" -) - -func main() { - - secret := flag.String("secret", "", "Secret to use when calculating UserIDs") - name := flag.String("name", "", "") - password := flag.String("password", "", "") - - flag.Parse() - - calc := chat.NewUserIDCalculator([]byte(*secret)) - userID := calc.Calculate(*name, *password) - - b, err := json.Marshal(userID) - if err != nil { - panic(err) - } - - fmt.Println(string(b)) -} |