shared

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package shared contains shared data between the host and plugins.

Index

Constants

View Source
const (
	CAPABILITY_REVIEW_PROCESSOR = "review.v1.ReviewProcessorService"
	CAPABILITY_RENDER           = "render.v1.RenderService"
	CAPABILITY_ADD_CARD         = "addcard.v1.AddCardService"
	CAPABILITY_UPDATE_CARD      = "addcard.v1.UpdateCardService"
)

Variables

View Source
var Handshake = plugin.HandshakeConfig{

	ProtocolVersion:  1,
	MagicCookieKey:   "FLASHCARD_CLI_PLUGIN_HANDSHAKE",
	MagicCookieValue: "flashcards-grpc-ecosystem-auth",
}

Handshake is a common handshake that is shared by plugin and host.

Functions

This section is empty.

Types

type RenderPlugin

type RenderPlugin struct {
	plugin.NetRPCUnsupportedPlugin
	Impl render.RenderServiceServer
}

func (*RenderPlugin) GRPCClient

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

func (*RenderPlugin) GRPCServer

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

type ReviewPlugin

func (*ReviewPlugin) GRPCClient

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

func (*ReviewPlugin) GRPCServer

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

type Shutdownable

type Shutdownable interface {
	Shutdown(ctx context.Context, in *common.ShutdownRequest, opts ...grpc.CallOption) (*common.ShutdownResponse, error)
}

Shutdownable defines a client plugin that can be shutdown. All plugins should match this interface

type UpdateCardPlugin

type UpdateCardPlugin struct {
	plugin.NetRPCUnsupportedPlugin
	Impl update.UpdateCardServiceServer
}

func (*UpdateCardPlugin) GRPCClient

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

func (*UpdateCardPlugin) GRPCServer

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

Jump to

Keyboard shortcuts

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