Documentation ¶
Index ¶
- type ManagerService
- func (ms *ManagerService) Daemonize()
- func (ms *ManagerService) DeleteMailUserHandler(w http.ResponseWriter, r *http.Request)
- func (ms *ManagerService) DeleteMailUserNumberHandler(w http.ResponseWriter, r *http.Request)
- func (ms *ManagerService) GetFilesInPath(root string) ([]string, error)
- func (ms *ManagerService) GetMailUserHandler(w http.ResponseWriter, r *http.Request)
- func (ms *ManagerService) GetMailUserNumberHandler(w http.ResponseWriter, r *http.Request)
- func (ms *ManagerService) GetMailboxesHandler(w http.ResponseWriter, r *http.Request)
- func (ms *ManagerService) GetSectionProperty(section string, property string) (string, error)
- func (ms *ManagerService) GetSectionPropertyOrDefault(section string, property string, def string) string
- func (ms *ManagerService) Init(cfgfile string)
- func (ms *ManagerService) PanicCheck(err error)
- func (ms *ManagerService) PostMailHandler(w http.ResponseWriter, r *http.Request)
- type Message
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ManagerService ¶
type ManagerService struct { Config *toml.Tree WebService *fibre.WebService }
ManagerService has a toml Config property which contains 0box specific directives, and a pointer to the web service.
func (*ManagerService) Daemonize ¶
func (ms *ManagerService) Daemonize()
Daemonize sets up the web service and defines routes for the API.
func (*ManagerService) DeleteMailUserHandler ¶
func (ms *ManagerService) DeleteMailUserHandler(w http.ResponseWriter, r *http.Request)
Handle requests to delete a user mailbox
func (*ManagerService) DeleteMailUserNumberHandler ¶
func (ms *ManagerService) DeleteMailUserNumberHandler(w http.ResponseWriter, r *http.Request)
Handle requests to delete a user's message # from mail. Todo: This method truncates and re-writes from structures in memory, this is not efficient and could cause problems.
func (*ManagerService) GetFilesInPath ¶
func (ms *ManagerService) GetFilesInPath(root string) ([]string, error)
GetFiles returns a list of files, given a root path to search, excluding non-files (., .., directories)
func (*ManagerService) GetMailUserHandler ¶
func (ms *ManagerService) GetMailUserHandler(w http.ResponseWriter, r *http.Request)
Handle requests to return all a user's mail
func (*ManagerService) GetMailUserNumberHandler ¶
func (ms *ManagerService) GetMailUserNumberHandler(w http.ResponseWriter, r *http.Request)
Handle requests to return a user's message # from mail.
func (*ManagerService) GetMailboxesHandler ¶
func (ms *ManagerService) GetMailboxesHandler(w http.ResponseWriter, r *http.Request)
Handle requests to list available mailbox users:
func (*ManagerService) GetSectionProperty ¶
func (ms *ManagerService) GetSectionProperty(section string, property string) (string, error)
get the property for config section as a string, if property does not exist return err
func (*ManagerService) GetSectionPropertyOrDefault ¶
func (ms *ManagerService) GetSectionPropertyOrDefault(section string, property string, def string) string
get the property for config section as a string, if property does not exist return the default property
func (*ManagerService) Init ¶
func (ms *ManagerService) Init(cfgfile string)
Init is required to initialize the manager service via a config file.
func (*ManagerService) PanicCheck ¶
func (ms *ManagerService) PanicCheck(err error)
Check an error and panic if it exists.
func (*ManagerService) PostMailHandler ¶
func (ms *ManagerService) PostMailHandler(w http.ResponseWriter, r *http.Request)
Handle requests to post mail