Comments (4)
Hi,
I welcome all improvements or additional support for this package.
That said, looking at the documentation form your fork, the commands list is quite huge and do bloats the package.
Maybe it could be implemented using variadics (e.g. func (c *Command) Exec(name string, args ...interface{})
), then calling it like this:
c.Exec("CHANGE_CUSTOM_HOST_VAR", "host1.example.net", "foo", "bar")
c.Exec("DISABLE_HOST_EVENT_HANDLER", "host1.example.net")
c.Exec("ENABLE_PERFORMANCE_DATA")
WDYT?
from go-livestatus.
The original implantation looked a bit like that, buy I want a degree of
type safety.
Theres a raw interface buried in there. How about I leave that at the top
level and add a nagios subpackage with the noise in?
The awkward thing is that there's no response on COMMAND at all, so
having a type checked interface is a big win
On Sat, 25 Jun 2016, 18:53 Vincent Batoufflet, [email protected]
wrote:
Hi,
I welcome all improvements or additional support for this package.
That said, looking at the documentation form your fork, the commands list
is quite huge and do bloats the package.Maybe it could be implemented using variadics (e.g. func (c *Command)
Exec(name string, args ...interface{})), then calling it like this:c.Exec("CHANGE_CUSTOM_HOST_VAR", "host1.example.net", "foo", "bar")
c.Exec("DISABLE_HOST_EVENT_HANDLER", "host1.example.net")
c.Exec("ENABLE_PERFORMANCE_DATA")WDYT?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#4 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAEo8xnIAKSPw2MQY2abGxNJUSiodGM8ks5qPWsogaJpZM4I925_
.
from go-livestatus.
Sorry, autocomplete made a right mess of that! Hopefully you got the gist
of it.
On Sat, 25 Jun 2016, 19:31 Tristan Colgate, [email protected] wrote:
The original implantation looked a bit like that, buy I want a degree of
type safety.
Theres a raw interface buried in there. How about I leave that at the
top level and add a nagios subpackage with the noise in?
The awkward thing is that there's no response on COMMAND at all, so
having a type checked interface is a big winOn Sat, 25 Jun 2016, 18:53 Vincent Batoufflet, [email protected]
wrote:Hi,
I welcome all improvements or additional support for this package.
That said, looking at the documentation form your fork, the commands list
is quite huge and do bloats the package.Maybe it could be implemented using variadics (e.g. func (c *Command)
Exec(name string, args ...interface{})), then calling it like this:c.Exec("CHANGE_CUSTOM_HOST_VAR", "host1.example.net", "foo", "bar")
c.Exec("DISABLE_HOST_EVENT_HANDLER", "host1.example.net")
c.Exec("ENABLE_PERFORMANCE_DATA")WDYT?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#4 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAEo8xnIAKSPw2MQY2abGxNJUSiodGM8ks5qPWsogaJpZM4I925_
.
from go-livestatus.
@vbatoufflet I've moved the nagios specific stuff into a sub-package. I'm using a sort of functional option style, but that might be overkill. At present it should work something like
lv.Command().Op(nagios.AcknowledgeHostProblem(...))
lv.Exec()
which felt a bit more in keeping with the current style.Alternatively it could just be:
lv.Command()
nagios.AcknowledgeHostProblem(lv, ....)
lv.Exec()
But I don't think that reads as well.
I'll break up the current code into a 3 PRs and send them over (by the end of the week I hope)
from go-livestatus.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-livestatus.