Documentation
¶
Index ¶
- Constants
- func ClearConnectionKey(tenant_id string) error
- func GetConnectionKey(info ConnectionInfo) (string, error)
- type ConnectionInfo
- type DifyServer
- 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)
- type Key
- type RemotePluginRuntime
- func (r *RemotePluginRuntime) Checksum() (string, error)
- func (r *RemotePluginRuntime) Cleanup()
- func (r *RemotePluginRuntime) Identity() (plugin_entities.PluginUniqueIdentifier, error)
- func (r *RemotePluginRuntime) InitEnvironment() error
- func (r *RemotePluginRuntime) Listen(session_id string) *entities.Broadcast[plugin_entities.SessionMessage]
- func (plugin *RemotePluginRuntime) Register() error
- func (r *RemotePluginRuntime) StartPlugin() error
- func (r *RemotePluginRuntime) Stop()
- func (r *RemotePluginRuntime) Stopped() bool
- func (r *RemotePluginRuntime) Type() plugin_entities.PluginRuntimeType
- func (plugin *RemotePluginRuntime) Unregister() error
- func (r *RemotePluginRuntime) Wait() (<-chan bool, error)
- func (r *RemotePluginRuntime) WaitStarted() <-chan bool
- func (r *RemotePluginRuntime) WaitStopped() <-chan bool
- func (r *RemotePluginRuntime) Write(session_id string, action access_types.PluginAccessAction, data []byte)
- type RemotePluginServer
- type RemotePluginServerInterface
Constants ¶
View Source
const ( CONNECTION_KEY_MANAGER_KEY2ID_PREFIX = "{remote:key:manager}:key2id" CONNECTION_KEY_MANAGER_ID2KEY_PREFIX = "{remote:key:manager}:id2key" CONNECTION_KEY_LOCK = "connection_lock" CONNECTION_KEY_EXPIRE_TIME = time.Minute * 120 // 2 hours )
Variables ¶
This section is empty.
Functions ¶
func GetConnectionKey ¶
func GetConnectionKey(info ConnectionInfo) (string, error)
returns a random string, create it if not exists
Types ¶
type ConnectionInfo ¶
type ConnectionInfo struct {
TenantId string `json:"tenant_id" validate:"required"`
}
func GetConnectionInfo ¶
func GetConnectionInfo(key string) (*ConnectionInfo, error)
get connection info by key
type DifyServer ¶
type DifyServer struct { gnet.BuiltinEventEngine // contains filtered or unexported fields }
func (*DifyServer) OnBoot ¶
func (s *DifyServer) OnBoot(c gnet.Engine) (action gnet.Action)
func (*DifyServer) OnClose ¶
func (s *DifyServer) OnClose(c gnet.Conn, err error) (action gnet.Action)
func (*DifyServer) OnOpen ¶
func (s *DifyServer) OnOpen(c gnet.Conn) (out []byte, action gnet.Action)
func (*DifyServer) OnShutdown ¶
func (s *DifyServer) OnShutdown(c gnet.Engine)
func (*DifyServer) OnTraffic ¶
func (s *DifyServer) OnTraffic(c gnet.Conn) (action gnet.Action)
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) Cleanup ¶
func (r *RemotePluginRuntime) Cleanup()
func (*RemotePluginRuntime) Identity ¶
func (r *RemotePluginRuntime) Identity() (plugin_entities.PluginUniqueIdentifier, error)
func (*RemotePluginRuntime) InitEnvironment ¶
func (r *RemotePluginRuntime) InitEnvironment() error
func (*RemotePluginRuntime) Listen ¶
func (r *RemotePluginRuntime) Listen(session_id string) *entities.Broadcast[plugin_entities.SessionMessage]
func (*RemotePluginRuntime) Register ¶
func (plugin *RemotePluginRuntime) Register() error
func (*RemotePluginRuntime) StartPlugin ¶
func (r *RemotePluginRuntime) StartPlugin() error
func (*RemotePluginRuntime) Stop ¶
func (r *RemotePluginRuntime) Stop()
func (*RemotePluginRuntime) Stopped ¶
func (r *RemotePluginRuntime) Stopped() bool
func (*RemotePluginRuntime) Type ¶
func (r *RemotePluginRuntime) Type() plugin_entities.PluginRuntimeType
func (*RemotePluginRuntime) Unregister ¶
func (plugin *RemotePluginRuntime) Unregister() error
func (*RemotePluginRuntime) Wait ¶
func (r *RemotePluginRuntime) Wait() (<-chan bool, error)
func (*RemotePluginRuntime) WaitStarted ¶
func (r *RemotePluginRuntime) WaitStarted() <-chan bool
func (*RemotePluginRuntime) WaitStopped ¶
func (r *RemotePluginRuntime) WaitStopped() <-chan bool
func (*RemotePluginRuntime) Write ¶
func (r *RemotePluginRuntime) Write(session_id string, action access_types.PluginAccessAction, data []byte)
type RemotePluginServer ¶
type RemotePluginServer struct {
// contains filtered or unexported fields
}
func NewRemotePluginServer ¶
func NewRemotePluginServer(config *app.Config, media_transport *media_transport.MediaBucket) *RemotePluginServer
NewRemotePluginServer creates a new RemotePluginServer
func (*RemotePluginServer) Launch ¶
func (r *RemotePluginServer) Launch() error
Launch starts the server
func (*RemotePluginServer) Next ¶
func (r *RemotePluginServer) Next() bool
Next returns true if there are more connections to be read
func (*RemotePluginServer) Read ¶
func (r *RemotePluginServer) Read() (plugin_entities.PluginFullDuplexLifetime, error)
continue accepting new connections
func (*RemotePluginServer) Wrap ¶
func (r *RemotePluginServer) Wrap(f func(plugin_entities.PluginFullDuplexLifetime))
Wrap wraps the wrap method of stream response
type RemotePluginServerInterface ¶
type RemotePluginServerInterface interface { Read() (plugin_entities.PluginFullDuplexLifetime, error) Next() bool Wrap(f func(plugin_entities.PluginFullDuplexLifetime)) Stop() error Launch() error }
Click to show internal directories.
Click to hide internal directories.