Documentation
¶
Index ¶
- type DifyServer
- func (r *DifyServer) AddNotifier(notifier PluginRuntimeNotifier)
- func (s *DifyServer) OnBoot(c gnet.Engine) (action gnet.Action)
- func (s *DifyServer) OnClose(c gnet.Conn, err error) (action gnet.Action)
- func (s *DifyServer) OnOpen(c gnet.Conn) (out []byte, action gnet.Action)
- func (s *DifyServer) OnShutdown(c gnet.Engine)
- func (s *DifyServer) OnTraffic(c gnet.Conn) (action gnet.Action)
- func (r *DifyServer) WalkNotifiers(fn func(notifier PluginRuntimeNotifier))
- type GnetLogger
- func (l GnetLogger) Debugf(format string, args ...any)
- func (l GnetLogger) Errorf(format string, args ...any)
- func (l GnetLogger) Fatalf(format string, args ...any)
- func (l GnetLogger) Infof(format string, args ...any)
- func (l GnetLogger) Printf(format string, args ...any) string
- func (l GnetLogger) Warnf(format string, args ...any)
- type PluginRuntimeNotifier
- type RemotePluginRuntime
- func (r *RemotePluginRuntime) Checksum() (string, error)
- func (r *RemotePluginRuntime) HeartbeatMonitor()
- func (r *RemotePluginRuntime) Identity() (plugin_entities.PluginUniqueIdentifier, error)
- func (r *RemotePluginRuntime) InstallationId() string
- func (r *RemotePluginRuntime) Listen(sessionId string) (*entities.Broadcast[plugin_entities.SessionMessage], error)
- func (r *RemotePluginRuntime) SetInstallationId(installationId string)
- func (r *RemotePluginRuntime) SpawnCore() error
- func (r *RemotePluginRuntime) Stop()
- func (r *RemotePluginRuntime) Stopped() bool
- func (r *RemotePluginRuntime) TenantId() string
- func (r *RemotePluginRuntime) Type() plugin_entities.PluginRuntimeType
- func (r *RemotePluginRuntime) Write(sessionId string, action access_types.PluginAccessAction, data []byte) error
- type RemotePluginServer
- type RemotePluginServerInterface
- type ServerShutdownReason
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DifyServer ¶
type DifyServer struct {
gnet.BuiltinEventEngine
// contains filtered or unexported fields
}
func (*DifyServer) AddNotifier ¶
func (r *DifyServer) AddNotifier(notifier PluginRuntimeNotifier)
AddNotifier adds a notifier to the runtime
func (*DifyServer) OnShutdown ¶
func (s *DifyServer) OnShutdown(c gnet.Engine)
func (*DifyServer) WalkNotifiers ¶
func (r *DifyServer) WalkNotifiers(fn func(notifier PluginRuntimeNotifier))
WalkNotifiers walks through all the notifiers and calls the given function
type GnetLogger ¶
type GnetLogger struct{}
GnetLogger is a logger implementation for gnet that uses the custom log package
It implements the gnet.logging.Logger interface See: https://pkg.go.dev/github.com/panjf2000/gnet/v2#WithLogger
Gnet uses format strings for logging, but our custom log package uses structured logging reformat it using fmt.Sprintf here as a bridge
func (GnetLogger) Debugf ¶
func (l GnetLogger) Debugf(format string, args ...any)
func (GnetLogger) Errorf ¶
func (l GnetLogger) Errorf(format string, args ...any)
func (GnetLogger) Fatalf ¶
func (l GnetLogger) Fatalf(format string, args ...any)
func (GnetLogger) Infof ¶
func (l GnetLogger) Infof(format string, args ...any)
func (GnetLogger) Warnf ¶
func (l GnetLogger) Warnf(format string, args ...any)
type PluginRuntimeNotifier ¶
type PluginRuntimeNotifier interface {
// on runtime connected
OnRuntimeConnected(*RemotePluginRuntime) error
// on runtime disconnected
OnRuntimeDisconnected(*RemotePluginRuntime)
// on server shutdown
OnServerShutdown(reason ServerShutdownReason)
}
type RemotePluginRuntime ¶
type RemotePluginRuntime struct {
basic_runtime.MediaTransport
plugin_entities.PluginRuntime
// contains filtered or unexported fields
}
func (*RemotePluginRuntime) Checksum ¶
func (r *RemotePluginRuntime) Checksum() (string, error)
func (*RemotePluginRuntime) HeartbeatMonitor ¶
func (r *RemotePluginRuntime) HeartbeatMonitor()
func (*RemotePluginRuntime) Identity ¶
func (r *RemotePluginRuntime) Identity() (plugin_entities.PluginUniqueIdentifier, error)
func (*RemotePluginRuntime) InstallationId ¶
func (r *RemotePluginRuntime) InstallationId() string
func (*RemotePluginRuntime) Listen ¶
func (r *RemotePluginRuntime) Listen(sessionId string) (*entities.Broadcast[plugin_entities.SessionMessage], error)
func (*RemotePluginRuntime) SetInstallationId ¶
func (r *RemotePluginRuntime) SetInstallationId(installationId string)
func (*RemotePluginRuntime) SpawnCore ¶
func (r *RemotePluginRuntime) SpawnCore() error
spawn a core to handle CPU-intensive tasks
func (*RemotePluginRuntime) Stop ¶
func (r *RemotePluginRuntime) Stop()
func (*RemotePluginRuntime) Stopped ¶
func (r *RemotePluginRuntime) Stopped() bool
func (*RemotePluginRuntime) TenantId ¶
func (r *RemotePluginRuntime) TenantId() string
func (*RemotePluginRuntime) Type ¶
func (r *RemotePluginRuntime) Type() plugin_entities.PluginRuntimeType
func (*RemotePluginRuntime) Write ¶
func (r *RemotePluginRuntime) Write( sessionId string, action access_types.PluginAccessAction, data []byte, ) error
type RemotePluginServer ¶
type RemotePluginServer struct {
// contains filtered or unexported fields
}
func NewDebuggingPluginServer ¶
func NewDebuggingPluginServer( config *app.Config, media_transport *media_transport.MediaBucket, ) *RemotePluginServer
NewDebuggingPluginServer creates a new RemotePluginServer
func (*RemotePluginServer) AddNotifier ¶
func (r *RemotePluginServer) AddNotifier(notifier PluginRuntimeNotifier)
AddNotifier adds a notifier to the runtime
func (*RemotePluginServer) Launch ¶
func (r *RemotePluginServer) Launch() error
Launch starts the server
func (*RemotePluginServer) WalkNotifiers ¶
func (r *RemotePluginServer) WalkNotifiers(fn func(notifier PluginRuntimeNotifier))
WalkNotifiers walks through all the notifiers and calls the given function
type ServerShutdownReason ¶
type ServerShutdownReason string
const ( SERVER_SHUTDOWN_REASON_EXIT ServerShutdownReason = "exit" SERVER_SHUTDOWN_REASON_ERROR ServerShutdownReason = "error" )