manager

package
v0.0.0-...-010d8e3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

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

type Message

type Message struct {
	Header mail.Header
	Body   string
}

struct for holding message header and body

Jump to

Keyboard shortcuts

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