Skip to content

Commit 8d406ff

Browse files
authored
Rename http client package (#371)
* Rename http client package The old package http produced a conflict with net/http from std library Signed-off-by: Örnfeldt Philip (66140321) <philip.ornfeldt@forsakringskassan.se> * Added removal off archived status in readme Signed-off-by: Örnfeldt Philip (66140321) <philip.ornfeldt@forsakringskassan.se> * Merge main and update system_ha_peer.go Signed-off-by: Örnfeldt Philip (66140321) <philip.ornfeldt@forsakringskassan.se> --------- Signed-off-by: Örnfeldt Philip (66140321) <philip.ornfeldt@forsakringskassan.se>
1 parent 8ffe94e commit 8d406ff

45 files changed

Lines changed: 95 additions & 94 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

fortigate_exporter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import (
4242
"github.com/prometheus/client_golang/prometheus/promhttp"
4343

4444
"github.com/prometheus-community/fortigate_exporter/internal/config"
45-
fortiHTTP "github.com/prometheus-community/fortigate_exporter/pkg/http"
45+
fortiHTTP "github.com/prometheus-community/fortigate_exporter/pkg/fortigatehttpclient"
4646
"github.com/prometheus-community/fortigate_exporter/pkg/probe"
4747
)
4848

pkg/http/forti_token_client.go renamed to pkg/fortigatehttpclient/forti_token_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
// You should have received a copy of the GNU General Public License
2929
// along with this program. If not, see <http://www.gnu.org/licenses/>.
3030

31-
package http
31+
package fortigatehttpclient
3232

3333
import (
3434
"context"

pkg/http/forti_token_client_test.go renamed to pkg/fortigatehttpclient/forti_token_client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
// You should have received a copy of the GNU General Public License
2929
// along with this program. If not, see <http://www.gnu.org/licenses/>.
3030

31-
package http
31+
package fortigatehttpclient
3232

3333
import (
3434
"context"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// See the License for the specific language governing permissions and
1212
// limitations under the License.
1313

14-
package http
14+
package fortigatehttpclient
1515

1616
import (
1717
"context"

pkg/probe/bgp_neighbor_routes.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"github.com/prometheus/client_golang/prometheus"
2121

2222
"github.com/prometheus-community/fortigate_exporter/internal/config"
23-
"github.com/prometheus-community/fortigate_exporter/pkg/http"
23+
"github.com/prometheus-community/fortigate_exporter/pkg/fortigatehttpclient"
2424
)
2525

2626
type BGPPath struct {
@@ -39,7 +39,7 @@ type PathCount struct {
3939
VDOM string
4040
}
4141

42-
func probeBGPNeighborPathsIPv4(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus.Metric, bool) {
42+
func probeBGPNeighborPathsIPv4(c fortigatehttpclient.FortiHTTP, meta *TargetMetadata) ([]prometheus.Metric, bool) {
4343
savedConfig := config.GetConfig()
4444
MaxBGPPaths := savedConfig.MaxBGPPaths
4545

@@ -107,7 +107,7 @@ func probeBGPNeighborPathsIPv4(c http.FortiHTTP, meta *TargetMetadata) ([]promet
107107
return m, true
108108
}
109109

110-
func probeBGPNeighborPathsIPv6(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus.Metric, bool) {
110+
func probeBGPNeighborPathsIPv6(c fortigatehttpclient.FortiHTTP, meta *TargetMetadata) ([]prometheus.Metric, bool) {
111111
savedConfig := config.GetConfig()
112112
MaxBGPPaths := savedConfig.MaxBGPPaths
113113

pkg/probe/bgp_neighbors.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919

2020
"github.com/prometheus/client_golang/prometheus"
2121

22-
"github.com/prometheus-community/fortigate_exporter/pkg/http"
22+
"github.com/prometheus-community/fortigate_exporter/pkg/fortigatehttpclient"
2323
)
2424

2525
type BGPNeighbor7_4 struct {
@@ -36,7 +36,7 @@ type BGPNeighborResponse7_4 struct {
3636
Version string `json:"version"`
3737
}
3838

39-
func probeBGPNeighborsIPv47_4(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus.Metric, bool) {
39+
func probeBGPNeighborsIPv47_4(c fortigatehttpclient.FortiHTTP, meta *TargetMetadata) ([]prometheus.Metric, bool) {
4040
if meta.VersionMajor < 7 {
4141
// not supported version. Before 7.0.0 the requested endpoint doesn't exist
4242
return nil, true
@@ -65,7 +65,7 @@ func probeBGPNeighborsIPv47_4(c http.FortiHTTP, meta *TargetMetadata) ([]prometh
6565
return m, true
6666
}
6767

68-
func probeBGPNeighborsIPv67_4(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus.Metric, bool) {
68+
func probeBGPNeighborsIPv67_4(c fortigatehttpclient.FortiHTTP, meta *TargetMetadata) ([]prometheus.Metric, bool) {
6969
if meta.VersionMajor < 7 {
7070
// not supported version. Before 7.0.0 the requested endpoint doesn't exist
7171
return nil, true
@@ -128,7 +128,7 @@ type BGPNeighborResponse struct {
128128
Version string `json:"version"`
129129
}
130130

131-
func probeBGPNeighborsIPv4(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus.Metric, bool) {
131+
func probeBGPNeighborsIPv4(c fortigatehttpclient.FortiHTTP, meta *TargetMetadata) ([]prometheus.Metric, bool) {
132132
if meta.VersionMajor == 7 && meta.VersionMinor < 6 {
133133
return probeBGPNeighborsIPv47_4(c, meta)
134134
}
@@ -179,7 +179,7 @@ func probeBGPNeighborsIPv4(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus
179179
return m, true
180180
}
181181

182-
func probeBGPNeighborsIPv6(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus.Metric, bool) {
182+
func probeBGPNeighborsIPv6(c fortigatehttpclient.FortiHTTP, meta *TargetMetadata) ([]prometheus.Metric, bool) {
183183
if meta.VersionMajor == 7 && meta.VersionMinor < 6 {
184184
return probeBGPNeighborsIPv67_4(c, meta)
185185
}

pkg/probe/firewall_ippool.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818

1919
"github.com/prometheus/client_golang/prometheus"
2020

21-
"github.com/prometheus-community/fortigate_exporter/pkg/http"
21+
"github.com/prometheus-community/fortigate_exporter/pkg/fortigatehttpclient"
2222
)
2323

2424
type IPPool struct {
@@ -38,7 +38,7 @@ type IPPoolResponse struct {
3838
Version string `json:"version"`
3939
}
4040

41-
func probeFirewallIPPool(c http.FortiHTTP, _ *TargetMetadata) ([]prometheus.Metric, bool) {
41+
func probeFirewallIPPool(c fortigatehttpclient.FortiHTTP, _ *TargetMetadata) ([]prometheus.Metric, bool) {
4242
mAvailable := prometheus.NewDesc(
4343
"fortigate_ippool_available_ratio",
4444
"Percentage available in ippool (0 - 1.0)",

pkg/probe/firewall_load_balance.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ import (
2020

2121
"github.com/prometheus/client_golang/prometheus"
2222

23-
"github.com/prometheus-community/fortigate_exporter/pkg/http"
23+
"github.com/prometheus-community/fortigate_exporter/pkg/fortigatehttpclient"
2424
)
2525

26-
func probeFirewallLoadBalance(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus.Metric, bool) {
26+
func probeFirewallLoadBalance(c fortigatehttpclient.FortiHTTP, meta *TargetMetadata) ([]prometheus.Metric, bool) {
2727
if meta.VersionMajor < 6 || (meta.VersionMajor == 6 && meta.VersionMinor < 4) {
2828
// not supported version. Before 6.4.0 there is no real_server_id and therefore this will fail
2929
return nil, true

pkg/probe/firewall_policy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ import (
2020
"github.com/prometheus/client_golang/prometheus"
2121

2222
"github.com/prometheus-community/fortigate_exporter/internal/version"
23-
"github.com/prometheus-community/fortigate_exporter/pkg/http"
23+
"github.com/prometheus-community/fortigate_exporter/pkg/fortigatehttpclient"
2424
)
2525

26-
func probeFirewallPolicies(c http.FortiHTTP, _ *TargetMetadata) ([]prometheus.Metric, bool) {
26+
func probeFirewallPolicies(c fortigatehttpclient.FortiHTTP, _ *TargetMetadata) ([]prometheus.Metric, bool) {
2727
var (
2828
mHitCount = prometheus.NewDesc(
2929
"fortigate_policy_hit_count_total",

pkg/probe/license_status.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ import (
1818

1919
"github.com/prometheus/client_golang/prometheus"
2020

21-
"github.com/prometheus-community/fortigate_exporter/pkg/http"
21+
"github.com/prometheus-community/fortigate_exporter/pkg/fortigatehttpclient"
2222
)
2323

24-
func probeLicenseStatus(c http.FortiHTTP, _ *TargetMetadata) ([]prometheus.Metric, bool) {
24+
func probeLicenseStatus(c fortigatehttpclient.FortiHTTP, _ *TargetMetadata) ([]prometheus.Metric, bool) {
2525
var (
2626
vdomUsed = prometheus.NewDesc(
2727
"fortigate_license_vdom_usage",

0 commit comments

Comments
 (0)