Documentation
¶
Index ¶
- Constants
- Variables
- func IncidentToProto(incident models.Incident) *proto.Incident
- func NotifyRequestToProto(notifyRequest *models.NotifyRequest) *proto.NotifyRequest
- func ProtoToIncident(incident *proto.Incident) models.Incident
- func ProtoToNotifyRequest(notifyRequest *proto.NotifyRequest) *models.NotifyRequest
- type Base
- type GRPCClient
- func (m *GRPCClient) Description() (string, error)
- func (m *GRPCClient) Id() (string, error)
- func (m *GRPCClient) Init(baseInfo config.BaseInfo, params map[string]interface{}) error
- func (m *GRPCClient) MetadataFields() ([]models.MetadataField, error)
- func (m *GRPCClient) Name() (string, error)
- func (m *GRPCClient) Notify(notifyReq *models.NotifyRequest) error
- func (m *GRPCClient) PreCheck(incident models.Incident) error
- type GRPCServer
- func (s GRPCServer) Description(ctx context.Context, empty *emptypb.Empty) (*proto.DescriptionResponse, error)
- func (s GRPCServer) Id(ctx context.Context, request *emptypb.Empty) (*proto.IdResponse, error)
- func (s GRPCServer) Init(ctx context.Context, request *proto.InitRequest) (*emptypb.Empty, error)
- func (s GRPCServer) MetadataFields(ctx context.Context, request *emptypb.Empty) (*proto.ListMetadataField, error)
- func (s GRPCServer) Name(ctx context.Context, request *emptypb.Empty) (*proto.NameResponse, error)
- func (s GRPCServer) Notify(ctx context.Context, request *proto.NotifyRequest) (*proto.ErrorResponse, error)
- func (s GRPCServer) PreCheck(ctx context.Context, request *proto.NotifyRequest) (*proto.ErrorResponse, error)
- type Notifier
- type NotifierGRPCPlugin
- type Plugin
- func (n Plugin) Creator(params map[string]interface{}, baseInfo config.BaseInfo) (notifiers.Notifier, error)
- func (n Plugin) Description() string
- func (n Plugin) Id() string
- func (n Plugin) MetadataFields() []models.MetadataField
- func (n Plugin) Name() string
- func (n Plugin) Notify(notifyReq *models.NotifyRequest) error
- func (n Plugin) PreCheck(incident models.Incident) error
Constants ¶
View Source
const RegisterFuncName = "Register"
Variables ¶
View Source
var Handshake = pluginhc.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "BASIC_PLUGIN",
MagicCookieValue: "hello",
}
Handshake is a common handshake that is shared by plugin and host.
Functions ¶
func IncidentToProto ¶ added in v1.5.0
func NotifyRequestToProto ¶ added in v1.6.1
func NotifyRequestToProto(notifyRequest *models.NotifyRequest) *proto.NotifyRequest
func ProtoToIncident ¶ added in v1.5.0
func ProtoToNotifyRequest ¶ added in v1.6.1
func ProtoToNotifyRequest(notifyRequest *proto.NotifyRequest) *models.NotifyRequest
Types ¶
type GRPCClient ¶ added in v1.5.0
type GRPCClient struct {
// contains filtered or unexported fields
}
func (*GRPCClient) Description ¶ added in v1.6.1
func (m *GRPCClient) Description() (string, error)
func (*GRPCClient) Id ¶ added in v1.5.0
func (m *GRPCClient) Id() (string, error)
func (*GRPCClient) Init ¶ added in v1.5.0
func (m *GRPCClient) Init(baseInfo config.BaseInfo, params map[string]interface{}) error
func (*GRPCClient) MetadataFields ¶ added in v1.5.0
func (m *GRPCClient) MetadataFields() ([]models.MetadataField, error)
func (*GRPCClient) Name ¶ added in v1.5.0
func (m *GRPCClient) Name() (string, error)
func (*GRPCClient) Notify ¶ added in v1.5.0
func (m *GRPCClient) Notify(notifyReq *models.NotifyRequest) error
type GRPCServer ¶ added in v1.5.0
type GRPCServer struct { proto.UnsafeNotifierServer // This is the real implementation Impl Notifier }
func (GRPCServer) Description ¶ added in v1.6.1
func (s GRPCServer) Description(ctx context.Context, empty *emptypb.Empty) (*proto.DescriptionResponse, error)
func (GRPCServer) Id ¶ added in v1.5.0
func (s GRPCServer) Id(ctx context.Context, request *emptypb.Empty) (*proto.IdResponse, error)
func (GRPCServer) Init ¶ added in v1.5.0
func (s GRPCServer) Init(ctx context.Context, request *proto.InitRequest) (*emptypb.Empty, error)
func (GRPCServer) MetadataFields ¶ added in v1.5.0
func (s GRPCServer) MetadataFields(ctx context.Context, request *emptypb.Empty) (*proto.ListMetadataField, error)
func (GRPCServer) Name ¶ added in v1.5.0
func (s GRPCServer) Name(ctx context.Context, request *emptypb.Empty) (*proto.NameResponse, error)
func (GRPCServer) Notify ¶ added in v1.5.0
func (s GRPCServer) Notify(ctx context.Context, request *proto.NotifyRequest) (*proto.ErrorResponse, error)
func (GRPCServer) PreCheck ¶ added in v1.6.1
func (s GRPCServer) PreCheck(ctx context.Context, request *proto.NotifyRequest) (*proto.ErrorResponse, error)
type Notifier ¶ added in v1.5.0
type Notifier interface { Init(baseInfo config.BaseInfo, params map[string]interface{}) error Name() (string, error) Description() (string, error) Id() (string, error) MetadataFields() ([]models.MetadataField, error) Notify(notifyReq *models.NotifyRequest) error PreCheck(incident models.Incident) error }
type NotifierGRPCPlugin ¶ added in v1.5.0
type NotifierGRPCPlugin struct { // GRPCPlugin must still implement the Plugin interface pluginhc.Plugin // Concrete implementation, written in Go. This is only used for plugins // that are written in Go. Impl Notifier }
func (*NotifierGRPCPlugin) GRPCClient ¶ added in v1.5.0
func (p *NotifierGRPCPlugin) GRPCClient(ctx context.Context, broker *pluginhc.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
func (*NotifierGRPCPlugin) GRPCServer ¶ added in v1.5.0
func (p *NotifierGRPCPlugin) GRPCServer(broker *pluginhc.GRPCBroker, s *grpc.Server) error
type Plugin ¶
type Plugin struct { BaseRequest Base // contains filtered or unexported fields }
func (Plugin) Description ¶ added in v1.6.1
func (Plugin) MetadataFields ¶ added in v1.3.0
func (n Plugin) MetadataFields() []models.MetadataField
Click to show internal directories.
Click to hide internal directories.