Skip to content

Commit

Permalink
package name change and adding doc to pgutil
Browse files Browse the repository at this point in the history
  • Loading branch information
Deepak Kumar T P committed Oct 7, 2020
1 parent 143815f commit 19826a1
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
19 changes: 19 additions & 0 deletions internal/pgutil/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

// Package pgutil provides utilities to postgres related modules.
package pgutil
2 changes: 1 addition & 1 deletion internal/pgutils/parser.go → internal/pgutil/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

package pgutils
package pgutil

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
// specific language governing permissions and limitations
// under the License.

package pgutils_test
package pgutil_test

import (
"os"
"testing"

"github.com/stretchr/testify/assert"

apmpq "go.elastic.co/apm/internal/pgutils"
apmpq "go.elastic.co/apm/internal/pgutil"
"go.elastic.co/apm/module/apmsql"
)

Expand Down
4 changes: 2 additions & 2 deletions module/apmsql/pgxv4/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ package apmpgxv4
import (
"github.com/jackc/pgx/v4/stdlib"

"go.elastic.co/apm/internal/pgutils"
"go.elastic.co/apm/internal/pgutil"

"go.elastic.co/apm/module/apmsql"
)

func init() {
apmsql.Register("pgxv4", &stdlib.Driver{}, apmsql.WithDSNParser(pgutils.ParseDSN))
apmsql.Register("pgxv4", &stdlib.Driver{}, apmsql.WithDSNParser(pgutil.ParseDSN))
}
4 changes: 2 additions & 2 deletions module/apmsql/pq/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
package apmpq

import (
"go.elastic.co/apm/internal/pgutils"
"go.elastic.co/apm/internal/pgutil"
"go.elastic.co/apm/module/apmsql"
)

// ParseDSN is proxy to pgutils.ParseDSN to maintain api compatibility
func ParseDSN(name string) apmsql.DSNInfo {
return pgutils.ParseDSN(name)
return pgutil.ParseDSN(name)
}

0 comments on commit 19826a1

Please sign in to comment.