Documentation
¶
Overview ¶
Package utils provides SDK state-store access, RPC middleware composition, and legacy encoding helpers.
Index ¶
- func ConvertAnyToInterface(anyValue *anypb.Any) (any, error)
- func ConvertInterfaceToAny(v any) (*anypb.Any, error)
- func DeexpandTilde(path string) string
- func ExpandTilde(path string) (string, error)
- func GetPluginStorePath(pluginID string) (string, error)
- func GetStore(capability, pluginID string) (*os.File, error)
- func InitializePluginStore(pluginID string) error
- func NewServerInterceptors(log logging.Logger) ([]grpc.UnaryServerInterceptor, []grpc.StreamServerInterceptor)
- func RegisterServerOpts(opts []grpc.ServerOption, log logging.Logger) []grpc.ServerOption
- func RemoveStore(capability, pluginID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertAnyToInterface ¶
ConvertAnyToInterface decodes a JSON BytesValue envelope into ordinary Go JSON values. Malformed envelopes or JSON return an error; JSON null produces a nil value without error.
func ConvertInterfaceToAny ¶
ConvertInterfaceToAny encodes v as JSON inside a protobuf BytesValue envelope. Unsupported JSON values retain the legacy empty-body behavior; this is not a resource-value codec.
func DeexpandTilde ¶
DeexpandTilde replaces HOME or its lexical path-component prefix with "~". Other paths and failed HOME lookups remain unchanged; it does not resolve symlinks.
func ExpandTilde ¶
ExpandTilde expands paths beginning with "~/" using the current home directory. Other inputs, including empty strings and bare "~", remain unchanged. HOME lookup errors are returned.
func GetPluginStorePath ¶
GetPluginStorePath returns a validated store path for an installed plugin. SDK operations use directory handles rather than reopening this advisory path.
func InitializePluginStore ¶
InitializePluginStore creates the private store for an installed plugin.
func NewServerInterceptors ¶
func NewServerInterceptors(log logging.Logger) ([]grpc.UnaryServerInterceptor, []grpc.StreamServerInterceptor)
NewServerInterceptors returns the default unary and stream interceptor chains for the plugin SDK gRPC server.
func RegisterServerOpts ¶
func RegisterServerOpts(opts []grpc.ServerOption, log logging.Logger) []grpc.ServerOption
RegisterServerOpts returns a list of gRPC server options with the necessary interceptors for the plugin SDK.
func RemoveStore ¶
RemoveStore removes only the selected plugin's capability store.
Types ¶
This section is empty.