-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Want to adjust how this is orchestrated but right now I see data going into both files
- Loading branch information
Showing
12 changed files
with
209 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
package client | ||
|
||
import "distributed/pkg/storage" | ||
import ( | ||
"distributed/pkg/server/storage" | ||
) | ||
|
||
type Operation int | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,25 @@ | ||
package networking | ||
|
||
import ( | ||
"distributed/pkg" | ||
"fmt" | ||
) | ||
|
||
const Unix = "unix" | ||
const Port = 8907 | ||
const SocketPath = "/tmp/distkv.sock" | ||
|
||
const ( | ||
primarySocketPath = "/tmp/distkv.sock" | ||
replicaSocketPath = "/tmp/distkv-replica.sock" | ||
) | ||
|
||
func SocketPath(role pkg.Role) (string, error) { | ||
switch role { | ||
case pkg.RolePrimary: | ||
return primarySocketPath, nil | ||
case pkg.RoleReplica: | ||
return replicaSocketPath, nil | ||
default: | ||
return "", fmt.Errorf("unrecognized Role %v", role) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package pkg | ||
|
||
// Role is a first pass at making the main functions dumber, might be better located somewhere else, and might break | ||
// down once there are many replicas etc. | ||
type Role int | ||
|
||
const ( | ||
RolePrimary = iota + 1 | ||
RoleReplica | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
Oops, something went wrong.