Skip to content

Use generics, instead of big.Float and big.ParseFloat#1

Open
dsh2dsh wants to merge 15 commits intoinexio:masterfrom
dsh2dsh:v2-upstream
Open

Use generics, instead of big.Float and big.ParseFloat#1
dsh2dsh wants to merge 15 commits intoinexio:masterfrom
dsh2dsh:v2-upstream

Conversation

@dsh2dsh
Copy link
Copy Markdown

@dsh2dsh dsh2dsh commented Mar 14, 2024

Bump module name to v2, because it has incompatible changes.

Args of NewThresholds() must be type of cmp.Ordered and it can't be nil.

Two new methods added to Thresholds type:

UseWarning(useMin, useMax bool)
UseCritical(useMin, useMax bool)

useMin defines is WarningMin or CriticalMin defined or not. useMax does the same for WarningMax or CriticalMax. So instead of calling NewThresholds() with nils, now we should use UseWarning() and/or UseCritical().

dsh2dsh added 15 commits March 13, 2024 16:14
Bump module name to `v2`, because it has incompatible changes.

Args of `NewThresholds()` must be type of `cmp.Ordered` and it can't be `nil`.

Two new methods added to `Thresholds` type:

```
UseWarning(useMin, useMax bool)
UseCritical(useMin, useMax bool)
```

`useMin` defines is `WarningMin` or `CriticalMin` defined or not. `useMax` does
the same for `WarningMax` or `CriticalMax`. So instead of calling
`NewThresholds()` with `nil`s, now we should use `UseWarning()` and/or
`UseCritical()`.
There is no `SetWarn()` and `SetCrit()` methods. We use `SetThresholds()` and
`NewThresholds()` instead.
because it automatically uses same type as Value.
which allows replace the default OK message at any time later.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant