Documentation ¶
Overview ¶
Package rpc defines extension points for Sensu that can be used by third parties to extend Sensu.
More information can be found in the Extensions proposal and design document.
https://github.com/sensu/proposal/blob/master/design/1043-extensions.md
Index ¶
- Constants
- func RegisterExtensionServer(s *grpc.Server, srv ExtensionServer)
- type ExtensionClient
- type ExtensionExecutor
- type ExtensionServer
- type FilterEventRequest
- func (*FilterEventRequest) Descriptor() ([]byte, []int)
- func (m *FilterEventRequest) GetEvent() *types.Event
- func (*FilterEventRequest) ProtoMessage()
- func (m *FilterEventRequest) Reset()
- func (m *FilterEventRequest) String() string
- func (m *FilterEventRequest) XXX_DiscardUnknown()
- func (m *FilterEventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *FilterEventRequest) XXX_Merge(src proto.Message)
- func (m *FilterEventRequest) XXX_Size() int
- func (m *FilterEventRequest) XXX_Unmarshal(b []byte) error
- type FilterEventResponse
- func (*FilterEventResponse) Descriptor() ([]byte, []int)
- func (m *FilterEventResponse) GetError() string
- func (m *FilterEventResponse) GetFiltered() bool
- func (*FilterEventResponse) ProtoMessage()
- func (m *FilterEventResponse) Reset()
- func (m *FilterEventResponse) String() string
- func (m *FilterEventResponse) XXX_DiscardUnknown()
- func (m *FilterEventResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *FilterEventResponse) XXX_Merge(src proto.Message)
- func (m *FilterEventResponse) XXX_Size() int
- func (m *FilterEventResponse) XXX_Unmarshal(b []byte) error
- type GRPCExtensionExecutor
- func (e *GRPCExtensionExecutor) Close() error
- func (e *GRPCExtensionExecutor) FilterEvent(evt *types.Event) (bool, error)
- func (e *GRPCExtensionExecutor) HandleEvent(evt *types.Event, mutatedEvt []byte) (HandleEventResponse, error)
- func (e *GRPCExtensionExecutor) MutateEvent(evt *types.Event) ([]byte, error)
- type HandleEventRequest
- func (*HandleEventRequest) Descriptor() ([]byte, []int)
- func (m *HandleEventRequest) GetEvent() *types.Event
- func (m *HandleEventRequest) GetMutatedEvent() []byte
- func (*HandleEventRequest) ProtoMessage()
- func (m *HandleEventRequest) Reset()
- func (m *HandleEventRequest) String() string
- func (m *HandleEventRequest) XXX_DiscardUnknown()
- func (m *HandleEventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *HandleEventRequest) XXX_Merge(src proto.Message)
- func (m *HandleEventRequest) XXX_Size() int
- func (m *HandleEventRequest) XXX_Unmarshal(b []byte) error
- type HandleEventResponse
- func (*HandleEventResponse) Descriptor() ([]byte, []int)
- func (m *HandleEventResponse) GetError() string
- func (m *HandleEventResponse) GetOutput() string
- func (*HandleEventResponse) ProtoMessage()
- func (m *HandleEventResponse) Reset()
- func (m *HandleEventResponse) String() string
- func (m *HandleEventResponse) XXX_DiscardUnknown()
- func (m *HandleEventResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *HandleEventResponse) XXX_Merge(src proto.Message)
- func (m *HandleEventResponse) XXX_Size() int
- func (m *HandleEventResponse) XXX_Unmarshal(b []byte) error
- type MutateEventRequest
- func (*MutateEventRequest) Descriptor() ([]byte, []int)
- func (m *MutateEventRequest) GetEvent() *types.Event
- func (*MutateEventRequest) ProtoMessage()
- func (m *MutateEventRequest) Reset()
- func (m *MutateEventRequest) String() string
- func (m *MutateEventRequest) XXX_DiscardUnknown()
- func (m *MutateEventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *MutateEventRequest) XXX_Merge(src proto.Message)
- func (m *MutateEventRequest) XXX_Size() int
- func (m *MutateEventRequest) XXX_Unmarshal(b []byte) error
- type MutateEventResponse
- func (*MutateEventResponse) Descriptor() ([]byte, []int)
- func (m *MutateEventResponse) GetError() string
- func (m *MutateEventResponse) GetMutatedEvent() []byte
- func (*MutateEventResponse) ProtoMessage()
- func (m *MutateEventResponse) Reset()
- func (m *MutateEventResponse) String() string
- func (m *MutateEventResponse) XXX_DiscardUnknown()
- func (m *MutateEventResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *MutateEventResponse) XXX_Merge(src proto.Message)
- func (m *MutateEventResponse) XXX_Size() int
- func (m *MutateEventResponse) XXX_Unmarshal(b []byte) error
Constants ¶
View Source
const ExtensionTimeout = 5 * time.Second
Variables ¶
This section is empty.
Functions ¶
func RegisterExtensionServer ¶
func RegisterExtensionServer(s *grpc.Server, srv ExtensionServer)
Types ¶
type ExtensionClient ¶
type ExtensionClient interface { HandleEvent(ctx context.Context, in *HandleEventRequest, opts ...grpc.CallOption) (*HandleEventResponse, error) MutateEvent(ctx context.Context, in *MutateEventRequest, opts ...grpc.CallOption) (*MutateEventResponse, error) FilterEvent(ctx context.Context, in *FilterEventRequest, opts ...grpc.CallOption) (*FilterEventResponse, error) }
func NewExtensionClient ¶
func NewExtensionClient(cc *grpc.ClientConn) ExtensionClient
type ExtensionExecutor ¶
type ExtensionExecutor interface { // FilterEvent filters an event. FilterEvent(*types.Event) (bool, error) // MutateEvent mutates an event. MutateEvent(*types.Event) ([]byte, error) // HandleEvent handles an event. It is passed both the original event // and the mutated event, if the event was mutated. HandleEvent(*types.Event, []byte) (HandleEventResponse, error) // Close closes the underlying TCP connection of the executor Close() error }
ExtensionExecutor executes extensions.
func NewGRPCExtensionExecutor ¶
func NewGRPCExtensionExecutor(ext *types.Extension) (ExtensionExecutor, error)
NewGRPCExtensionExecutor creates a new GRPCExtensionExecutor.
type ExtensionServer ¶
type ExtensionServer interface { HandleEvent(context.Context, *HandleEventRequest) (*HandleEventResponse, error) MutateEvent(context.Context, *MutateEventRequest) (*MutateEventResponse, error) FilterEvent(context.Context, *FilterEventRequest) (*FilterEventResponse, error) }
type FilterEventRequest ¶
type FilterEventRequest struct { Event *types.Event `protobuf:"bytes,1,opt,name=event" json:"event,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*FilterEventRequest) Descriptor ¶
func (*FilterEventRequest) Descriptor() ([]byte, []int)
func (*FilterEventRequest) GetEvent ¶
func (m *FilterEventRequest) GetEvent() *types.Event
func (*FilterEventRequest) ProtoMessage ¶
func (*FilterEventRequest) ProtoMessage()
func (*FilterEventRequest) Reset ¶
func (m *FilterEventRequest) Reset()
func (*FilterEventRequest) String ¶
func (m *FilterEventRequest) String() string
func (*FilterEventRequest) XXX_DiscardUnknown ¶
func (m *FilterEventRequest) XXX_DiscardUnknown()
func (*FilterEventRequest) XXX_Marshal ¶
func (m *FilterEventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*FilterEventRequest) XXX_Merge ¶
func (dst *FilterEventRequest) XXX_Merge(src proto.Message)
func (*FilterEventRequest) XXX_Size ¶
func (m *FilterEventRequest) XXX_Size() int
func (*FilterEventRequest) XXX_Unmarshal ¶
func (m *FilterEventRequest) XXX_Unmarshal(b []byte) error
type FilterEventResponse ¶
type FilterEventResponse struct { Filtered bool `protobuf:"varint,1,opt,name=filtered" json:"filtered,omitempty"` Error string `protobuf:"bytes,2,opt,name=error" json:"error,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*FilterEventResponse) Descriptor ¶
func (*FilterEventResponse) Descriptor() ([]byte, []int)
func (*FilterEventResponse) GetError ¶
func (m *FilterEventResponse) GetError() string
func (*FilterEventResponse) GetFiltered ¶
func (m *FilterEventResponse) GetFiltered() bool
func (*FilterEventResponse) ProtoMessage ¶
func (*FilterEventResponse) ProtoMessage()
func (*FilterEventResponse) Reset ¶
func (m *FilterEventResponse) Reset()
func (*FilterEventResponse) String ¶
func (m *FilterEventResponse) String() string
func (*FilterEventResponse) XXX_DiscardUnknown ¶
func (m *FilterEventResponse) XXX_DiscardUnknown()
func (*FilterEventResponse) XXX_Marshal ¶
func (m *FilterEventResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*FilterEventResponse) XXX_Merge ¶
func (dst *FilterEventResponse) XXX_Merge(src proto.Message)
func (*FilterEventResponse) XXX_Size ¶
func (m *FilterEventResponse) XXX_Size() int
func (*FilterEventResponse) XXX_Unmarshal ¶
func (m *FilterEventResponse) XXX_Unmarshal(b []byte) error
type GRPCExtensionExecutor ¶
type GRPCExtensionExecutor struct {
// contains filtered or unexported fields
}
GRPCExtensionExecutor executes extension rpc methods.
func (*GRPCExtensionExecutor) Close ¶
func (e *GRPCExtensionExecutor) Close() error
Close closes the extension executor. It will not be usable after Close is called.
func (*GRPCExtensionExecutor) FilterEvent ¶
func (e *GRPCExtensionExecutor) FilterEvent(evt *types.Event) (bool, error)
FilterEvent filters an event.
func (*GRPCExtensionExecutor) HandleEvent ¶
func (e *GRPCExtensionExecutor) HandleEvent(evt *types.Event, mutatedEvt []byte) (HandleEventResponse, error)
HandleEvent handles an event.
func (*GRPCExtensionExecutor) MutateEvent ¶
func (e *GRPCExtensionExecutor) MutateEvent(evt *types.Event) ([]byte, error)
MutateEvent mutates an event.
type HandleEventRequest ¶
type HandleEventRequest struct { Event *types.Event `protobuf:"bytes,1,opt,name=event" json:"event,omitempty"` MutatedEvent []byte `protobuf:"bytes,2,opt,name=mutated_event,json=mutatedEvent,proto3" json:"mutated_event,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*HandleEventRequest) Descriptor ¶
func (*HandleEventRequest) Descriptor() ([]byte, []int)
func (*HandleEventRequest) GetEvent ¶
func (m *HandleEventRequest) GetEvent() *types.Event
func (*HandleEventRequest) GetMutatedEvent ¶
func (m *HandleEventRequest) GetMutatedEvent() []byte
func (*HandleEventRequest) ProtoMessage ¶
func (*HandleEventRequest) ProtoMessage()
func (*HandleEventRequest) Reset ¶
func (m *HandleEventRequest) Reset()
func (*HandleEventRequest) String ¶
func (m *HandleEventRequest) String() string
func (*HandleEventRequest) XXX_DiscardUnknown ¶
func (m *HandleEventRequest) XXX_DiscardUnknown()
func (*HandleEventRequest) XXX_Marshal ¶
func (m *HandleEventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HandleEventRequest) XXX_Merge ¶
func (dst *HandleEventRequest) XXX_Merge(src proto.Message)
func (*HandleEventRequest) XXX_Size ¶
func (m *HandleEventRequest) XXX_Size() int
func (*HandleEventRequest) XXX_Unmarshal ¶
func (m *HandleEventRequest) XXX_Unmarshal(b []byte) error
type HandleEventResponse ¶
type HandleEventResponse struct { Error string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` Output string `protobuf:"bytes,2,opt,name=output" json:"output,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*HandleEventResponse) Descriptor ¶
func (*HandleEventResponse) Descriptor() ([]byte, []int)
func (*HandleEventResponse) GetError ¶
func (m *HandleEventResponse) GetError() string
func (*HandleEventResponse) GetOutput ¶
func (m *HandleEventResponse) GetOutput() string
func (*HandleEventResponse) ProtoMessage ¶
func (*HandleEventResponse) ProtoMessage()
func (*HandleEventResponse) Reset ¶
func (m *HandleEventResponse) Reset()
func (*HandleEventResponse) String ¶
func (m *HandleEventResponse) String() string
func (*HandleEventResponse) XXX_DiscardUnknown ¶
func (m *HandleEventResponse) XXX_DiscardUnknown()
func (*HandleEventResponse) XXX_Marshal ¶
func (m *HandleEventResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HandleEventResponse) XXX_Merge ¶
func (dst *HandleEventResponse) XXX_Merge(src proto.Message)
func (*HandleEventResponse) XXX_Size ¶
func (m *HandleEventResponse) XXX_Size() int
func (*HandleEventResponse) XXX_Unmarshal ¶
func (m *HandleEventResponse) XXX_Unmarshal(b []byte) error
type MutateEventRequest ¶
type MutateEventRequest struct { Event *types.Event `protobuf:"bytes,1,opt,name=event" json:"event,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*MutateEventRequest) Descriptor ¶
func (*MutateEventRequest) Descriptor() ([]byte, []int)
func (*MutateEventRequest) GetEvent ¶
func (m *MutateEventRequest) GetEvent() *types.Event
func (*MutateEventRequest) ProtoMessage ¶
func (*MutateEventRequest) ProtoMessage()
func (*MutateEventRequest) Reset ¶
func (m *MutateEventRequest) Reset()
func (*MutateEventRequest) String ¶
func (m *MutateEventRequest) String() string
func (*MutateEventRequest) XXX_DiscardUnknown ¶
func (m *MutateEventRequest) XXX_DiscardUnknown()
func (*MutateEventRequest) XXX_Marshal ¶
func (m *MutateEventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MutateEventRequest) XXX_Merge ¶
func (dst *MutateEventRequest) XXX_Merge(src proto.Message)
func (*MutateEventRequest) XXX_Size ¶
func (m *MutateEventRequest) XXX_Size() int
func (*MutateEventRequest) XXX_Unmarshal ¶
func (m *MutateEventRequest) XXX_Unmarshal(b []byte) error
type MutateEventResponse ¶
type MutateEventResponse struct { MutatedEvent []byte `protobuf:"bytes,1,opt,name=mutated_event,json=mutatedEvent,proto3" json:"mutated_event,omitempty"` Error string `protobuf:"bytes,2,opt,name=error" json:"error,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*MutateEventResponse) Descriptor ¶
func (*MutateEventResponse) Descriptor() ([]byte, []int)
func (*MutateEventResponse) GetError ¶
func (m *MutateEventResponse) GetError() string
func (*MutateEventResponse) GetMutatedEvent ¶
func (m *MutateEventResponse) GetMutatedEvent() []byte
func (*MutateEventResponse) ProtoMessage ¶
func (*MutateEventResponse) ProtoMessage()
func (*MutateEventResponse) Reset ¶
func (m *MutateEventResponse) Reset()
func (*MutateEventResponse) String ¶
func (m *MutateEventResponse) String() string
func (*MutateEventResponse) XXX_DiscardUnknown ¶
func (m *MutateEventResponse) XXX_DiscardUnknown()
func (*MutateEventResponse) XXX_Marshal ¶
func (m *MutateEventResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MutateEventResponse) XXX_Merge ¶
func (dst *MutateEventResponse) XXX_Merge(src proto.Message)
func (*MutateEventResponse) XXX_Size ¶
func (m *MutateEventResponse) XXX_Size() int
func (*MutateEventResponse) XXX_Unmarshal ¶
func (m *MutateEventResponse) XXX_Unmarshal(b []byte) error
Click to show internal directories.
Click to hide internal directories.