routes

package
v0.0.0-...-eca9d05 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2018 License: GPL-2.0 Imports: 25 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountsCreate

func AccountsCreate(w http.ResponseWriter, r *http.Request)

AccountsCreate creates a new account in the system.

func AccountsDelete

func AccountsDelete(c web.C, w http.ResponseWriter, r *http.Request)

AccountsDelete deletes an account and everything related to it.

func AccountsGet

func AccountsGet(c web.C, w http.ResponseWriter, r *http.Request)

AccountsGet returns the information about the specified account

func AccountsList

func AccountsList(w http.ResponseWriter, r *http.Request)

AccountsList returns a list of accounts visible to an user

func AccountsStartOnboarding

func AccountsStartOnboarding(c web.C, w http.ResponseWriter, r *http.Request)

func AccountsUpdate

func AccountsUpdate(c web.C, w http.ResponseWriter, r *http.Request)

AccountsUpdate allows changing the account's information (password etc.)

func AccountsWipeData

func AccountsWipeData(c web.C, w http.ResponseWriter, r *http.Request)

AccountsWipeData wipes all data except the actual account and billing info.

func AddressesList

func AddressesList(c web.C, w http.ResponseWriter, r *http.Request)

func AuthMiddleware

func AuthMiddleware(c *web.C, h http.Handler) http.Handler

AuthMiddleware checks whether the token passed with the request is valid

func Avatars

func Avatars(c web.C, w http.ResponseWriter, r *http.Request)

func ContactsCreate

func ContactsCreate(c web.C, w http.ResponseWriter, r *http.Request)

ContactsCreate creates a new contact

func ContactsDelete

func ContactsDelete(c web.C, w http.ResponseWriter, r *http.Request)

ContactsDelete removes a contact from the database

func ContactsGet

func ContactsGet(c web.C, w http.ResponseWriter, r *http.Request)

ContactsGet gets the requested contact from the database

func ContactsList

func ContactsList(c web.C, w http.ResponseWriter, r *http.Request)

ContactsList does *something* - TODO

func ContactsUpdate

func ContactsUpdate(c web.C, w http.ResponseWriter, r *http.Request)

ContactsUpdate updates an existing contact in the database

func EmailsCreate

func EmailsCreate(c web.C, w http.ResponseWriter, r *http.Request)

EmailsCreate sends a new email

func EmailsDelete

func EmailsDelete(c web.C, w http.ResponseWriter, r *http.Request)

EmailsDelete remvoes an email from the system

func EmailsGet

func EmailsGet(c web.C, w http.ResponseWriter, r *http.Request)

EmailsGet responds with a single email message

func EmailsList

func EmailsList(c web.C, w http.ResponseWriter, r *http.Request)

EmailsList sends a list of the emails in the inbox.

func FilesCreate

func FilesCreate(c web.C, w http.ResponseWriter, r *http.Request)

FilesCreate creates a new file

func FilesDelete

func FilesDelete(c web.C, w http.ResponseWriter, r *http.Request)

FilesDelete removes a file from the database

func FilesGet

func FilesGet(c web.C, w http.ResponseWriter, r *http.Request)

FilesGet gets the requested file from the database

func FilesList

func FilesList(c web.C, w http.ResponseWriter, r *http.Request)

func FilesUpdate

func FilesUpdate(c web.C, w http.ResponseWriter, r *http.Request)

FilesUpdate updates an existing file in the database

func Hello

func Hello(w http.ResponseWriter, r *http.Request)

Hello shows basic information about the API on its frontpage.

func KeysCreate

func KeysCreate(c web.C, w http.ResponseWriter, r *http.Request)

KeysCreate appens a new key to the server

func KeysGet

func KeysGet(c web.C, w http.ResponseWriter, r *http.Request)

KeysGet does *something* - TODO

func KeysList

func KeysList(w http.ResponseWriter, r *http.Request)

KeysList responds with the list of keys assigned to the spiecified email

func KeysVote

func KeysVote(w http.ResponseWriter, r *http.Request)

KeysVote does *something* - TODO

func LabelsCreate

func LabelsCreate(c web.C, w http.ResponseWriter, req *http.Request)

LabelsCreate does *something* - TODO

func LabelsDelete

func LabelsDelete(c web.C, w http.ResponseWriter, req *http.Request)

LabelsDelete does *something* - TODO

func LabelsGet

func LabelsGet(c web.C, w http.ResponseWriter, req *http.Request)

LabelsGet does *something* - TODO

func LabelsList

func LabelsList(c web.C, w http.ResponseWriter, req *http.Request)

LabelsList fetches all labels

func LabelsUpdate

func LabelsUpdate(c web.C, w http.ResponseWriter, req *http.Request)

LabelsUpdate does *something* - TODO

func ThreadsDelete

func ThreadsDelete(c web.C, w http.ResponseWriter, r *http.Request)

ThreadsDelete removes a thread from the database

func ThreadsGet

func ThreadsGet(c web.C, w http.ResponseWriter, r *http.Request)

ThreadsGet returns information about a single thread.

func ThreadsList

func ThreadsList(c web.C, w http.ResponseWriter, r *http.Request)

ThreadsList shows all threads

func ThreadsUpdate

func ThreadsUpdate(c web.C, w http.ResponseWriter, r *http.Request)

ThreadsUpdate does *something* with a thread.

func TokensCreate

func TokensCreate(w http.ResponseWriter, r *http.Request)

TokensCreate allows logging in to an account.

func TokensDelete

func TokensDelete(c web.C, w http.ResponseWriter, r *http.Request)

TokensDelete destroys either the current auth token or the one passed as an URL param

func TokensGet

func TokensGet(c web.C, w http.ResponseWriter, r *http.Request)

TokensGet returns information about the current token.

Types

type AccountsCreateRequest

type AccountsCreateRequest struct {
	Username   string `json:"username,omitempty" schema:"username"`
	Password   string `json:"password,omitempty" schema:"password"`
	AltEmail   string `json:"alt_email,omitempty" schema:"alt_email"`
	InviteCode string `json:"invite_code,omitempty" schema:"invite_code"`
}

AccountsCreateRequest contains the input for the AccountsCreate endpoint.

type AccountsCreateResponse

type AccountsCreateResponse struct {
	Success bool            `json:"success"`
	Message string          `json:"message"`
	Account *models.Account `json:"account,omitempty"`
}

AccountsCreateResponse contains the output of the AccountsCreate request.

type AccountsDeleteResponse

type AccountsDeleteResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

AccountsDeleteResponse contains the result of the AccountsDelete request.

type AccountsGetResponse

type AccountsGetResponse struct {
	Success bool            `json:"success"`
	Message string          `json:"message,omitempty"`
	Account *models.Account `json:"user,omitempty"`
}

AccountsGetResponse contains the result of the AccountsGet request.

type AccountsListResponse

type AccountsListResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

AccountsListResponse contains the result of the AccountsList request.

type AccountsStartOnboardingResponse

type AccountsStartOnboardingResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

type AccountsUpdateRequest

type AccountsUpdateRequest struct {
	AltEmail        string      `json:"alt_email" schema:"alt_email"`
	CurrentPassword string      `json:"current_password" schema:"current_password"`
	NewPassword     string      `json:"new_password" schema:"new_password"`
	FactorType      string      `json:"factor_type" schema:"factor_type"`
	FactorValue     []string    `json:"factor_value" schema:"factor_value"`
	Token           string      `json:"token" schema:"token"`
	Settings        interface{} `json:"settings" schema:"settings"`
	PublicKey       string      `json:"public_key" schema:"public_key"`
}

AccountsUpdateRequest contains the input for the AccountsUpdate endpoint.

type AccountsUpdateResponse

type AccountsUpdateResponse struct {
	Success         bool            `json:"success"`
	Message         string          `json:"message,omitempty"`
	Account         *models.Account `json:"account,omitempty"`
	FactorType      string          `json:"factor_type,omitempty"`
	FactorChallenge string          `json:"factor_challenge,omitempty"`
}

AccountsUpdateResponse contains the result of the AccountsUpdate request.

type AccountsWipeDataResponse

type AccountsWipeDataResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

AccountsWipeDataResponse contains the result of the AccountsWipeData request.

type AddressesListResponse

type AddressesListResponse struct {
	Success   bool              `json:"success"`
	Message   string            `json:"message,omitempty"`
	Addresses []*models.Address `json:"addresses,omitempty"`
}

type AuthMiddlewareResponse

type AuthMiddlewareResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

AuthMiddlewareResponse is the response sent by the middleware if user is not logged in

type ContactsCreateRequest

type ContactsCreateRequest struct {
	Data            string   `json:"data" schema:"data"`
	Name            string   `json:"name" schema:"name"`
	Encoding        string   `json:"encoding" schema:"encoding"`
	VersionMajor    int      `json:"version_major" schema:"version_major"`
	VersionMinor    int      `json:"version_minor" schema:"version_minor"`
	PGPFingerprints []string `json:"pgp_fingerprints" schema:"pgp_fingerprints"`
}

ContactsCreateRequest is the payload that user should pass to POST /contacts

type ContactsCreateResponse

type ContactsCreateResponse struct {
	Success bool            `json:"success"`
	Message string          `json:"message"`
	Contact *models.Contact `json:"contact,omitempty"`
}

ContactsCreateResponse contains the result of the ContactsCreate request.

type ContactsDeleteResponse

type ContactsDeleteResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

ContactsDeleteResponse contains the result of the ContactsDelete request.

type ContactsGetResponse

type ContactsGetResponse struct {
	Success bool            `json:"success"`
	Message string          `json:"message,omitempty"`
	Contact *models.Contact `json:"contact,omitempty"`
}

ContactsGetResponse contains the result of the ContactsGet request.

type ContactsListResponse

type ContactsListResponse struct {
	Success  bool               `json:"success"`
	Message  string             `json:"message,omitempty"`
	Contacts *[]*models.Contact `json:"contacts,omitempty"`
}

ContactsListResponse contains the result of the ContactsList request.

type ContactsUpdateRequest

type ContactsUpdateRequest struct {
	Data            string   `json:"data" schema:"data"`
	Name            string   `json:"name" schema:"name"`
	Encoding        string   `json:"encoding" schema:"encoding"`
	VersionMajor    *int     `json:"version_major" schema:"version_major"`
	VersionMinor    *int     `json:"version_minor" schema:"version_minor"`
	PGPFingerprints []string `json:"pgp_fingerprints" schema:"pgp_fingerprints"`
}

ContactsUpdateRequest is the payload passed to PUT /contacts/:id

type ContactsUpdateResponse

type ContactsUpdateResponse struct {
	Success bool            `json:"success"`
	Message string          `json:"message,omitempty"`
	Contact *models.Contact `json:"contact,omitempty"`
}

ContactsUpdateResponse contains the result of the ContactsUpdate request.

type EmailsCreateRequest

type EmailsCreateRequest struct {
	// Internal properties
	Kind   string `json:"kind"`
	Thread string `json:"thread"`

	// Metadata that has to be leaked
	From string   `json:"from"`
	To   []string `json:"to"`
	CC   []string `json:"cc"`
	BCC  []string `json:"bcc"`

	// Encrypted parts
	PGPFingerprints []string `json:"pgp_fingerprints"`
	Manifest        string   `json:"manifest"`
	Body            string   `json:"body"`
	Files           []string `json:"files"`

	// Temporary partials if you're sending unencrypted
	Subject     string `json:"subject"`
	ContentType string `json:"content_type"`
	ReplyTo     string `json:"reply_to"`

	SubjectHash string `json:"subject_hash"`
}

type EmailsCreateResponse

type EmailsCreateResponse struct {
	Success bool     `json:"success"`
	Message string   `json:"message,omitempty"`
	Created []string `json:"created,omitempty"`
}

EmailsCreateResponse contains the result of the EmailsCreate request.

type EmailsDeleteResponse

type EmailsDeleteResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

EmailsDeleteResponse contains the result of the EmailsDelete request.

type EmailsGetResponse

type EmailsGetResponse struct {
	Success bool          `json:"success"`
	Message string        `json:"message,omitempty"`
	Email   *models.Email `json:"email,omitempty"`
}

EmailsGetResponse contains the result of the EmailsGet request.

type EmailsListResponse

type EmailsListResponse struct {
	Success bool             `json:"success"`
	Message string           `json:"message,omitempty"`
	Emails  *[]*models.Email `json:"emails,omitempty"`
}

EmailsListResponse contains the result of the EmailsList request.

type FilesCreateRequest

type FilesCreateRequest struct {
	Data            string   `json:"data" schema:"data"`
	Name            string   `json:"name" schema:"name"`
	Encoding        string   `json:"encoding" schema:"encoding"`
	VersionMajor    int      `json:"version_major" schema:"version_major"`
	VersionMinor    int      `json:"version_minor" schema:"version_minor"`
	PGPFingerprints []string `json:"pgp_fingerprints" schema:"pgp_fingerprints"`
}

type FilesCreateResponse

type FilesCreateResponse struct {
	Success bool         `json:"success"`
	Message string       `json:"message"`
	File    *models.File `json:"file,omitempty"`
}

type FilesDeleteResponse

type FilesDeleteResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

FilesDeleteResponse contains the result of the Delete request.

type FilesGetResponse

type FilesGetResponse struct {
	Success bool         `json:"success"`
	Message string       `json:"message,omitempty"`
	File    *models.File `json:"file,omitempty"`
}

FilesGetResponse contains the result of the FilesGet request.

type FilesListResponse

type FilesListResponse struct {
	Success bool            `json:"success"`
	Message string          `json:"message,omitempty"`
	Files   *[]*models.File `json:"files,omitempty"`
}

type FilesUpdateRequest

type FilesUpdateRequest struct {
	Data            string   `json:"data" schema:"data"`
	Name            string   `json:"name" schema:"name"`
	Encoding        string   `json:"encoding" schema:"encoding"`
	VersionMajor    *int     `json:"version_major" schema:"version_major"`
	VersionMinor    *int     `json:"version_minor" schema:"version_minor"`
	PGPFingerprints []string `json:"pgp_fingerprints" schema:"pgp_fingerprints"`
}

FilesUpdateRequest is the payload passed to PUT /files/:id

type FilesUpdateResponse

type FilesUpdateResponse struct {
	Success bool         `json:"success"`
	Message string       `json:"message,omitempty"`
	File    *models.File `json:"file,omitempty"`
}

FilesUpdateResponse contains the result of the FilesUpdate request.

type HelloResponse

type HelloResponse struct {
	Message string `json:"message"`
	DocsURL string `json:"docs_url"`
	Version string `json:"version"`
}

HelloResponse contains the result of the Hello request.

type KeysCreateRequest

type KeysCreateRequest struct {
	Key string `json:"key" schema:"key"` // gpg armored key
}

KeysCreateRequest contains the data passed to the KeysCreate endpoint.

type KeysCreateResponse

type KeysCreateResponse struct {
	Success bool        `json:"success"`
	Message string      `json:"message"`
	Key     *models.Key `json:"key,omitempty"`
}

KeysCreateResponse contains the result of the KeysCreate request.

type KeysGetResponse

type KeysGetResponse struct {
	Success bool        `json:"success"`
	Message string      `json:"message,omitempty"`
	Key     *models.Key `json:"key,omitempty"`
}

KeysGetResponse contains the result of the KeysGet request.

type KeysListResponse

type KeysListResponse struct {
	Success bool           `json:"success"`
	Message string         `json:"message,omitempty"`
	Keys    *[]*models.Key `json:"keys,omitempty"`
}

KeysListResponse contains the result of the KeysList request

type KeysVoteResponse

type KeysVoteResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

KeysVoteResponse contains the result of the KeysVote request.

type LabelsCreateRequest

type LabelsCreateRequest struct {
	Name string `json:"name"`
}

type LabelsCreateResponse

type LabelsCreateResponse struct {
	Success bool          `json:"success"`
	Message string        `json:"message"`
	Label   *models.Label `json:"label,omitempty"`
}

LabelsCreateResponse contains the result of the LabelsCreate request.

type LabelsDeleteResponse

type LabelsDeleteResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

LabelsDeleteResponse contains the result of the LabelsDelete request.

type LabelsGetResponse

type LabelsGetResponse struct {
	Success bool          `json:"success"`
	Message string        `json:"message,omitempty"`
	Label   *models.Label `json:"label,omitempty"`
}

LabelsGetResponse contains the result of the LabelsGet request.

type LabelsListResponse

type LabelsListResponse struct {
	Success bool             `json:"success"`
	Message string           `json:"message,omitempty"`
	Labels  *[]*models.Label `json:"labels,omitempty"`
}

LabelsListResponse contains the result of the LabelsList request.

type LabelsUpdateRequest

type LabelsUpdateRequest struct {
	Name string `json:"name"`
}

type LabelsUpdateResponse

type LabelsUpdateResponse struct {
	Success bool          `json:"success"`
	Message string        `json:"message,omitempty"`
	Label   *models.Label `json:"label,omitempty"`
}

LabelsUpdateResponse contains the result of the LabelsUpdate request.

type ThreadsDeleteResponse

type ThreadsDeleteResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

ThreadsDeleteResponse contains the result of the ThreadsDelete request.

type ThreadsGetResponse

type ThreadsGetResponse struct {
	Success bool             `json:"success"`
	Message string           `json:"message"`
	Thread  *models.Thread   `json:"thread,omitempty"`
	Emails  *[]*models.Email `json:"emails,omitempty"`
}

ThreadsGetResponse contains the result of the ThreadsGet request.

type ThreadsListResponse

type ThreadsListResponse struct {
	Success bool              `json:"success"`
	Message string            `json:"message,omitempty"`
	Threads *[]*models.Thread `json:"threads,omitempty"`
}

ThreadsListResponse contains the result of the ThreadsList request.

type ThreadsUpdateRequest

type ThreadsUpdateRequest struct {
	Labels   []string `json:"labels"`
	IsRead   *bool    `json:"is_read"`
	LastRead *string  `json:"last_read"`
}

type ThreadsUpdateResponse

type ThreadsUpdateResponse struct {
	Success bool           `json:"success"`
	Message string         `json:"message,omitempty"`
	Thread  *models.Thread `json:"thread,omitempty"`
}

type TokensCreateRequest

type TokensCreateRequest struct {
	Username string `json:"username" schema:"username"`
	Password string `json:"password" schema:"password"`
	Type     string `json:"type" schema:"type"`
	Token    string `json:"token" schema:"token"`
}

TokensCreateRequest contains the input for the TokensCreate endpoint.

type TokensCreateResponse

type TokensCreateResponse struct {
	Success         bool          `json:"success"`
	Message         string        `json:"message,omitempty"`
	Token           *models.Token `json:"token,omitempty"`
	FactorType      string        `json:"factor_type,omitempty"`
	FactorChallenge string        `json:"factor_challenge,omitempty"`
}

TokensCreateResponse contains the result of the TokensCreate request.

type TokensDeleteResponse

type TokensDeleteResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

TokensDeleteResponse contains the result of the TokensDelete request.

type TokensGetResponse

type TokensGetResponse struct {
	Success bool          `json:"success"`
	Message string        `json:"message,omitempty"`
	Token   *models.Token `json:"token,omitempty"`
}

TokensGetResponse contains the result of the TokensGet request.

Jump to

Keyboard shortcuts

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