Skip to content
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

client: Remove dependency to versionx #61

Merged
merged 1 commit into from
Mar 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pkg/client/v1/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"path"
"strings"

"go.infratographer.com/x/versionx"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
Expand All @@ -20,6 +19,7 @@ import (
var (
tracer = otel.Tracer("go.infratographer.com/permissions-api/pkg/permissions/v1")

appName = "permissions-api"
apiVersion = "/api/v1"
)

Expand Down Expand Up @@ -101,8 +101,11 @@ func newGetRequest(ctx context.Context, uri, endpoint string) (*http.Request, er
return http.NewRequestWithContext(ctx, http.MethodGet, u.String(), nil)
}

// userAgentString returns a string that identifies this client to the server
// TODO: This should be a constant, but we need to figure out how to get the version
// of the package at compile time
func userAgentString() string {
return fmt.Sprintf("%s (%s)", versionx.BuildDetails().AppName, versionx.BuildDetails().Version)
return fmt.Sprintf("%s (%s)", appName, apiVersion)
}

func (c Client) do(req *http.Request, result interface{}) error {
Expand Down