# README
Request Info
Request Info contains following information about the request:
ApplicationName string
ResourceType string
ResourceId string
OperationType int //Constant
This package provide annotator witch extracts information from request and return it as metadata.
Adding support for Request Info
You can enable support for Request Info in your gRPC-Server by adding the annotator to the middleware chain.
import (
...
...
"github.com/infobloxopen/atlas-app-toolkit/requestinfo"
)
func main() {
server := grpc.NewServer(
grpc.UnaryInterceptor(
runtime.WithMetadata(requestinfo.MetadataAnnotator)
)
...
}
Extracting the Request Info
Once the middleware is included, the function below can be used to extract the Request Info anywhere it is needed.
requestInfo, err := requestinfo.FromContext(ctx)
The err
represent error if something went wrong.
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
# Type aliases
No description provided by the author