File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 66 "errors"
77 "fmt"
88 "github.com/icinga/icinga-go-library/notifications/event"
9+ "github.com/icinga/icinga-go-library/notifications/rpc"
910 "github.com/icinga/icinga-go-library/types"
1011 "github.com/icinga/icinga-go-library/utils"
11- "github.com/icinga/icinga-notifications/pkg/rpc"
1212 "io"
1313 "log"
1414 "os"
Original file line number Diff line number Diff line change @@ -9,18 +9,21 @@ import (
99 "sync"
1010)
1111
12+ // Request is the internal JSON RPC request representation.
1213type Request struct {
1314 Method string `json:"method"`
1415 Params json.RawMessage `json:"params"`
1516 Id uint64 `json:"id"`
1617}
1718
19+ // Response is the internal JSON RPC response representation.
1820type Response struct {
1921 Result json.RawMessage `json:"result,omitempty"`
2022 Error string `json:"error,omitempty"`
2123 Id uint64 `json:"id"`
2224}
2325
26+ // Error is a custom error type, to be returned by RPC.Call.
2427type Error struct {
2528 cause error
2629}
@@ -33,6 +36,9 @@ func (err *Error) Unwrap() error {
3336 return err .cause
3437}
3538
39+ // RPC is a JSON RPC client.
40+ //
41+ // It is either used internally in Icinga Notifications or within the plugin.RunPlugin method.
3642type RPC struct {
3743 writer io.Closer // use encoder for writing instead
3844 encoder * json.Encoder
You can’t perform that action at this time.
0 commit comments