Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gmgigi96 committed Nov 1, 2021
1 parent 11fa21f commit f2edb06
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/ctx/agentctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"google.golang.org/grpc/metadata"
)

// UserAgentHeader is the header used for the user agent
const UserAgentHeader = "x-user-agent"

// ContextGetUserAgent returns the user agent if set in the given context.
Expand Down
2 changes: 2 additions & 0 deletions pkg/useragent/useragent.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ func isGRPC(ua *ua.UserAgent) bool {
return strings.HasPrefix(ua.Name, "grpc")
}

// GetCategory returns the category of the user agent
// (i.e. if it is a web, mobile, desktop or grpc user agent)
func GetCategory(ua *ua.UserAgent) string {
switch {
case isWeb(ua):
Expand Down

0 comments on commit f2edb06

Please sign in to comment.