Skip to content

Commit

Permalink
feat: add raft implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
zjregee committed Sep 11, 2024
1 parent 3ab607d commit 3531c7b
Show file tree
Hide file tree
Showing 13 changed files with 1,868 additions and 25 deletions.
8 changes: 8 additions & 0 deletions build_proto.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

protoc --go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
proto/raft.proto

go mod tidy
./format_check.sh
7 changes: 7 additions & 0 deletions common/assert.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package common

func Assert(condition bool, msg string) {
if !condition {
panic(msg)
}
}
8 changes: 4 additions & 4 deletions common/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ func (f *customFormatter) Format(entry *logrus.Entry) ([]byte, error) {
return f.Formatter.Format(entry)
}

var log *logrus.Logger
var Log *logrus.Logger

func init() {
log = logrus.New()
log.SetFormatter(newCustomFormatter())
log.SetLevel(ENABLE_LOG_LEVEL)
Log = logrus.New()
Log.SetFormatter(newCustomFormatter())
Log.SetLevel(ENABLE_LOG_LEVEL)
}
18 changes: 0 additions & 18 deletions common/utils.go

This file was deleted.

Loading

0 comments on commit 3531c7b

Please sign in to comment.