feat: add tenant commands
This commit is contained in:
@@ -18,8 +18,8 @@ const (
|
||||
CtxKeyTx CtxKey = "__ctx_db:"
|
||||
// CtxKeyJwt is a CtxKey of type Jwt.
|
||||
CtxKeyJwt CtxKey = "__jwt_token:"
|
||||
// CtxKeySession is a CtxKey of type Session.
|
||||
CtxKeySession CtxKey = "__session_user:"
|
||||
// CtxKeyClaim is a CtxKey of type Claim.
|
||||
CtxKeyClaim CtxKey = "__jwt_claim:"
|
||||
)
|
||||
|
||||
var ErrInvalidCtxKey = fmt.Errorf("not a valid CtxKey, try [%s]", strings.Join(_CtxKeyNames, ", "))
|
||||
@@ -27,7 +27,7 @@ var ErrInvalidCtxKey = fmt.Errorf("not a valid CtxKey, try [%s]", strings.Join(_
|
||||
var _CtxKeyNames = []string{
|
||||
string(CtxKeyTx),
|
||||
string(CtxKeyJwt),
|
||||
string(CtxKeySession),
|
||||
string(CtxKeyClaim),
|
||||
}
|
||||
|
||||
// CtxKeyNames returns a list of possible string values of CtxKey.
|
||||
@@ -42,7 +42,7 @@ func CtxKeyValues() []CtxKey {
|
||||
return []CtxKey{
|
||||
CtxKeyTx,
|
||||
CtxKeyJwt,
|
||||
CtxKeySession,
|
||||
CtxKeyClaim,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,9 +59,9 @@ func (x CtxKey) IsValid() bool {
|
||||
}
|
||||
|
||||
var _CtxKeyValue = map[string]CtxKey{
|
||||
"__ctx_db:": CtxKeyTx,
|
||||
"__jwt_token:": CtxKeyJwt,
|
||||
"__session_user:": CtxKeySession,
|
||||
"__ctx_db:": CtxKeyTx,
|
||||
"__jwt_token:": CtxKeyJwt,
|
||||
"__jwt_claim:": CtxKeyClaim,
|
||||
}
|
||||
|
||||
// ParseCtxKey attempts to convert a string to a CtxKey.
|
||||
|
||||
Reference in New Issue
Block a user