mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 19:04:35 +00:00
add the chat service (#381)
This commit is contained in:
@@ -10,6 +10,9 @@ import (
|
||||
|
||||
const (
|
||||
metaOwner = "apikey_owner"
|
||||
|
||||
// default tenant
|
||||
defaultId = "micro"
|
||||
)
|
||||
|
||||
// FromContext returns a tenant from the context
|
||||
@@ -62,3 +65,12 @@ func NewContext(id, issuer, owner string) context.Context {
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// Get the tenant and default where needed
|
||||
func Id(ctx context.Context) string {
|
||||
id, ok := FromContext(ctx)
|
||||
if !ok {
|
||||
return "micro"
|
||||
}
|
||||
return id
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user