{"modulePath":"github.com/nmintoh/dserver","version":"v5.1.2+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package rpcplugin\n\n## Constants\n\n```go\nconst (\n\tMaxProcessRestarts = 3\n)\n```\n\n## Functions\n\n```go\nfunc ConnectIOReader(conn io.ReadWriteCloser) io.ReadCloser\n```\n\n```go\nfunc InheritedIPC(fd0, fd1 uintptr) (io.ReadWriteCloser, error)\n```\nReturns the IPC instance inherited by the process from its parent.\n\n```go\nfunc InheritedProcessIPC() (io.ReadWriteCloser, error)\n```\nWhen called on a process launched with NewProcess, returns the inherited IPC.\n\n```go\nfunc Main(hooks interface{})\n```\nMakes a set of hooks available via RPC. This function never returns.\n\n```go\nfunc NewIPC() (io.ReadWriteCloser, []*os.File, error)\n```\nReturns a new IPC for the parent process and a set of files to pass on to the child.\n\nThe returned files must be closed after the child process is started.\n\n```go\nfunc NewReadWriteCloser(r io.ReadCloser, w io.WriteCloser) io.ReadWriteCloser\n```\n\n```go\nfunc ServeAPI(api plugin.API, conn io.ReadWriteCloser, muxer *Muxer)\n```\n\n```go\nfunc ServeHTTPResponseWriter(w http.ResponseWriter, conn io.ReadWriteCloser)\n```\n\n```go\nfunc ServeHooks(hooks interface{}, conn io.ReadWriteCloser, muxer *Muxer)\n```\n\n```go\nfunc ServeIOReader(r io.Reader, conn io.ReadWriteCloser)\n```\n\n```go\nfunc SupervisorProvider(bundle *model.BundleInfo) (plugin.Supervisor, error)\n```\n\n```go\nfunc SupervisorWithNewProcessFunc(bundle *model.BundleInfo, newProcess func(context.Context) (Process, io.ReadWriteCloser, error)) (plugin.Supervisor, error)\n```\n\n## Types\n\n```go\ntype APIAddChannelMemberArgs struct {\n\tChannelId string\n\tUserId    string\n}\n```\n\n```go\ntype APIChannelMemberReply struct {\n\tChannelMember *model.ChannelMember\n\tError         *model.AppError\n}\n```\n\n```go\ntype APIChannelReply struct {\n\tChannel *model.Channel\n\tError   *model.AppError\n}\n```\n\n```go\ntype APIDeleteChannelMemberArgs struct {\n\tChannelId string\n\tUserId    string\n}\n```\n\n```go\ntype APIErrorReply struct {\n\tError *model.AppError\n}\n```\n\n```go\ntype APIGetChannelByNameArgs struct {\n\tName   string\n\tTeamId string\n}\n```\n\n```go\ntype APIGetChannelMemberArgs struct {\n\tChannelId string\n\tUserId    string\n}\n```\n\n```go\ntype APIGetDirectChannelArgs struct {\n\tUserId1 string\n\tUserId2 string\n}\n```\n\n```go\ntype APIGetGroupChannelArgs struct {\n\tUserIds []string\n}\n```\n\n```go\ntype APIKeyValueStoreReply struct {\n\tValue []byte\n\tError *model.AppError\n}\n```\n\n```go\ntype APIKeyValueStoreSetArgs struct {\n\tKey   string\n\tValue []byte\n}\n```\n\n```go\ntype APIPostReply struct {\n\tPost  *model.Post\n\tError *model.AppError\n}\n```\n\n```go\ntype APITeamReply struct {\n\tTeam  *model.Team\n\tError *model.AppError\n}\n```\n\n```go\ntype APIUnregisterCommandArgs struct {\n\tTeamId  string\n\tTrigger string\n}\n```\n\n```go\ntype APIUpdateChannelMemberNotificationsArgs struct {\n\tChannelId     string\n\tUserId        string\n\tNotifications map[string]string\n}\n```\n\n```go\ntype APIUpdateChannelMemberRolesArgs struct {\n\tChannelId string\n\tUserId    string\n\tNewRoles  string\n}\n```\n\n```go\ntype APIUserReply struct {\n\tUser  *model.User\n\tError *model.AppError\n}\n```\n\n```go\ntype HooksExecuteCommandReply struct {\n\tResponse *model.CommandResponse\n\tError    *model.AppError\n}\n```\n\n```go\ntype LocalAPI struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (api *LocalAPI) AddChannelMember(args *APIAddChannelMemberArgs, reply *APIChannelMemberReply) error\n```\n\n```go\nfunc (api *LocalAPI) CreateChannel(args *model.Channel, reply *APIChannelReply) error\n```\n\n```go\nfunc (api *LocalAPI) CreatePost(args *model.Post, reply *APIPostReply) error\n```\n\n```go\nfunc (api *LocalAPI) CreateTeam(args *model.Team, reply *APITeamReply) error\n```\n\n```go\nfunc (api *LocalAPI) CreateUser(args *model.User, reply *APIUserReply) error\n```\n\n```go\nfunc (api *LocalAPI) DeleteChannel(args string, reply *APIErrorReply) error\n```\n\n```go\nfunc (api *LocalAPI) DeleteChannelMember(args *APIDeleteChannelMemberArgs, reply *APIErrorReply) error\n```\n\n```go\nfunc (api *LocalAPI) DeletePost(args string, reply *APIErrorReply) error\n```\n\n```go\nfunc (api *LocalAPI) DeleteTeam(args string, reply *APIErrorReply) error\n```\n\n```go\nfunc (api *LocalAPI) DeleteUser(args string, reply *APIErrorReply) error\n```\n\n```go\nfunc (api *LocalAPI) GetChannel(args string, reply *APIChannelReply) error\n```\n\n```go\nfunc (api *LocalAPI) GetChannelByName(args *APIGetChannelByNameArgs, reply *APIChannelReply) error\n```\n\n```go\nfunc (api *LocalAPI) GetChannelMember(args *APIGetChannelMemberArgs, reply *APIChannelMemberReply) error\n```\n\n```go\nfunc (api *LocalAPI) GetDirectChannel(args *APIGetDirectChannelArgs, reply *APIChannelReply) error\n```\n\n```go\nfunc (api *LocalAPI) GetGroupChannel(args *APIGetGroupChannelArgs, reply *APIChannelReply) error\n```\n\n```go\nfunc (api *LocalAPI) GetPost(args string, reply *APIPostReply) error\n```\n\n```go\nfunc (api *LocalAPI) GetTeam(args string, reply *APITeamReply) error\n```\n\n```go\nfunc (api *LocalAPI) GetTeamByName(args string, reply *APITeamReply) error\n```\n\n```go\nfunc (api *LocalAPI) GetUser(args string, reply *APIUserReply) error\n```\n\n```go\nfunc (api *LocalAPI) GetUserByEmail(args string, reply *APIUserReply) error\n```\n\n```go\nfunc (api *LocalAPI) GetUserByUsername(args string, reply *APIUserReply) error\n```\n\n```go\nfunc (api *LocalAPI) KeyValueStoreDelete(args string, reply *APIErrorReply) error\n```\n\n```go\nfunc (api *LocalAPI) KeyValueStoreGet(args string, reply *APIKeyValueStoreReply) error\n```\n\n```go\nfunc (api *LocalAPI) KeyValueStoreSet(args *APIKeyValueStoreSetArgs, reply *APIErrorReply) error\n```\n\n```go\nfunc (api *LocalAPI) LoadPluginConfiguration(args struct{}, reply *[]byte) error\n```\n\n```go\nfunc (api *LocalAPI) RegisterCommand(args *model.Command, reply *APITeamReply) error\n```\n\n```go\nfunc (api *LocalAPI) UnregisterCommand(args *APIUnregisterCommandArgs, reply *APITeamReply) error\n```\n\n```go\nfunc (api *LocalAPI) UpdateChannel(args *model.Channel, reply *APIChannelReply) error\n```\n\n```go\nfunc (api *LocalAPI) UpdateChannelMemberNotifications(args *APIUpdateChannelMemberNotificationsArgs, reply *APIChannelMemberReply) error\n```\n\n```go\nfunc (api *LocalAPI) UpdateChannelMemberRoles(args *APIUpdateChannelMemberRolesArgs, reply *APIChannelMemberReply) error\n```\n\n```go\nfunc (api *LocalAPI) UpdatePost(args *model.Post, reply *APIPostReply) error\n```\n\n```go\nfunc (api *LocalAPI) UpdateTeam(args *model.Team, reply *APITeamReply) error\n```\n\n```go\nfunc (api *LocalAPI) UpdateUser(args *model.User, reply *APIUserReply) error\n```\n\n```go\ntype LocalHTTPResponseWriter struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (w *LocalHTTPResponseWriter) Header(args struct{}, reply *http.Header) error\n```\n\n```go\nfunc (w *LocalHTTPResponseWriter) SyncHeader(args http.Header, reply *struct{}) error\n```\n\n```go\nfunc (w *LocalHTTPResponseWriter) Write(args []byte, reply *struct{}) error\n```\n\n```go\nfunc (w *LocalHTTPResponseWriter) WriteHeader(args int, reply *struct{}) error\n```\n\n```go\ntype LocalHooks struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (h *LocalHooks) ExecuteCommand(args *model.CommandArgs, reply *HooksExecuteCommandReply) error\n```\n\n```go\nfunc (h *LocalHooks) Implemented(args struct{}, reply *[]string) error\n```\nImplemented replies with the names of the hooks that are implemented.\n\n```go\nfunc (h *LocalHooks) MessageHasBeenPosted(args *model.Post, reply *struct{}) error\n```\n\n```go\nfunc (h *LocalHooks) MessageHasBeenUpdated(args *MessageUpdatedArgs, reply *struct{}) error\n```\n\n```go\nfunc (h *LocalHooks) MessageWillBePosted(args *model.Post, reply *MessageWillBeReply) error\n```\n\n```go\nfunc (h *LocalHooks) MessageWillBeUpdated(args *MessageUpdatedArgs, reply *MessageWillBeReply) error\n```\n\n```go\nfunc (h *LocalHooks) OnActivate(args int64, reply *struct{}) error\n```\n\n```go\nfunc (h *LocalHooks) OnConfigurationChange(args, reply *struct{}) error\n```\n\n```go\nfunc (h *LocalHooks) OnDeactivate(args, reply *struct{}) (err error)\n```\n\n```go\nfunc (h *LocalHooks) ServeHTTP(args ServeHTTPArgs, reply *struct{}) error\n```\n\n```go\ntype MessageUpdatedArgs struct {\n\tNewPost *model.Post\n\tOldPost *model.Post\n}\n```\n\n```go\ntype MessageWillBeReply struct {\n\tPost            *model.Post\n\tRejectionReason string\n}\n```\n\n```go\ntype Muxer struct {\n\t// contains filtered or unexported fields\n}\n```\nMuxer allows multiple bidirectional streams to be transmitted over a single connection.\n\nMuxer is safe for use by multiple goroutines.\n\nStreams opened on the muxer must be periodically drained in order to reclaim read buffer memory. In other words, readers must consume incoming data as it comes in.\n\n```go\nfunc NewMuxer(conn io.ReadWriteCloser, parity bool) *Muxer\n```\nCreates a new Muxer.\n\nconn must be safe for simultaneous reads by one goroutine and writes by another.\n\nFor two muxers communicating with each other via a connection, parity must be true for exactly one of them.\n\n```go\nfunc (m *Muxer) Close() error\n```\nCloses the muxer.\n\n```go\nfunc (m *Muxer) Connect(id int64) io.ReadWriteCloser\n```\nOpens a remotely opened stream.\n\n```go\nfunc (m *Muxer) IsClosed() bool\n```\n\n```go\nfunc (m *Muxer) Read(p []byte) (int, error)\n```\nCalling Read on the muxer directly performs a read on a dedicated, always-open channel.\n\n```go\nfunc (m *Muxer) Serve() (int64, io.ReadWriteCloser)\n```\nOpens a new stream with a unique id.\n\nWrites made to the stream before the other end calls Connect will be discarded.\n\n```go\nfunc (m *Muxer) Write(p []byte) (int, error)\n```\nCalling Write on the muxer directly performs a write on a dedicated, always-open channel.\n\n```go\ntype Process interface {\n\t// Waits for the process to exit and returns an error if a problem occurred or the process exited\n\t// with a non-zero status.\n\tWait() error\n}\n```\n\n```go\nfunc NewProcess(ctx context.Context, path string) (Process, io.ReadWriteCloser, error)\n```\nNewProcess launches an RPC executable in a new process and returns an IPC that can be used to communicate with it.\n\n```go\ntype RemoteAPI struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc ConnectAPI(conn io.ReadWriteCloser, muxer *Muxer) *RemoteAPI\n```\n\n```go\nfunc (api *RemoteAPI) AddChannelMember(channelId, userId string) (*model.ChannelMember, *model.AppError)\n```\n\n```go\nfunc (h *RemoteAPI) Close() error\n```\n\n```go\nfunc (api *RemoteAPI) CreateChannel(channel *model.Channel) (*model.Channel, *model.AppError)\n```\n\n```go\nfunc (api *RemoteAPI) CreatePost(post *model.Post) (*model.Post, *model.AppError)\n```\n\n```go\nfunc (api *RemoteAPI) CreateTeam(team *model.Team) (*model.Team, *model.AppError)\n```\n\n```go\nfunc (api *RemoteAPI) CreateUser(user *model.User) (*model.User, *model.AppError)\n```\n\n```go\nfunc (api *RemoteAPI) DeleteChannel(channelId string) *model.AppError\n```\n\n```go\nfunc (api *RemoteAPI) DeleteChannelMember(channelId, userId string) *model.AppError\n```\n\n```go\nfunc (api *RemoteAPI) DeletePost(postId string) *model.AppError\n```\n\n```go\nfunc (api *RemoteAPI) DeleteTeam(teamId string) *model.AppError\n```\n\n```go\nfunc (api *RemoteAPI) DeleteUser(userId string) *model.AppError\n```\n\n```go\nfunc (api *RemoteAPI) GetChannel(channelId string) (*model.Channel, *model.AppError)\n```\n\n```go\nfunc (api *RemoteAPI) GetChannelByName(name, teamId string) (*model.Channel, *model.AppError)\n```\n\n```go\nfunc (api *RemoteAPI) GetChannelMember(channelId, userId string) (*model.ChannelMember, *model.AppError)\n```\n\n```go\nfunc (api *RemoteAPI) GetDirectChannel(userId1, userId2 string) (*model.Channel, *model.AppError)\n```\n\n```go\nfunc (api *RemoteAPI) GetGroupChannel(userIds []string) (*model.Channel, *model.AppError)\n```\n\n```go\nfunc (api *RemoteAPI) GetPost(postId string) (*model.Post, *model.AppError)\n```\n\n```go\nfunc (api *RemoteAPI) GetTeam(teamId string) (*model.Team, *model.AppError)\n```\n\n```go\nfunc (api *RemoteAPI) GetTeamByName(name string) (*model.Team, *model.AppError)\n```\n\n```go\nfunc (api *RemoteAPI) GetUser(userId string) (*model.User, *model.AppError)\n```\n\n```go\nfunc (api *RemoteAPI) GetUserByEmail(email string) (*model.User, *model.AppError)\n```\n\n```go\nfunc (api *RemoteAPI) GetUserByUsername(name string) (*model.User, *model.AppError)\n```\n\n```go\nfunc (api *RemoteAPI) KeyValueStore() plugin.KeyValueStore\n```\n\n```go\nfunc (api *RemoteAPI) LoadPluginConfiguration(dest interface{}) error\n```\n\n```go\nfunc (api *RemoteAPI) RegisterCommand(command *model.Command) error\n```\n\n```go\nfunc (api *RemoteAPI) UnregisterCommand(teamId, trigger string) error\n```\n\n```go\nfunc (api *RemoteAPI) UpdateChannel(channel *model.Channel) (*model.Channel, *model.AppError)\n```\n\n```go\nfunc (api *RemoteAPI) UpdateChannelMemberNotifications(channelId, userId string, notifications map[string]string) (*model.ChannelMember, *model.AppError)\n```\n\n```go\nfunc (api *RemoteAPI) UpdateChannelMemberRoles(channelId, userId, newRoles string) (*model.ChannelMember, *model.AppError)\n```\n\n```go\nfunc (api *RemoteAPI) UpdatePost(post *model.Post) (*model.Post, *model.AppError)\n```\n\n```go\nfunc (api *RemoteAPI) UpdateTeam(team *model.Team) (*model.Team, *model.AppError)\n```\n\n```go\nfunc (api *RemoteAPI) UpdateUser(user *model.User) (*model.User, *model.AppError)\n```\n\n```go\ntype RemoteHTTPResponseWriter struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc ConnectHTTPResponseWriter(conn io.ReadWriteCloser) *RemoteHTTPResponseWriter\n```\n\n```go\nfunc (h *RemoteHTTPResponseWriter) Close() error\n```\n\n```go\nfunc (w *RemoteHTTPResponseWriter) Header() http.Header\n```\n\n```go\nfunc (w *RemoteHTTPResponseWriter) Write(b []byte) (int, error)\n```\n\n```go\nfunc (w *RemoteHTTPResponseWriter) WriteHeader(statusCode int)\n```\n\n```go\ntype RemoteHooks struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc ConnectHooks(conn io.ReadWriteCloser, muxer *Muxer, pluginId string) (*RemoteHooks, error)\n```\n\n```go\nfunc ConnectMain(muxer *Muxer, pluginId string) (*RemoteHooks, error)\n```\nReturns the hooks being served by a call to Main.\n\n```go\nfunc (h *RemoteHooks) Close() error\n```\n\n```go\nfunc (h *RemoteHooks) ExecuteCommand(args *model.CommandArgs) (*model.CommandResponse, *model.AppError)\n```\n\n```go\nfunc (h *RemoteHooks) Implemented() (impl []string, err error)\n```\n\n```go\nfunc (h *RemoteHooks) MessageHasBeenPosted(args *model.Post)\n```\n\n```go\nfunc (h *RemoteHooks) MessageHasBeenUpdated(newPost, oldPost *model.Post)\n```\n\n```go\nfunc (h *RemoteHooks) MessageWillBePosted(args *model.Post) (*model.Post, string)\n```\n\n```go\nfunc (h *RemoteHooks) MessageWillBeUpdated(newPost, oldPost *model.Post) (*model.Post, string)\n```\n\n```go\nfunc (h *RemoteHooks) OnActivate(api plugin.API) error\n```\n\n```go\nfunc (h *RemoteHooks) OnConfigurationChange() error\n```\n\n```go\nfunc (h *RemoteHooks) OnDeactivate() error\n```\n\n```go\nfunc (h *RemoteHooks) ServeHTTP(w http.ResponseWriter, r *http.Request)\n```\n\n```go\ntype RemoteIOReader struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (r *RemoteIOReader) Close() error\n```\n\n```go\nfunc (r *RemoteIOReader) Read(b []byte) (int, error)\n```\n\n```go\ntype RemoteKeyValueStore struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (s *RemoteKeyValueStore) Delete(key string) *model.AppError\n```\n\n```go\nfunc (s *RemoteKeyValueStore) Get(key string) ([]byte, *model.AppError)\n```\n\n```go\nfunc (s *RemoteKeyValueStore) Set(key string, value []byte) *model.AppError\n```\n\n```go\ntype ServeHTTPArgs struct {\n\tResponseWriterStream int64\n\tRequest              *http.Request\n\tRequestBodyStream    int64\n}\n```\n\n```go\ntype Supervisor struct {\n\t// contains filtered or unexported fields\n}\n```\nSupervisor implements a plugin.Supervisor that launches the plugin in a separate process and communicates via RPC.\n\nIf the plugin unexpectedly exits, the supervisor will relaunch it after a short delay, but will only restart a plugin at most three times.\n\n```go\nfunc (s *Supervisor) Hooks() plugin.Hooks\n```\nReturns the hooks used to communicate with the plugin. The hooks may change if the plugin is restarted, so the return value should not be cached.\n\n```go\nfunc (s *Supervisor) Start(api plugin.API) error\n```\nStarts the plugin. This method will block until the plugin is successfully launched for the first time and will return an error if the plugin cannot be launched at all.\n\n```go\nfunc (s *Supervisor) Stop() error\n```\nStops the plugin.\n\n```go\nfunc (s *Supervisor) Wait() error\n```\nWaits for the supervisor to stop (on demand or of its own accord), returning any error that triggered the supervisor to stop.\n\n","path":"github.com/nmintoh/dserver/plugin/rpcplugin","name":"rpcplugin","synopsis":"","isRedistributable":true}
