Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
fearful-symmetry committed Jul 17, 2024
1 parent 8ef9612 commit b3e6a8d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
8 changes: 4 additions & 4 deletions internal/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ import (
"github.com/elastic/go-sysinfo/types"
)

type HostOptsCreator = func(ProviderOptions) HostProvider
type ProcessOptsCreator = func(ProviderOptions) ProcessProvider
type (
HostOptsCreator = func(ProviderOptions) HostProvider
ProcessOptsCreator = func(ProviderOptions) ProcessProvider
)

// HostProvider defines interfaces that provide host-specific metrics
type HostProvider interface {
Expand Down Expand Up @@ -78,7 +80,6 @@ func Register(provider interface{}) {
}
processProvider = p
}

}

// GetHostProvider returns the HostProvider registered for the system. May return nil.
Expand All @@ -87,7 +88,6 @@ func GetHostProvider(opts ProviderOptions) HostProvider {
return hostProviderWithOpts(opts)
}
return hostProvider

}

// GetProcessProvider returns the ProcessProvider registered on the system. May return nil.
Expand Down
1 change: 0 additions & 1 deletion providers/linux/host_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ func init() {
// register wrappers that implement the HostFS versions of the ProcessProvider and HostProvider
registry.Register(func(opts registry.ProviderOptions) registry.HostProvider { return newLinuxSystem(opts.Hostfs) })
registry.Register(func(opts registry.ProviderOptions) registry.ProcessProvider { return newLinuxSystem(opts.Hostfs) })

}

type linuxSystem struct {
Expand Down
17 changes: 17 additions & 0 deletions providers/linux/machineid_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// 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 linux

import (
Expand Down

0 comments on commit b3e6a8d

Please sign in to comment.