Add namespace
This commit is contained in:
@@ -89,7 +89,7 @@ type Token struct {
|
||||
|
||||
const (
|
||||
// DefaultNamespace used for auth
|
||||
DefaultNamespace = "micro"
|
||||
DefaultNamespace = "go.micro"
|
||||
// NamespaceKey is the key used when storing the namespace in metadata
|
||||
NamespaceKey = "Micro-Namespace"
|
||||
// MetadataKey is the key used when storing the account in metadata
|
||||
|
@@ -8,6 +8,8 @@ import (
|
||||
)
|
||||
|
||||
type Options struct {
|
||||
// Namespace the service belongs to
|
||||
Namespace string
|
||||
// ID is the services auth ID
|
||||
ID string
|
||||
// Secret is used to authenticate the service
|
||||
@@ -28,6 +30,13 @@ type Options struct {
|
||||
|
||||
type Option func(o *Options)
|
||||
|
||||
// Namespace the service belongs to
|
||||
func Namespace(n string) Option {
|
||||
return func(o *Options) {
|
||||
o.Namespace = n
|
||||
}
|
||||
}
|
||||
|
||||
// Store to back auth
|
||||
func Store(s store.Store) Option {
|
||||
return func(o *Options) {
|
||||
|
Reference in New Issue
Block a user