Documentation ¶
Index ¶
- Variables
- func HandleChatSend(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleDelNewsArt(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleDelNewsItem(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleDeleteFile(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleDeleteUser(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleDisconnectUser(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleDownloadBanner(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleDownloadFile(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleDownloadFolder(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleGetClientInfoText(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleGetFileInfo(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleGetFileNameList(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleGetMsgs(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleGetNewsArtData(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleGetNewsArtNameList(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleGetNewsCatNameList(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleGetUser(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleGetUserNameList(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleInviteNewChat(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleInviteToChat(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleJoinChat(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleKeepAlive(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleLeaveChat(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleListUsers(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleMakeAlias(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleMoveFile(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleNewFolder(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleNewNewsCat(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleNewNewsFldr(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleNewUser(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandlePostNewsArt(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleRejectChatInvite(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleSendInstantMsg(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleSetChatSubject(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleSetClientUserInfo(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleSetFileInfo(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleSetUser(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleTranAgreed(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleTranOldPostNews(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleUpdateUser(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleUploadFile(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleUploadFolder(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func HandleUserBroadcast(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
- func LoadConfig(path string) (*hotline.Config, error)
- func NewLogResponseWriter(w http.ResponseWriter) *logResponseWriter
- func NewLogger(logLevel, logFile *string) *slog.Logger
- func RegisterHandlers(srv *hotline.Server)
- type APIServer
- type Agreement
- type BanFile
- type FlatNews
- type MockAccountManager
- func (m *MockAccountManager) Create(account hotline.Account) error
- func (m *MockAccountManager) Delete(login string) error
- func (m *MockAccountManager) Get(login string) *hotline.Account
- func (m *MockAccountManager) List() []hotline.Account
- func (m *MockAccountManager) Update(account hotline.Account, newLogin string) error
- type ThreadedNewsYAML
- func (n *ThreadedNewsYAML) CreateGrouping(newsPath []string, name string, t [2]byte) error
- func (n *ThreadedNewsYAML) DeleteArticle(newsPath []string, articleID uint32, _ bool) error
- func (n *ThreadedNewsYAML) DeleteNewsItem(newsPath []string) error
- func (n *ThreadedNewsYAML) GetArticle(newsPath []string, articleID uint32) *hotline.NewsArtData
- func (n *ThreadedNewsYAML) GetCategories(paths []string) []hotline.NewsCategoryListData15
- func (n *ThreadedNewsYAML) ListArticles(newsPath []string) hotline.NewsArtListData
- func (n *ThreadedNewsYAML) Load() error
- func (n *ThreadedNewsYAML) NewsItem(newsPath []string) hotline.NewsCategoryListData15
- func (n *ThreadedNewsYAML) PostArticle(newsPath []string, parentArticleID uint32, article hotline.NewsArtData) error
- type YAMLAccountManager
- func (am *YAMLAccountManager) Create(account hotline.Account) error
- func (am *YAMLAccountManager) Delete(login string) error
- func (am *YAMLAccountManager) Get(login string) *hotline.Account
- func (am *YAMLAccountManager) List() []hotline.Account
- func (am *YAMLAccountManager) Update(account hotline.Account, newLogin string) error
Constants ¶
This section is empty.
Variables ¶
var ConfigSearchOrder = []string{
"config",
"/usr/local/var/mobius/config",
"/opt/homebrew/var/mobius/config",
}
Functions ¶
func HandleChatSend ¶
func HandleChatSend(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
func HandleDelNewsArt ¶
func HandleDelNewsArt(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
HandleDelNewsArt deletes a threaded news article. Request Fields 325 News path 326 News article Type 337 News article recursive delete - Delete child articles (1) or not (0)
func HandleDelNewsItem ¶
func HandleDelNewsItem(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
HandleDelNewsItem deletes a threaded news folder or category. Fields used in the request: 325 News path Fields used in the reply: None
func HandleDeleteFile ¶
func HandleDeleteFile(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
HandleDeleteFile deletes a file or folder Fields used in the request: * 201 File Name * 202 File path Fields used in the reply: none
func HandleDeleteUser ¶
func HandleDeleteUser(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
func HandleDisconnectUser ¶
func HandleDisconnectUser(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
func HandleDownloadBanner ¶
func HandleDownloadBanner(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
HandleDownloadBanner handles requests for a new banner from the server Fields used in the request: None Fields used in the reply: 107 FieldRefNum Used later for transfer 108 FieldTransferSize Size of data to be downloaded
func HandleDownloadFile ¶
func HandleDownloadFile(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
func HandleDownloadFolder ¶
func HandleDownloadFolder(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
Download all files from the specified folder and sub-folders
func HandleGetClientInfoText ¶
func HandleGetClientInfoText(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
HandleGetClientInfoText returns user information for the specific user.
Fields used in the request: 103 User Type
Fields used in the reply: 102 User Name 101 Data User info text string
func HandleGetFileInfo ¶
func HandleGetFileInfo(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
func HandleGetFileNameList ¶
func HandleGetFileNameList(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
func HandleGetMsgs ¶
func HandleGetMsgs(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
HandleGetMsgs returns the flat news data
func HandleGetNewsArtData ¶
func HandleGetNewsArtData(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
HandleGetNewsArtData requests information about the specific news article. Fields used in the request:
Request fields 325 News path 326 News article Type 327 News article data flavor
Fields used in the reply: 328 News article title 329 News article poster 330 News article date 331 Previous article Type 332 Next article Type 335 Parent article Type 336 First child article Type 327 News article data flavor "Should be “text/plain” 333 News article data Optional (if data flavor is “text/plain”)
func HandleGetNewsArtNameList ¶
func HandleGetNewsArtNameList(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
Fields used in the reply: 321 News article list data Optional
func HandleGetNewsCatNameList ¶
func HandleGetNewsCatNameList(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
HandleGetNewsCatNameList returns a list of news categories for a path Fields used in the request: 325 News path (Optional)
func HandleGetUser ¶
func HandleGetUser(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
func HandleGetUserNameList ¶
func HandleGetUserNameList(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
func HandleInviteNewChat ¶
func HandleInviteNewChat(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
HandleInviteNewChat invites users to new private chat
func HandleInviteToChat ¶
func HandleInviteToChat(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
func HandleJoinChat ¶
func HandleJoinChat(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
HandleJoinChat is sent from a v1.8+ Hotline client when the joins a private chat Fields used in the reply: * 115 Chat subject * 300 User Name with info (Optional) * 300 (more user names with info)
func HandleKeepAlive ¶
func HandleKeepAlive(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
HandleKeepAlive responds to keepalive transactions with an empty reply * HL 1.9.2 Client sends keepalive msg every 3 minutes * HL 1.2.3 Client doesn't send keepalives
func HandleLeaveChat ¶
func HandleLeaveChat(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
HandleLeaveChat is sent from a v1.8+ Hotline client when the user exits a private chat Fields used in the request:
- 114 FieldChatID
Reply is not expected.
func HandleListUsers ¶
func HandleListUsers(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
func HandleMakeAlias ¶
func HandleMakeAlias(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
HandleMakeAlias makes a file alias using the specified path. Fields used in the request: 201 File Name 202 File path 212 File new path Destination path
Fields used in the reply: None
func HandleMoveFile ¶
func HandleMoveFile(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
HandleMoveFile moves files or folders. Note: seemingly not documented
func HandleNewFolder ¶
func HandleNewFolder(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
func HandleNewNewsCat ¶
func HandleNewNewsCat(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
func HandleNewNewsFldr ¶
func HandleNewNewsFldr(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
Fields used in the request: 322 News category Name 325 News path
func HandleNewUser ¶
func HandleNewUser(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
HandleNewUser creates a new user account
func HandlePostNewsArt ¶
func HandlePostNewsArt(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
Request fields 325 News path 326 News article Type Type of the parent article? 328 News article title 334 News article flags 327 News article data flavor Currently “text/plain” 333 News article data
func HandleRejectChatInvite ¶
func HandleRejectChatInvite(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
func HandleSendInstantMsg ¶
func HandleSendInstantMsg(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
HandleSendInstantMsg sends instant message to the user on the current server. Fields used in the request:
103 User Type 113 Options One of the following values: - User message (myOpt_UserMessage = 1) - Refuse message (myOpt_RefuseMessage = 2) - Refuse chat (myOpt_RefuseChat = 3) - Automatic response (myOpt_AutomaticResponse = 4)" 101 Data Optional 214 Quoting message Optional
Fields used in the reply: None
func HandleSetChatSubject ¶
func HandleSetChatSubject(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
HandleSetChatSubject is sent from a v1.8+ Hotline client when the user sets a private chat subject Fields used in the request: * 114 Chat Type * 115 Chat subject Reply is not expected.
func HandleSetClientUserInfo ¶
func HandleSetClientUserInfo(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
func HandleSetFileInfo ¶
func HandleSetFileInfo(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
HandleSetFileInfo updates a file or folder Name and/or comment from the Get Info window Fields used in the request: * 201 File Name * 202 File path Optional * 211 File new Name Optional * 210 File comment Optional Fields used in the reply: None
func HandleSetUser ¶
func HandleSetUser(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
func HandleTranAgreed ¶
func HandleTranAgreed(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
func HandleTranOldPostNews ¶
func HandleTranOldPostNews(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
HandleTranOldPostNews updates the flat news Fields used in this request: 101 Data
func HandleUpdateUser ¶
func HandleUpdateUser(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
HandleUpdateUser is used by the v1.5+ multi-user editor to perform account editing for multiple users at a time. An update can be a mix of these actions: * Create user * Delete user * Modify user (including renaming the account login)
The Transaction sent by the client includes one data field per user that was modified. This data field in turn contains another data field encoded in its payload with a varying number of sub fields depending on which action is performed. This seems to be the only place in the Hotline protocol where a data field contains another data field.
func HandleUploadFile ¶
func HandleUploadFile(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
HandleUploadFile Fields used in the request: 201 File Name 202 File path 204 File transfer options "Optional Used only to resume download, currently has value 2" 108 File transfer size "Optional used if download is not resumed"
func HandleUploadFolder ¶
func HandleUploadFolder(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
Upload all files from the local folder and its subfolders to the specified path on the server Fields used in the request 201 File Name 202 File path 108 hotline.Transfer size Total size of all items in the folder 220 Folder item count 204 File transfer options "Optional Currently set to 1" (TODO: ??)
func HandleUserBroadcast ¶
func HandleUserBroadcast(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotline.Transaction)
HandleUserBroadcast sends an Administrator Message to all connected clients of the server
func NewLogResponseWriter ¶ added in v0.14.0
func NewLogResponseWriter(w http.ResponseWriter) *logResponseWriter
func RegisterHandlers ¶
Assign functions to handle specific Hotline transaction types
Types ¶
type APIServer ¶ added in v0.14.0
type APIServer struct {
// contains filtered or unexported fields
}
func NewAPIServer ¶ added in v0.14.0
func (*APIServer) ReloadHandler ¶ added in v0.14.0
func (srv *APIServer) ReloadHandler(reloadFunc func()) func(w http.ResponseWriter, _ *http.Request)
func (*APIServer) RenderStats ¶ added in v0.14.0
func (srv *APIServer) RenderStats(w http.ResponseWriter, _ *http.Request)
func (*APIServer) ShutdownHandler ¶ added in v0.14.0
func (srv *APIServer) ShutdownHandler(w http.ResponseWriter, r *http.Request)
type Agreement ¶
type Agreement struct {
// contains filtered or unexported fields
}
func NewAgreement ¶
type BanFile ¶
func NewBanFile ¶
type FlatNews ¶
type FlatNews struct {
// contains filtered or unexported fields
}
func NewFlatNews ¶
type MockAccountManager ¶
func (*MockAccountManager) Create ¶
func (m *MockAccountManager) Create(account hotline.Account) error
func (*MockAccountManager) Delete ¶
func (m *MockAccountManager) Delete(login string) error
func (*MockAccountManager) List ¶
func (m *MockAccountManager) List() []hotline.Account
type ThreadedNewsYAML ¶
type ThreadedNewsYAML struct { ThreadedNews hotline.ThreadedNews // contains filtered or unexported fields }
func NewThreadedNewsYAML ¶
func NewThreadedNewsYAML(filePath string) (*ThreadedNewsYAML, error)
func (*ThreadedNewsYAML) CreateGrouping ¶
func (n *ThreadedNewsYAML) CreateGrouping(newsPath []string, name string, t [2]byte) error
func (*ThreadedNewsYAML) DeleteArticle ¶
func (n *ThreadedNewsYAML) DeleteArticle(newsPath []string, articleID uint32, _ bool) error
func (*ThreadedNewsYAML) DeleteNewsItem ¶
func (n *ThreadedNewsYAML) DeleteNewsItem(newsPath []string) error
func (*ThreadedNewsYAML) GetArticle ¶
func (n *ThreadedNewsYAML) GetArticle(newsPath []string, articleID uint32) *hotline.NewsArtData
func (*ThreadedNewsYAML) GetCategories ¶
func (n *ThreadedNewsYAML) GetCategories(paths []string) []hotline.NewsCategoryListData15
func (*ThreadedNewsYAML) ListArticles ¶
func (n *ThreadedNewsYAML) ListArticles(newsPath []string) hotline.NewsArtListData
func (*ThreadedNewsYAML) Load ¶
func (n *ThreadedNewsYAML) Load() error
func (*ThreadedNewsYAML) NewsItem ¶
func (n *ThreadedNewsYAML) NewsItem(newsPath []string) hotline.NewsCategoryListData15
func (*ThreadedNewsYAML) PostArticle ¶
func (n *ThreadedNewsYAML) PostArticle(newsPath []string, parentArticleID uint32, article hotline.NewsArtData) error
type YAMLAccountManager ¶
type YAMLAccountManager struct {
// contains filtered or unexported fields
}
func NewYAMLAccountManager ¶
func NewYAMLAccountManager(accountDir string) (*YAMLAccountManager, error)
func (*YAMLAccountManager) Create ¶
func (am *YAMLAccountManager) Create(account hotline.Account) error
func (*YAMLAccountManager) Delete ¶
func (am *YAMLAccountManager) Delete(login string) error
func (*YAMLAccountManager) List ¶
func (am *YAMLAccountManager) List() []hotline.Account