Package controller
import "vminko.org/dscuss/cmd/dscuss-web/controller"
- Overview
- Index
controller responds to the user input and performs interactions on
the Dscuss data model objects (Users, Messages, Operations, Threads,
Subscriptions etc.) via Dscuss API.
- Constants
- Variables
- func BadRequestHandler(w http.ResponseWriter, r *http.Request, msg string)
- func CSSHandler(w http.ResponseWriter, r *http.Request)
- func CloseSession(w http.ResponseWriter, r *http.Request)
- func ForbiddenHandler(w http.ResponseWriter, r *http.Request)
- func InitHandlers(l *dscuss.LoginHandle)
- func InternalServerErrorHandler(w http.ResponseWriter, r *http.Request)
- func JavaScriptHandler(w http.ResponseWriter, r *http.Request)
- func LogoutHandler(w http.ResponseWriter, r *http.Request)
- func NotFoundHandler(w http.ResponseWriter, r *http.Request)
- func RootHandler(w http.ResponseWriter, r *http.Request)
- func SetPassword(p string)
- type CommonData
- type ComposedReply
- type ComposedRootMessage
- type Message
- func (m *Message) Assign(em *entity.Message, l *dscuss.LoginHandle)
- type Operation
- func (o *Operation) Assign(eo *entity.Operation, l *dscuss.LoginHandle)
- type Peer
- func (p *Peer) Assign(pi *peer.Info)
- type PeerHistory
- func (ph *PeerHistory) Assign(uh *entity.UserHistory)
- type RootMessage
- func (rm *RootMessage) Assign(em *entity.Message, l *dscuss.LoginHandle)
- type Session
- func OpenSession(w http.ResponseWriter, r *http.Request) *Session
- func (s *Session) Authenticate(loginHandle *dscuss.LoginHandle, user string, pass string) error
- type SessionPool
- type Thread
- type ThreadComposer
- func (tc *ThreadComposer) Handle(n *thread.Node) bool
- type User
- func (u *User) Assign(eu *entity.User)
Package files
common_data.go
controller.go
handle_ban_user.go
handle_board.go
handle_create_thread.go
handle_list_operations.go
handle_list_peers.go
handle_login.go
handle_peer_history.go
handle_profile.go
handle_remove_message.go
handle_reply_thread.go
handle_thread.go
handle_user.go
init_handlers.go
session.go
session_pool.go
sessions.go
In the call graph viewer below, each node
is a function belonging to this package
and its children are the functions it
calls—perhaps dynamically.
The root nodes are the entry points of the
package: functions that may be called from
outside the package.
There may be non-exported or anonymous
functions among them if they are called
dynamically from another package.
Click a node to visit that function's source code.
From there you can visit its callers by
clicking its declaring func
token.
Functions may be omitted if they were
determined to be unreachable in the
particular programs or tests that were
analyzed.
Constants
const (
MaxPasswordLen = 64
)
Variables
var LoginHandler, ProfileHandler, BoardHandler, ThreadHandler, CreateThread, ReplyThreadHandler,
AddModeratorHandler, DelModeratorHandler, SubscribeHandler, UnsubscribeHandler, UserHandler,
RemoveMessageHandler, BanUserHandler, ListOperationsHandler, ListPeersHandler,
PeerHistoryHandler func(w http.ResponseWriter, r *http.Request)
func BadRequestHandler(w http.ResponseWriter, r *http.Request, msg string)
func CSSHandler(w http.ResponseWriter, r *http.Request)
func CloseSession(w http.ResponseWriter, r *http.Request)
func ForbiddenHandler(w http.ResponseWriter, r *http.Request)
func InitHandlers(l *dscuss.LoginHandle)
func InternalServerErrorHandler(w http.ResponseWriter, r *http.Request)
func JavaScriptHandler(w http.ResponseWriter, r *http.Request)
func LogoutHandler(w http.ResponseWriter, r *http.Request)
func NotFoundHandler(w http.ResponseWriter, r *http.Request)
func RootHandler(w http.ResponseWriter, r *http.Request)
func SetPassword(p string)
type CommonData struct {
CSRF string
Owner User
NodeName string
PageTitle string
Topic string
CurrentURL template.URL
ShowLogin bool
IsWritingPermitted bool
}
type ComposedReply struct {
Subject string
Text string
}
type ComposedRootMessage struct {
Topic string
Subject string
Text string
}
type Message struct {
ID string
ShortID string
Subject string
Text string
DateWritten string
AuthorName string
AuthorID string
AuthorShortID string
}
func (*Message) Assign
¶
func (m *Message) Assign(em *entity.Message, l *dscuss.LoginHandle)
type Operation struct {
ID string
ShortID string
Type string
Reason string
Comment string
DatePerformed string
AuthorName string
AuthorID string
AuthorShortID string
}
func (*Operation) Assign
¶
func (o *Operation) Assign(eo *entity.Operation, l *dscuss.LoginHandle)
type Peer struct {
Nickname string
ID string
LocalAddr string
RemoteAddr string
AssociatedAddrs string
Subscriptions string
State string
}
func (p *Peer) Assign(pi *peer.Info)
type PeerHistory struct {
ID string
Disconnected string
Subscriptions string
}
func (*PeerHistory) Assign
¶
func (ph *PeerHistory) Assign(uh *entity.UserHistory)
type RootMessage struct {
Message
Topic string
}
func (*RootMessage) Assign
¶
func (rm *RootMessage) Assign(em *entity.Message, l *dscuss.LoginHandle)
type Session struct {
ID string
IsAuthenticated bool
CSRFToken string
CreatedDate time.Time
UpdatedDate time.Time
}
func OpenSession(w http.ResponseWriter, r *http.Request) *Session
func (s *Session) Authenticate(loginHandle *dscuss.LoginHandle, user string, pass string) error
type SessionPool struct {
}
type Thread struct {
RootMessage
Replies []Message
}
type ThreadComposer struct {
}
func (*ThreadComposer) Handle
¶
func (tc *ThreadComposer) Handle(n *thread.Node) bool
type User struct {
ID string
ShortID string
Nickname string
Info string
RegDate string
}
func (u *User) Assign(eu *entity.User)