-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add metadata or header ? #51
Comments
Hi @awalterschulze , I read the In my way, I will prefer to add an additional field(say as contextString := req.FormValue("context")
contextStringMap := make(map[string]string)
if len(contextString) > 0 {
err := encoding_json.Unmarshal([]byte(contextString), &contextStringMap)
if err != nil {
if err != io.EOF {
w.Write([]byte("<div class=\"alert alert-danger\" role=\"alert\">" + err.Error() + "</div>"))
return
}
w.Write([]byte("<div class=\"alert alert-danger\" role=\"alert\">" + err.Error() + "</div>"))
}
}
w.Write([]byte(FormClient_RPCXXXXXX))
if !someValue {
w.Write([]byte(Footer))
return
}
for metaKey, metaValue := range contextStringMap {
// do some meta match here
} |
I haven’t used grpc in a few years, so I fear I am missing some context ;)
sorry that is a bad joke, but I am struggling to know which problem you are
trying to solve
…On Thu, 20 Dec 2018 at 08:47, scnace ***@***.***> wrote:
Hi @awalterschulze <https://github.com/awalterschulze> , I read the
CreateCustom in form.go,and still have some questions. When we setup
context metadata/header in grpc context , we will not define these kind of
fields explicitly.
In my way, I will prefer to add an additional field(say as context),this
field name and value is also customized, the fake code will look like this:
contextString := req.FormValue("context")
contextStringMap := make(map[string]string)
if len(contextString) > 0 {
err := encoding_json.Unmarshal([]byte(contextString), &contextStringMap)
if err != nil {
if err != io.EOF {
w.Write([]byte("<div class=\"alert alert-danger\" role=\"alert\">" + err.Error() + "</div>"))
return
}
w.Write([]byte("<div class=\"alert alert-danger\" role=\"alert\">" + err.Error() + "</div>"))
}
}
w.Write([]byte(FormClient_RPCXXXXXX))
if !someValue {
w.Write([]byte(Footer))
return
}
for metaKey, metaValue := range contextStringMap {
// do some meta match here
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#51 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABvsLV0k2--CRVB8OX4E6RaZgHm6M7J7ks5u6zKJgaJpZM4Waya4>
.
|
Haha , you can check the grpc-go's oauth example for the grpc context metadata. |
What do you want to do with context in letmegrpc?
…On Fri, 21 Dec 2018 at 04:57, scnace ***@***.***> wrote:
Haha , you can check the grpc-go's oauth example
<https://github.com/grpc/grpc-go/blob/master/examples/oauth/server/main.go#L96>
for the grpc context metadata.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#51 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABvsLaBcFlRsx1jw7IgxyaruMMjpKrl3ks5u7E4MgaJpZM4Waya4>
.
|
we will use this kind of data for auth and trace and other middleware operations |
So do you want to print it out as a response or read in as input or
programmatically provide it?
…On Fri, 21 Dec 2018 at 13:41, scnace ***@***.***> wrote:
we will use this kind of data for auth and trace and other middleware
operations
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#51 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABvsLftKYJMdSoSTeKCJFjzO5iZvnYOjks5u7Mj5gaJpZM4Waya4>
.
|
Read it as input |
Aha ok so you want another map from string to x at the top of the web form?
…On Sat, 22 Dec 2018 at 17:45, scnace ***@***.***> wrote:
Read it as input
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#51 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABvsLYIgw9nL8iEAnnGkv1hyUypvryR0ks5u7lOqgaJpZM4Waya4>
.
|
yep, so I fork another letmegrpc to our private repo, and will do some special edition XD |
Hmmm yeah or you show me how you make it work and contend to take over
letmegrpc :) ?
…On Sat, 22 Dec 2018 at 21:02, scnace ***@***.***> wrote:
yep, so I fork another letmegrpc to our private repo, and will do some
special edition XD
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#51 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABvsLSU8Q4iQtTwI4buT_5__S6QeaKFDks5u7oGngaJpZM4Waya4>
.
|
aha still WIP |
No description provided.
The text was updated successfully, but these errors were encountered: