controllers

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2015 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentDAPClient

func CurrentDAPClient(store *models.Store, table gdb.Table) (*dap.Client, *framework.HTTPError)

CurrentDAPClient will return the current DAPClient associated with the curernt Identity.

func CurrentIdentityOrError

func CurrentIdentityOrError(store *models.Store, table gdb.Table) (*models.Identity, *framework.HTTPError)

CurrentIdentityOrError will retrieve the current Identity object from the store.

func DAPClientFromID

func DAPClientFromID(id *models.Identity, store *models.Store) (*dap.Client, error)

func DecodeJSONBody

func DecodeJSONBody(req *http.Request, object interface{}) error

DecodeJSONBody will take a request and a destination interface and decode the JSON from the request into object.

Types

type AddContact

type AddContact struct {
	Tables map[string]gdb.Table
	Store  *models.Store
}

func (*AddContact) Handle

func (c *AddContact) Handle(req *http.Request) framework.View

type AddList

type AddList struct {
	Tables map[string]gdb.Table
	Store  *models.Store
}

func (*AddList) Handle

func (c *AddList) Handle(req *http.Request) framework.View

type CheckForPluginUpdatesController

type CheckForPluginUpdatesController struct {
	Packager *packaging.Packager
}

func (*CheckForPluginUpdatesController) Handle

type CheckUpdateController

type CheckUpdateController struct {
	Version  string
	Platform string
}

func (*CheckUpdateController) Handle

type CurrentIdentity

type CurrentIdentity struct {
	Tables map[string]gdb.Table
	Store  *models.Store
}

CurrentIdentity manages a REST-ful service for updating and retrieving the currently utilized identity.

func (*CurrentIdentity) Handle

func (i *CurrentIdentity) Handle(req *http.Request) framework.View

Handle will check if the request is POST or GET and either update the current identity or return it.

type CurrentProfile

type CurrentProfile struct {
	Tables map[string]gdb.Table
	Store  *models.Store
}

func (*CurrentProfile) Handle

func (c *CurrentProfile) Handle(req *http.Request) framework.View

type CurrentTiles

type CurrentTiles struct {
	Store *models.Store
}

func (*CurrentTiles) Handle

func (c *CurrentTiles) Handle(req *http.Request) framework.View

type DownloadUpdateController

type DownloadUpdateController struct{}

func (*DownloadUpdateController) Handle

type FileUploader

type FileUploader struct {
	*os.File
	// contains filtered or unexported fields
}

func (*FileUploader) Read

func (r *FileUploader) Read(p []byte) (int, error)

type GetAllMessagesAt

type GetAllMessagesAt struct {
	Store  *models.Store
	Tables map[string]gdb.Table
}

GetMessage controller will download a single message as specified by Alias and Name

func (*GetAllMessagesAt) Handle

func (m *GetAllMessagesAt) Handle(req *http.Request) framework.View

Handle will download the messages and transform them into JSON.

type GetLists

type GetLists struct {
	Tables map[string]gdb.Table
	Store  *models.Store
}

func (*GetLists) Handle

func (c *GetLists) Handle(req *http.Request) framework.View

type GetMessage

type GetMessage struct {
	Store  *models.Store
	Tables map[string]gdb.Table
}

GetMessage controller will download a single message as specified by Alias and Name

func (*GetMessage) Handle

func (m *GetMessage) Handle(req *http.Request) framework.View

Handle will download the messages and transform them into JSON.

type InstallPluginController

type InstallPluginController struct {
	Packager *packaging.Packager
}

InstallPluginController will install a plugin from a specific github repository.

func (*InstallPluginController) Handle

Handle performs the installation.

type InstallUpdateController

type InstallUpdateController struct {
	AppLocation string
}

func (*InstallUpdateController) Handle

type ListContacts

type ListContacts struct {
	Tables map[string]gdb.Table
	Store  *models.Store
}

ListContacts will return a list (in JSON) of all of the contacts stored for an identity.

func (*ListContacts) Handle

func (c *ListContacts) Handle(req *http.Request) framework.View

type ListIdentity

type ListIdentity struct {
	Tables map[string]gdb.Table
	Store  *models.Store
}

ListIdentity will list all identities on file.

func (*ListIdentity) Handle

func (i *ListIdentity) Handle(req *http.Request) framework.View

Handle will get all identities then return a JSONView with them.

type Messages

type Messages struct {
	Packager *packaging.Packager
	Store    *models.Store
	Tables   map[string]gdb.Table
}

Messages Controller will download messages from the server and subscribed sources (with caching), and send them to the client in JSON.

func (*Messages) Handle

func (m *Messages) Handle(req *http.Request) framework.View

Handle will download the messages and transform them into JSON.

type NewMessage

type NewMessage struct {
	Store    *models.Store
	Tables   map[string]gdb.Table
	Packager *packaging.Packager
}

NewMessage will create and send a new message either with or without an alert.

func (*NewMessage) Handle

func (m *NewMessage) Handle(req *http.Request) framework.View

Handle will publish the message on the server, then alert the other party.

type PluginStoreController

type PluginStoreController struct {
	Packager *packaging.Packager
}

ServerLists will return the list of Trackers or Servers from getmelange.com.

func (*PluginStoreController) Handle

Handle will decodeProviders from getmelange.com then return them in JSON.

type RealtimeHandler

type RealtimeHandler struct {
	Store  *models.Store
	Tables map[string]gdb.Table

	Packager *packaging.Packager

	Suffix string
	// contains filtered or unexported fields
}

RealtimeHandler connects one websocket-enabled client to the backend go server.

func CreateRealtimeHandler

func CreateRealtimeHandler(
	s *models.Store,
	t map[string]gdb.Table,
	p *packaging.Packager,
	suffix string,
) *RealtimeHandler
func (r *RealtimeHandler) AcceptLink(d interface{}) (string, map[string]interface{})

func (*RealtimeHandler) HandleWSRequest

func (r *RealtimeHandler) HandleWSRequest(t string, d interface{}) (string, interface{})

HandleWSRequest will handle one WS request from the client.

func (r *RealtimeHandler) RequestLink(d interface{}) (string, map[string]interface{})
func (r *RealtimeHandler) StartLink(d interface{}) (string, map[string]interface{})

func (*RealtimeHandler) UpgradeConnection

func (r *RealtimeHandler) UpgradeConnection(res http.ResponseWriter, req *http.Request)

UpgradeConnection will upgrade a normal HTTP Request to the Websocket protocol.

type RemoveContact

type RemoveContact struct {
	Tables map[string]gdb.Table
	Store  *models.Store
}

func (*RemoveContact) Handle

func (r *RemoveContact) Handle(req *http.Request) framework.View

type RemoveIdentity

type RemoveIdentity struct {
	Tables map[string]gdb.Table
	Store  *models.Store
}

func (*RemoveIdentity) Handle

func (r *RemoveIdentity) Handle(req *http.Request) framework.View

type RemoveList

type RemoveList struct {
	Tables map[string]gdb.Table
	Store  *models.Store
}

func (*RemoveList) Handle

func (c *RemoveList) Handle(req *http.Request) framework.View

type SaveIdentity

type SaveIdentity struct {
	Tables   map[string]gdb.Table
	Store    *models.Store
	Packager *packaging.Packager
}

SaveIdentity will create, register, alias, and save a new Identity.

func (*SaveIdentity) Handle

func (i *SaveIdentity) Handle(req *http.Request) framework.View

Handle performs the specified functions.

type UninstallPluginController

type UninstallPluginController struct {
	Packager *packaging.Packager
}

UninstallPluginController uninstalls a plugin given the ID of the plugin.

func (*UninstallPluginController) Handle

Handle performs the uninstallation.

type UpdateContact

type UpdateContact struct {
	Tables map[string]gdb.Table
	Store  *models.Store
}

func (*UpdateContact) Handle

func (c *UpdateContact) Handle(req *http.Request) framework.View

type UpdateMessage

type UpdateMessage struct {
	Store  *models.Store
	Tables map[string]gdb.Table
}

UpdateMessage will take a request with a messageId and a newMessage and change the server to point messageId to newMessage.

func (*UpdateMessage) Handle

func (m *UpdateMessage) Handle(req *http.Request) framework.View

Handle will decode the JSON request and alert the server.

type UpdatePluginController

type UpdatePluginController struct {
	Packager *packaging.Packager
}

func (*UpdatePluginController) Handle

type UpdateProfile

type UpdateProfile struct {
	Tables map[string]gdb.Table
	Store  *models.Store
}

func (*UpdateProfile) Handle

func (c *UpdateProfile) Handle(req *http.Request) framework.View

type UpdateProgressController

type UpdateProgressController struct{}

func (*UpdateProgressController) Handle

type UpdateTiles

type UpdateTiles struct {
	Store *models.Store
}

func (*UpdateTiles) Handle

func (u *UpdateTiles) Handle(req *http.Request) framework.View

type UploadController

type UploadController struct {
	Store  *models.Store
	Tables map[string]gdb.Table
}

func (*UploadController) HandleWSRequest

func (m *UploadController) HandleWSRequest(data map[string]interface{}, ws chan<- interface{}, uploadID string) error

func (*UploadController) UploadFile

func (m *UploadController) UploadFile(filename string, to []*identity.Address, typ string, prefix string, ws chan<- interface{}, uploadID string) error

Jump to

Keyboard shortcuts

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