server

package
v0.0.66 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: GPL-3.0 Imports: 47 Imported by: 1

Documentation

Index

Constants

View Source
const (
	RpcErrorCode_FirewallIsDisabled = 1
	RpcErrorCode_IPAddressIsNotSet  = 2
	RpcErrorCode_BlockTimeIsNotSet  = 3
)

Codes.

View Source
const (
	RpcErrorMsg_FirewallIsDisabled = "Firewall is disabled"
	RpcErrorMsg_IPAddressIsNotSet  = "IP address is not set"
	RpcErrorMsg_BlockTimeIsNotSet  = "Block time is not set"
)

Messages.

View Source
const (
	// ACM.
	ApiFunctionName_RegisterUser                           = "registerUser"
	ApiFunctionName_GetListOfRegistrationsReadyForApproval = "getListOfRegistrationsReadyForApproval"
	ApiFunctionName_RejectRegistrationRequest              = "rejectRegistrationRequest"
	ApiFunctionName_ApproveAndRegisterUser                 = "approveAndRegisterUser"
	ApiFunctionName_LogUserIn                              = "logUserIn"
	ApiFunctionName_LogUserOut                             = "logUserOut"
	ApiFunctionName_LogUserOutA                            = "logUserOutA"
	ApiFunctionName_GetListOfLoggedUsers                   = "getListOfLoggedUsers"
	ApiFunctionName_GetListOfLoggedUsersOnPage             = "getListOfLoggedUsersOnPage"
	ApiFunctionName_GetListOfAllUsers                      = "getListOfAllUsers"
	ApiFunctionName_GetListOfAllUsersOnPage                = "getListOfAllUsersOnPage"
	ApiFunctionName_IsUserLoggedIn                         = "isUserLoggedIn"
	ApiFunctionName_ChangePassword                         = "changePassword"
	ApiFunctionName_ChangeEmail                            = "changeEmail"
	ApiFunctionName_GetUserSession                         = "getUserSession"
	ApiFunctionName_GetUserName                            = "getUserName"
	ApiFunctionName_GetUserRoles                           = "getUserRoles"
	ApiFunctionName_ViewUserParameters                     = "viewUserParameters"
	ApiFunctionName_SetUserRoleAuthor                      = "setUserRoleAuthor"
	ApiFunctionName_SetUserRoleWriter                      = "setUserRoleWriter"
	ApiFunctionName_SetUserRoleReader                      = "setUserRoleReader"
	ApiFunctionName_GetSelfRoles                           = "getSelfRoles"
	ApiFunctionName_BanUser                                = "banUser"
	ApiFunctionName_UnbanUser                              = "unbanUser"

	// MM.
	ApiFunctionName_AddSection                  = "addSection"
	ApiFunctionName_ChangeSectionName           = "changeSectionName"
	ApiFunctionName_ChangeSectionParent         = "changeSectionParent"
	ApiFunctionName_GetSection                  = "getSection"
	ApiFunctionName_MoveSectionUp               = "moveSectionUp"
	ApiFunctionName_MoveSectionDown             = "moveSectionDown"
	ApiFunctionName_DeleteSection               = "deleteSection"
	ApiFunctionName_AddForum                    = "addForum"
	ApiFunctionName_ChangeForumName             = "changeForumName"
	ApiFunctionName_ChangeForumSection          = "changeForumSection"
	ApiFunctionName_GetForum                    = "getForum"
	ApiFunctionName_MoveForumUp                 = "moveForumUp"
	ApiFunctionName_MoveForumDown               = "moveForumDown"
	ApiFunctionName_DeleteForum                 = "deleteForum"
	ApiFunctionName_AddThread                   = "addThread"
	ApiFunctionName_ChangeThreadName            = "changeThreadName"
	ApiFunctionName_ChangeThreadForum           = "changeThreadForum"
	ApiFunctionName_GetThread                   = "getThread"
	ApiFunctionName_GetThreadNamesByIds         = "getThreadNamesByIds"
	ApiFunctionName_MoveThreadUp                = "moveThreadUp"
	ApiFunctionName_MoveThreadDown              = "moveThreadDown"
	ApiFunctionName_DeleteThread                = "deleteThread"
	ApiFunctionName_AddMessage                  = "addMessage"
	ApiFunctionName_ChangeMessageText           = "changeMessageText"
	ApiFunctionName_ChangeMessageThread         = "changeMessageThread"
	ApiFunctionName_GetMessage                  = "getMessage"
	ApiFunctionName_GetLatestMessageOfThread    = "getLatestMessageOfThread"
	ApiFunctionName_DeleteMessage               = "deleteMessage"
	ApiFunctionName_ListThreadAndMessages       = "listThreadAndMessages"
	ApiFunctionName_ListThreadAndMessagesOnPage = "listThreadAndMessagesOnPage"
	ApiFunctionName_ListForumAndThreads         = "listForumAndThreads"
	ApiFunctionName_ListForumAndThreadsOnPage   = "listForumAndThreadsOnPage"
	ApiFunctionName_ListSectionsAndForums       = "listSectionsAndForums"

	// NM.
	ApiFunctionName_AddNotification             = "addNotification"
	ApiFunctionName_GetNotification             = "getNotification"
	ApiFunctionName_GetNotifications            = "getNotifications"
	ApiFunctionName_GetNotificationsOnPage      = "getNotificationsOnPage"
	ApiFunctionName_GetUnreadNotifications      = "getUnreadNotifications"
	ApiFunctionName_CountUnreadNotifications    = "countUnreadNotifications"
	ApiFunctionName_MarkNotificationAsRead      = "markNotificationAsRead"
	ApiFunctionName_DeleteNotification          = "deleteNotification"
	ApiFunctionName_AddResource                 = "addResource"
	ApiFunctionName_GetResource                 = "getResource"
	ApiFunctionName_GetResourceValue            = "getResourceValue"
	ApiFunctionName_GetListOfAllResourcesOnPage = "getListOfAllResourcesOnPage"
	ApiFunctionName_DeleteResource              = "deleteResource"

	// SM.
	ApiFunctionName_AddSubscription            = "addSubscription"
	ApiFunctionName_IsSelfSubscribed           = "isSelfSubscribed"
	ApiFunctionName_IsUserSubscribed           = "isUserSubscribed"
	ApiFunctionName_CountSelfSubscriptions     = "countSelfSubscriptions"
	ApiFunctionName_GetSelfSubscriptions       = "getSelfSubscriptions"
	ApiFunctionName_GetSelfSubscriptionsOnPage = "getSelfSubscriptionsOnPage"
	ApiFunctionName_GetUserSubscriptions       = "getUserSubscriptions"
	ApiFunctionName_GetUserSubscriptionsOnPage = "getUserSubscriptionsOnPage"
	ApiFunctionName_DeleteSelfSubscription     = "deleteSelfSubscription"
	ApiFunctionName_DeleteSubscription         = "deleteSubscription"
)
View Source
const (
	ErrFUnknownRpcErrorCode = "unknown RPC error code: %v"
	ErrTypeCast             = "type cast error"
)
View Source
const ErrUrlIsTooShort = "URL is too short"

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(s base.ISettings) (srv *Server, err error)

func (*Server) AddForum

func (srv *Server) AddForum(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) AddMessage

func (srv *Server) AddMessage(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) AddNotification

func (srv *Server) AddNotification(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) AddResource

func (srv *Server) AddResource(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) AddSection

func (srv *Server) AddSection(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) AddSubscription

func (srv *Server) AddSubscription(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) AddThread

func (srv *Server) AddThread(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) ApproveAndRegisterUser

func (srv *Server) ApproveAndRegisterUser(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) BanUser

func (srv *Server) BanUser(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) BlockIPAddress

func (srv *Server) BlockIPAddress(params *json.RawMessage, _ *jrm1.ResponseMetaData) (result any, re *jrm1.RpcError)

func (*Server) ChangeEmail

func (srv *Server) ChangeEmail(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) ChangeForumName

func (srv *Server) ChangeForumName(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) ChangeForumSection

func (srv *Server) ChangeForumSection(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) ChangeMessageText

func (srv *Server) ChangeMessageText(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) ChangeMessageThread

func (srv *Server) ChangeMessageThread(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) ChangePassword

func (srv *Server) ChangePassword(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) ChangeSectionName

func (srv *Server) ChangeSectionName(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) ChangeSectionParent

func (srv *Server) ChangeSectionParent(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) ChangeThreadForum

func (srv *Server) ChangeThreadForum(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) ChangeThreadName

func (srv *Server) ChangeThreadName(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) CountSelfSubscriptions

func (srv *Server) CountSelfSubscriptions(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) CountUnreadNotifications

func (srv *Server) CountUnreadNotifications(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) DeleteForum

func (srv *Server) DeleteForum(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) DeleteMessage

func (srv *Server) DeleteMessage(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) DeleteNotification

func (srv *Server) DeleteNotification(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) DeleteResource

func (srv *Server) DeleteResource(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) DeleteSection

func (srv *Server) DeleteSection(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) DeleteSelfSubscription

func (srv *Server) DeleteSelfSubscription(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) DeleteSubscription

func (srv *Server) DeleteSubscription(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) DeleteThread

func (srv *Server) DeleteThread(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetForum

func (srv *Server) GetForum(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetLatestMessageOfThread

func (srv *Server) GetLatestMessageOfThread(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetListOfAllResourcesOnPage

func (srv *Server) GetListOfAllResourcesOnPage(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetListOfAllUsers

func (srv *Server) GetListOfAllUsers(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetListOfAllUsersOnPage

func (srv *Server) GetListOfAllUsersOnPage(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetListOfLoggedUsers

func (srv *Server) GetListOfLoggedUsers(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetListOfLoggedUsersOnPage

func (srv *Server) GetListOfLoggedUsersOnPage(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetListOfRegistrationsReadyForApproval

func (srv *Server) GetListOfRegistrationsReadyForApproval(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetListenDsnExt

func (srv *Server) GetListenDsnExt() (dsn string)

func (*Server) GetListenDsnInt

func (srv *Server) GetListenDsnInt() (dsn string)

func (*Server) GetMessage

func (srv *Server) GetMessage(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetMustStopAB

func (srv *Server) GetMustStopAB() *atomic.Bool

func (*Server) GetNotification

func (srv *Server) GetNotification(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetNotifications

func (srv *Server) GetNotifications(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetNotificationsOnPage

func (srv *Server) GetNotificationsOnPage(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetResource

func (srv *Server) GetResource(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetResourceValue

func (srv *Server) GetResourceValue(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetSection

func (srv *Server) GetSection(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetSelfRoles

func (srv *Server) GetSelfRoles(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

GetSelfRoles is a normal version of 'GetSelfRoles' RPC request for public usage. For internal purposes, use its internal variant – 'getSelfRoles'.

func (*Server) GetSelfSubscriptions

func (srv *Server) GetSelfSubscriptions(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetSelfSubscriptionsOnPage

func (srv *Server) GetSelfSubscriptionsOnPage(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetStopChannel

func (srv *Server) GetStopChannel() *chan bool

func (*Server) GetSubRoutinesWG

func (srv *Server) GetSubRoutinesWG() *sync.WaitGroup

func (*Server) GetThread

func (srv *Server) GetThread(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetThreadNamesByIds

func (srv *Server) GetThreadNamesByIds(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetUnreadNotifications

func (srv *Server) GetUnreadNotifications(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetUserName

func (srv *Server) GetUserName(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetUserRoles

func (srv *Server) GetUserRoles(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetUserSession

func (srv *Server) GetUserSession(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetUserSubscriptions

func (srv *Server) GetUserSubscriptions(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) GetUserSubscriptionsOnPage

func (srv *Server) GetUserSubscriptionsOnPage(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) IsIPAddressBlocked

func (srv *Server) IsIPAddressBlocked(params *json.RawMessage, _ *jrm1.ResponseMetaData) (result any, re *jrm1.RpcError)

func (*Server) IsSelfSubscribed

func (srv *Server) IsSelfSubscribed(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) IsUserLoggedIn

func (srv *Server) IsUserLoggedIn(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) IsUserSubscribed

func (srv *Server) IsUserSubscribed(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) ListForumAndThreads

func (srv *Server) ListForumAndThreads(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) ListForumAndThreadsOnPage

func (srv *Server) ListForumAndThreadsOnPage(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) ListSectionsAndForums

func (srv *Server) ListSectionsAndForums(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) ListThreadAndMessages

func (srv *Server) ListThreadAndMessages(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) ListThreadAndMessagesOnPage

func (srv *Server) ListThreadAndMessagesOnPage(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) LogUserIn

func (srv *Server) LogUserIn(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) LogUserOut

func (srv *Server) LogUserOut(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) LogUserOutA

func (srv *Server) LogUserOutA(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) MarkNotificationAsRead

func (srv *Server) MarkNotificationAsRead(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) MoveForumDown

func (srv *Server) MoveForumDown(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) MoveForumUp

func (srv *Server) MoveForumUp(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) MoveSectionDown

func (srv *Server) MoveSectionDown(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) MoveSectionUp

func (srv *Server) MoveSectionUp(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) MoveThreadDown

func (srv *Server) MoveThreadDown(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) MoveThreadUp

func (srv *Server) MoveThreadUp(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) Ping

func (srv *Server) Ping(_ *json.RawMessage, _ *jrm1.ResponseMetaData) (result any, re *jrm1.RpcError)

func (*Server) RegisterUser

func (srv *Server) RegisterUser(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) RejectRegistrationRequest

func (srv *Server) RejectRegistrationRequest(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) ReportStart

func (srv *Server) ReportStart()

func (*Server) SetUserRoleAuthor

func (srv *Server) SetUserRoleAuthor(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) SetUserRoleReader

func (srv *Server) SetUserRoleReader(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) SetUserRoleWriter

func (srv *Server) SetUserRoleWriter(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) ShowDiagnosticData

func (srv *Server) ShowDiagnosticData(params *json.RawMessage, _ *jrm1.ResponseMetaData) (result any, re *jrm1.RpcError)

func (*Server) Start

func (srv *Server) Start() (err error)

func (*Server) Stop

func (srv *Server) Stop() (err error)

func (*Server) UnbanUser

func (srv *Server) UnbanUser(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

func (*Server) UseConstructor

func (srv *Server) UseConstructor(stn base.ISettings) (base.IServer, error)

func (*Server) ViewUserParameters

func (srv *Server) ViewUserParameters(ar *api2.Request, _ *http.Request, hrw http.ResponseWriter)

Jump to

Keyboard shortcuts

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