add the chat service (#381)

This commit is contained in:
Asim Aslam
2022-02-17 16:33:10 +00:00
committed by GitHub
parent 718466a4a1
commit c49ee7e8b1
13 changed files with 2846 additions and 23 deletions

View File

@@ -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
}