Skip to content
Snippets Groups Projects

Change the current gosdn plugin implementation from Go's internal plugin system to hashicorp's go-plugins

Merged Ghost User requested to merge mb/plugin-registry-hashicorp-go-plugin into develop
7 files
+ 112
78
Compare changes
  • Side-by-side
  • Inline
Files
7
@@ -123,7 +123,7 @@ func (x *GetAvailablePluginsResponse) GetPlugins() []*plugin_registry.Plugin {
return nil
}
type PluginSchemaRequest struct {
type GetPluginSchemaRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@@ -132,8 +132,8 @@ type PluginSchemaRequest struct {
Pid string `protobuf:"bytes,2,opt,name=pid,proto3" json:"pid,omitempty"`
}
func (x *PluginSchemaRequest) Reset() {
*x = PluginSchemaRequest{}
func (x *GetPluginSchemaRequest) Reset() {
*x = GetPluginSchemaRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_gosdn_plugin_internal_plugin_internal_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -141,13 +141,13 @@ func (x *PluginSchemaRequest) Reset() {
}
}
func (x *PluginSchemaRequest) String() string {
func (x *GetPluginSchemaRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PluginSchemaRequest) ProtoMessage() {}
func (*GetPluginSchemaRequest) ProtoMessage() {}
func (x *PluginSchemaRequest) ProtoReflect() protoreflect.Message {
func (x *GetPluginSchemaRequest) ProtoReflect() protoreflect.Message {
mi := &file_gosdn_plugin_internal_plugin_internal_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -159,19 +159,19 @@ func (x *PluginSchemaRequest) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use PluginSchemaRequest.ProtoReflect.Descriptor instead.
func (*PluginSchemaRequest) Descriptor() ([]byte, []int) {
// Deprecated: Use GetPluginSchemaRequest.ProtoReflect.Descriptor instead.
func (*GetPluginSchemaRequest) Descriptor() ([]byte, []int) {
return file_gosdn_plugin_internal_plugin_internal_proto_rawDescGZIP(), []int{2}
}
func (x *PluginSchemaRequest) GetTimestamp() int64 {
func (x *GetPluginSchemaRequest) GetTimestamp() int64 {
if x != nil {
return x.Timestamp
}
return 0
}
func (x *PluginSchemaRequest) GetPid() string {
func (x *GetPluginSchemaRequest) GetPid() string {
if x != nil {
return x.Pid
}
@@ -246,33 +246,34 @@ var file_gosdn_plugin_internal_plugin_internal_proto_rawDesc = []byte{
0x75, 0x67, 0x69, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f,
0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73,
0x74, 0x72, 0x79, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x07, 0x70, 0x6c, 0x75, 0x67,
0x69, 0x6e, 0x73, 0x22, 0x45, 0x0a, 0x13, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x63, 0x68,
0x65, 0x6d, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69,
0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74,
0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x2b, 0x0a, 0x13, 0x50, 0x6c,
0x75, 0x67, 0x69, 0x6e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61,
0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c,
0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x32, 0xec, 0x01, 0x0a, 0x15, 0x50, 0x6c, 0x75, 0x67,
0x69, 0x6e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x12, 0x69, 0x0a, 0x10, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x6c,
0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x31, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c,
0x75, 0x67, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x47, 0x65,
0x74, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e,
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e,
0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79,
0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x0c,
0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x2a, 0x2e, 0x67,
0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x65,
0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x63, 0x68, 0x65, 0x6d,
0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e,
0x69, 0x6e, 0x73, 0x22, 0x48, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e,
0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a,
0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x70,
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x2b, 0x0a,
0x13, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x50, 0x61, 0x79,
0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0c, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x32, 0xf2, 0x01, 0x0a, 0x15, 0x50,
0x6c, 0x75, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x12, 0x69, 0x0a, 0x10, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c,
0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x31, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e,
0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,
0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x50, 0x61, 0x79,
0x6c, 0x6f, 0x61, 0x64, 0x30, 0x01, 0x42, 0x3b, 0x5a, 0x39, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x66,
0x62, 0x69, 0x2e, 0x68, 0x2d, 0x64, 0x61, 0x2e, 0x64, 0x65, 0x2f, 0x64, 0x61, 0x6e, 0x65, 0x74,
0x2f, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x6f,
0x73, 0x64, 0x6e, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2d, 0x69, 0x6e, 0x74, 0x65, 0x72,
0x6e, 0x61, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x2e, 0x47, 0x65, 0x74, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x6c, 0x75,
0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x6f,
0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73,
0x74, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x6e, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x63, 0x68, 0x65,
0x6d, 0x61, 0x12, 0x2d, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69,
0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c,
0x75, 0x67, 0x69, 0x6e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x2a, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e,
0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e,
0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x30, 0x01, 0x42,
0x3b, 0x5a, 0x39, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x66, 0x62, 0x69, 0x2e, 0x68, 0x2d, 0x64, 0x61,
0x2e, 0x64, 0x65, 0x2f, 0x64, 0x61, 0x6e, 0x65, 0x74, 0x2f, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f,
0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x70, 0x6c, 0x75,
0x67, 0x69, 0x6e, 0x2d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -291,7 +292,7 @@ var file_gosdn_plugin_internal_plugin_internal_proto_msgTypes = make([]protoimpl
var file_gosdn_plugin_internal_plugin_internal_proto_goTypes = []interface{}{
(*GetAvailablePluginsRequest)(nil), // 0: gosdn.plugin_internal.GetAvailablePluginsRequest
(*GetAvailablePluginsResponse)(nil), // 1: gosdn.plugin_internal.GetAvailablePluginsResponse
(*PluginSchemaRequest)(nil), // 2: gosdn.plugin_internal.PluginSchemaRequest
(*GetPluginSchemaRequest)(nil), // 2: gosdn.plugin_internal.GetPluginSchemaRequest
(*PluginSchemaPayload)(nil), // 3: gosdn.plugin_internal.PluginSchemaPayload
(*plugin_registry.Plugin)(nil), // 4: gosdn.plugin_registry.Plugin
(*plugin_registry.GetResponse)(nil), // 5: gosdn.plugin_registry.GetResponse
@@ -299,9 +300,9 @@ var file_gosdn_plugin_internal_plugin_internal_proto_goTypes = []interface{}{
var file_gosdn_plugin_internal_plugin_internal_proto_depIdxs = []int32{
4, // 0: gosdn.plugin_internal.GetAvailablePluginsResponse.plugins:type_name -> gosdn.plugin_registry.Plugin
0, // 1: gosdn.plugin_internal.PluginInternalService.AvailablePlugins:input_type -> gosdn.plugin_internal.GetAvailablePluginsRequest
2, // 2: gosdn.plugin_internal.PluginInternalService.PluginSchema:input_type -> gosdn.plugin_internal.PluginSchemaRequest
2, // 2: gosdn.plugin_internal.PluginInternalService.GetPluginSchema:input_type -> gosdn.plugin_internal.GetPluginSchemaRequest
5, // 3: gosdn.plugin_internal.PluginInternalService.AvailablePlugins:output_type -> gosdn.plugin_registry.GetResponse
3, // 4: gosdn.plugin_internal.PluginInternalService.PluginSchema:output_type -> gosdn.plugin_internal.PluginSchemaPayload
3, // 4: gosdn.plugin_internal.PluginInternalService.GetPluginSchema:output_type -> gosdn.plugin_internal.PluginSchemaPayload
3, // [3:5] is the sub-list for method output_type
1, // [1:3] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
@@ -340,7 +341,7 @@ func file_gosdn_plugin_internal_plugin_internal_proto_init() {
}
}
file_gosdn_plugin_internal_plugin_internal_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PluginSchemaRequest); i {
switch v := v.(*GetPluginSchemaRequest); i {
case 0:
return &v.state
case 1:
Loading