Skip to content

Commit

Permalink
code reorg
Browse files Browse the repository at this point in the history
  • Loading branch information
thevilledev committed Oct 27, 2024
1 parent 02ac9f6 commit e09d58e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions gonsensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,6 @@ type Config struct {
NodeID string
}

type LockInfo struct {
Node string `json:"node"`
Timestamp time.Time `json:"timestamp"`
Expiry time.Time `json:"expiry"`
Term int64 `json:"term"`
Version string `json:"version"`
}

type Manager struct {
s3Client S3Client
bucket string
Expand Down Expand Up @@ -412,6 +404,14 @@ func (m *Manager) GetLockInfo(ctx context.Context) (*LockInfo, error) {
return &lockInfo, nil
}

type LockInfo struct {
Node string `json:"node"`
Timestamp time.Time `json:"timestamp"`
Expiry time.Time `json:"expiry"`
Term int64 `json:"term"`
Version string `json:"version"`
}

// IsExpired checks if a lock is expired.
func (l *LockInfo) IsExpired() bool {
return time.Now().After(l.Expiry)
Expand Down

0 comments on commit e09d58e

Please sign in to comment.