mirror of
https://github.com/m1k1o/neko.git
synced 2025-07-21 10:37:57 +02:00
manual refresh function
This commit is contained in:
parent
70e84c5840
commit
cfc7b15211
9 changed files with 74 additions and 4 deletions
|
@ -3,12 +3,20 @@ package state
|
|||
type State struct {
|
||||
banned map[string]string // IP -> session ID (that banned it)
|
||||
locked map[string]string // resource name -> session ID (that locked it)
|
||||
|
||||
fileTransferEnabled bool // admins can transfer files
|
||||
fileTransferUnprivEnabled bool // all users can transfer files
|
||||
fileTransferPath string // path where files are located
|
||||
}
|
||||
|
||||
func New() *State {
|
||||
func New(fileTransferEnabled bool, fileTransferUnprivEnabled bool, fileTransferPath string) *State {
|
||||
return &State{
|
||||
banned: make(map[string]string),
|
||||
locked: make(map[string]string),
|
||||
|
||||
fileTransferEnabled: fileTransferEnabled,
|
||||
fileTransferUnprivEnabled: fileTransferUnprivEnabled,
|
||||
fileTransferPath: fileTransferPath,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,3 +67,17 @@ func (s *State) GetLocked(resource string) (string, bool) {
|
|||
func (s *State) AllLocked() map[string]string {
|
||||
return s.locked
|
||||
}
|
||||
|
||||
// File Transfer
|
||||
|
||||
func (s *State) FileTransferEnabled() bool {
|
||||
return s.fileTransferEnabled
|
||||
}
|
||||
|
||||
func (s *State) UnprivFileTransferEnabled() bool {
|
||||
return s.fileTransferUnprivEnabled
|
||||
}
|
||||
|
||||
func (s *State) FileTransferPath() string {
|
||||
return s.fileTransferPath
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue