Coder Social home page Coder Social logo

A bunch of changes about go-livestatus HOT 4 CLOSED

tcolgate avatar tcolgate commented on July 2, 2024
A bunch of changes

from go-livestatus.

Comments (4)

vbatoufflet avatar vbatoufflet commented on July 2, 2024

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.

tcolgate avatar tcolgate commented on July 2, 2024

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.

tcolgate avatar tcolgate commented on July 2, 2024

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 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.

tcolgate avatar tcolgate commented on July 2, 2024

@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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.