-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move etcd RouteLoader into separate package
- Loading branch information
Showing
5 changed files
with
88 additions
and
86 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package etcd | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/gojektech/weaver/internal/server" | ||
) | ||
|
||
const ( | ||
// ACLKeyFormat - Format for a ACL's key in a KV Store | ||
ACLKeyFormat = "/%s/acls/%s/acl" | ||
) | ||
|
||
// ACLKey - Points to a stored ACL | ||
type ACLKey string | ||
|
||
// GenACLKey - Generate an ACL Key given etcd's node key | ||
func GenACLKey(key string) ACLKey { | ||
return ACLKey(fmt.Sprintf("%s/acl", key)) | ||
} | ||
|
||
func GenKey(acl *server.ACL, pfx string) ACLKey { | ||
return ACLKey(fmt.Sprintf(ACLKeyFormat, pfx, acl.ID)) | ||
} |
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