plugin

package
v0.64.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 13 Imported by: 7

Documentation

Index

Constants

View Source
const InfoName = "info"

InfoName constant should not be used directly when implementing plugins. It's the registration name for the info plugin, used by the CLI and the cli-plugin-base library (RegisterPlugins function) to register the plugins.

View Source
const (
	InfoService_GetInfo_FullMethodName = "/util.plugin.InfoService/GetInfo"
)

Variables

View Source
var (
	PluginType_name = map[int32]string{
		0: "PLUGIN_TYPE_UNKNOWN",
		1: "PLUGIN_TYPE_FULL_DS_SYNC",
		2: "PLUGIN_TYPE_IS_SYNC",
		3: "PLUGIN_TYPE_TAG_SYNC",
		4: "PLUGIN_TYPE_RESOURCE_PROVIDER",
	}
	PluginType_value = map[string]int32{
		"PLUGIN_TYPE_UNKNOWN":           0,
		"PLUGIN_TYPE_FULL_DS_SYNC":      1,
		"PLUGIN_TYPE_IS_SYNC":           2,
		"PLUGIN_TYPE_TAG_SYNC":          3,
		"PLUGIN_TYPE_RESOURCE_PROVIDER": 4,
	}
)

Enum value maps for PluginType.

View Source
var File_util_plugin_info_proto protoreflect.FileDescriptor
View Source
var InfoService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "util.plugin.InfoService",
	HandlerType: (*InfoServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetInfo",
			Handler:    _InfoService_GetInfo_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "util/plugin/info.proto",
}

InfoService_ServiceDesc is the grpc.ServiceDesc for InfoService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func ParseVersion

func ParseVersion(stringVersion string) *version.SemVer

ParseVersion parses the given string version in the form X.Y.Z and returns a Version struct representing it. If the input string is invalid, a 0.0.0 version will be returned

func RegisterInfoServiceServer added in v0.32.0

func RegisterInfoServiceServer(s grpc.ServiceRegistrar, srv InfoServiceServer)

Types

type Info

type Info interface {
	GetInfo(ctx context.Context) (*PluginInfo, error)
}

Info interface needs to be implemented by all plugins to provide basic plugin information.

type InfoPlugin

type InfoPlugin struct {
	plugin.Plugin

	Impl InfoServiceServer
}

InfoPlugin is used on the server (CLI) and client (plugin) side to integrate with the plugin system. A plugin should not be using this directly, but instead depend on the cli-plugin-base library to register the plugins.

func (InfoPlugin) GRPCClient added in v0.32.0

func (InfoPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

func (*InfoPlugin) GRPCServer added in v0.32.0

func (p *InfoPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

type InfoServiceClient added in v0.32.0

type InfoServiceClient interface {
	GetInfo(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PluginInfo, error)
}

InfoServiceClient is the client API for InfoService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewInfoServiceClient added in v0.32.0

func NewInfoServiceClient(cc grpc.ClientConnInterface) InfoServiceClient

type InfoServiceServer added in v0.32.0

type InfoServiceServer interface {
	GetInfo(context.Context, *emptypb.Empty) (*PluginInfo, error)
	// contains filtered or unexported methods
}

InfoServiceServer is the server API for InfoService service. All implementations must embed UnimplementedInfoServiceServer for forward compatibility

type ParameterInfo

type ParameterInfo struct {
	Name        string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	Mandatory   bool   `protobuf:"varint,3,opt,name=mandatory,proto3" json:"mandatory,omitempty"`
	// contains filtered or unexported fields
}

ParameterInfo contains the information about a parameter. This is used to inform the CLI user what command-line parameters are expected explicitly for this target (plugin).

func (*ParameterInfo) Descriptor deprecated added in v0.32.0

func (*ParameterInfo) Descriptor() ([]byte, []int)

Deprecated: Use ParameterInfo.ProtoReflect.Descriptor instead.

func (*ParameterInfo) GetDescription added in v0.32.0

func (x *ParameterInfo) GetDescription() string

func (*ParameterInfo) GetMandatory added in v0.32.0

func (x *ParameterInfo) GetMandatory() bool

func (*ParameterInfo) GetName added in v0.32.0

func (x *ParameterInfo) GetName() string

func (*ParameterInfo) ProtoMessage added in v0.32.0

func (*ParameterInfo) ProtoMessage()

func (*ParameterInfo) ProtoReflect added in v0.32.0

func (x *ParameterInfo) ProtoReflect() protoreflect.Message

func (*ParameterInfo) Reset added in v0.32.0

func (x *ParameterInfo) Reset()

func (*ParameterInfo) String

func (x *ParameterInfo) String() string

type PluginInfo

type PluginInfo struct {
	Name        string           `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Description string           `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	Version     *version.SemVer  `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
	Parameters  []*ParameterInfo `protobuf:"bytes,4,rep,name=parameters,proto3" json:"parameters,omitempty"`
	TagSource   string           `protobuf:"bytes,5,opt,name=tag_source,json=tagSource,proto3" json:"tag_source,omitempty"`
	Type        []PluginType     `protobuf:"varint,6,rep,packed,name=type,proto3,enum=util.plugin.PluginType" json:"type,omitempty"`
	// contains filtered or unexported fields
}

PluginInfo represents the information about a plugin.

func (*PluginInfo) Descriptor deprecated added in v0.32.0

func (*PluginInfo) Descriptor() ([]byte, []int)

Deprecated: Use PluginInfo.ProtoReflect.Descriptor instead.

func (*PluginInfo) GetDescription added in v0.32.0

func (x *PluginInfo) GetDescription() string

func (*PluginInfo) GetName added in v0.32.0

func (x *PluginInfo) GetName() string

func (*PluginInfo) GetParameters added in v0.32.0

func (x *PluginInfo) GetParameters() []*ParameterInfo

func (*PluginInfo) GetTagSource added in v0.58.0

func (x *PluginInfo) GetTagSource() string

func (*PluginInfo) GetType added in v0.61.0

func (x *PluginInfo) GetType() []PluginType

func (*PluginInfo) GetVersion added in v0.32.0

func (x *PluginInfo) GetVersion() *version.SemVer

func (*PluginInfo) InfoString added in v0.32.0

func (i *PluginInfo) InfoString() string

func (*PluginInfo) ProtoMessage added in v0.32.0

func (*PluginInfo) ProtoMessage()

func (*PluginInfo) ProtoReflect added in v0.32.0

func (x *PluginInfo) ProtoReflect() protoreflect.Message

func (*PluginInfo) Reset added in v0.32.0

func (x *PluginInfo) Reset()

func (*PluginInfo) String

func (x *PluginInfo) String() string

type PluginType added in v0.61.0

type PluginType int32
const (
	// UNKNOWN plugin type. Avoid this type.
	// If type is unknown CLI will fallback on FULL_DS_SYNC
	PluginType_PLUGIN_TYPE_UNKNOWN PluginType = 0
	// FULL_DS_SYNC execute data source sync, identity store sync, access provider sync and data usage sync.
	// This type should be used for most data sources such as snowflake, bigquery, databricks, and so on.
	// A websocket may be initialized for this type.
	PluginType_PLUGIN_TYPE_FULL_DS_SYNC PluginType = 1
	// IS_SYNC execute only an identity store sync.
	// This type should be used for syncing identity providers (such as okta).
	PluginType_PLUGIN_TYPE_IS_SYNC PluginType = 2
	// TAG_SYNC execute only a tag sync.
	// This type should be used for syncing tags on external sources (such as catalogs).
	PluginType_PLUGIN_TYPE_TAG_SYNC PluginType = 3
	// AC_PROVIDER execute only an access provider sync.
	// This type should be used for plugins that provide Raito Cloud Resources.
	PluginType_PLUGIN_TYPE_RESOURCE_PROVIDER PluginType = 4
)

func (PluginType) Descriptor added in v0.61.0

func (PluginType) Descriptor() protoreflect.EnumDescriptor

func (PluginType) Enum added in v0.61.0

func (x PluginType) Enum() *PluginType

func (PluginType) EnumDescriptor deprecated added in v0.61.0

func (PluginType) EnumDescriptor() ([]byte, []int)

Deprecated: Use PluginType.Descriptor instead.

func (PluginType) Number added in v0.61.0

func (x PluginType) Number() protoreflect.EnumNumber

func (PluginType) String added in v0.61.0

func (x PluginType) String() string

func (PluginType) Type added in v0.61.0

type UnimplementedInfoServiceServer added in v0.32.0

type UnimplementedInfoServiceServer struct {
}

UnimplementedInfoServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedInfoServiceServer) GetInfo added in v0.32.0

type UnsafeInfoServiceServer added in v0.32.0

type UnsafeInfoServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeInfoServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to InfoServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL