Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Commit

Permalink
bump dependencies;
Browse files Browse the repository at this point in the history
minor changes
  • Loading branch information
mkabilov committed Apr 16, 2019
1 parent dbc255a commit 8d5c3d2
Show file tree
Hide file tree
Showing 89 changed files with 6,935 additions and 3,459 deletions.
42 changes: 19 additions & 23 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@

[[constraint]]
name = "github.com/jackc/pgx"
branch = "master"
version = "3.3.0"

[[constraint]]
name = "github.com/prometheus/client_golang"
version = "0.8.0"
version = "0.9.2"

[[constraint]]
name = "gopkg.in/yaml.v2"
Expand Down
24 changes: 14 additions & 10 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ var (
}
)

// ConfigInterface describes Config methods
type ConfigInterface interface {
// Interface describes Config methods
type Interface interface {
Load() error
DbList() []string
Db(string) DbConfig
Expand Down Expand Up @@ -113,7 +113,10 @@ func (v *VerSQLs) UnmarshalYAML(unmarshal func(interface{}) error) error {
// UnmarshalYAML unmarshals the yaml
func (c *ColumnUsage) UnmarshalYAML(unmarshal func(interface{}) error) error {
var value string
unmarshal(&value)
if err := unmarshal(&value); err != nil {
return err
}

cu, ok := columnUsageMapping[value]
if !ok {
return fmt.Errorf("unknown usage: %v", value)
Expand Down Expand Up @@ -182,28 +185,29 @@ func (v VerSQLs) Query(version PgVersion) string {
}

func ParseVersion(str string) PgVersion {
var res = int(NoVersion)
matches := pgVerRegex.FindStringSubmatch(str)
if matches == nil {
return PgVersion(res)
return NoVersion
}

ver := 0
if matches[1] != "" {
val, _ := strconv.Atoi(matches[1])
res = val * 10000
ver = val * 10000
if val > 9 && matches[2] != "" {
val, _ := strconv.Atoi(matches[2])
res += val
ver += val
} else if matches[2] != "" {
val, _ := strconv.Atoi(matches[2])
res += val * 100
ver += val * 100
if matches[3] != "" {
val, _ := strconv.Atoi(matches[3])
res += val
ver += val
}
}
}

return PgVersion(res)
return PgVersion(ver)
}

func parseVersionRange(str string) (PgVersion, PgVersion) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/pgcollector/pgcollector.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var internalMetricsDescriptions = map[string]string{
// PgCollector describes PostgreSQL metrics collector
type PgCollector struct {
sync.Mutex
config config.ConfigInterface
config config.Interface
timeOuts uint32
errors uint32
}
Expand Down
3 changes: 0 additions & 3 deletions vendor/github.com/golang/protobuf/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion vendor/github.com/golang/protobuf/proto/decode.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 63 additions & 0 deletions vendor/github.com/golang/protobuf/proto/deprecated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 0 additions & 18 deletions vendor/github.com/golang/protobuf/proto/encode.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion vendor/github.com/golang/protobuf/proto/equal.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8d5c3d2

Please sign in to comment.