Documentation ¶
Index ¶
- func AccountsCreate(w http.ResponseWriter, r *http.Request)
- func AccountsDelete(c web.C, w http.ResponseWriter, r *http.Request)
- func AccountsGet(c web.C, w http.ResponseWriter, r *http.Request)
- func AccountsList(w http.ResponseWriter, r *http.Request)
- func AccountsStartOnboarding(c web.C, w http.ResponseWriter, r *http.Request)
- func AccountsUpdate(c web.C, w http.ResponseWriter, r *http.Request)
- func AccountsWipeData(c web.C, w http.ResponseWriter, r *http.Request)
- func AddressesList(c web.C, w http.ResponseWriter, r *http.Request)
- func AuthMiddleware(c *web.C, h http.Handler) http.Handler
- func Avatars(c web.C, w http.ResponseWriter, r *http.Request)
- func ContactsCreate(c web.C, w http.ResponseWriter, r *http.Request)
- func ContactsDelete(c web.C, w http.ResponseWriter, r *http.Request)
- func ContactsGet(c web.C, w http.ResponseWriter, r *http.Request)
- func ContactsList(c web.C, w http.ResponseWriter, r *http.Request)
- func ContactsUpdate(c web.C, w http.ResponseWriter, r *http.Request)
- func EmailsCreate(c web.C, w http.ResponseWriter, r *http.Request)
- func EmailsDelete(c web.C, w http.ResponseWriter, r *http.Request)
- func EmailsGet(c web.C, w http.ResponseWriter, r *http.Request)
- func EmailsList(c web.C, w http.ResponseWriter, r *http.Request)
- func FilesCreate(c web.C, w http.ResponseWriter, r *http.Request)
- func FilesDelete(c web.C, w http.ResponseWriter, r *http.Request)
- func FilesGet(c web.C, w http.ResponseWriter, r *http.Request)
- func FilesList(c web.C, w http.ResponseWriter, r *http.Request)
- func FilesUpdate(c web.C, w http.ResponseWriter, r *http.Request)
- func Hello(w http.ResponseWriter, r *http.Request)
- func KeysCreate(c web.C, w http.ResponseWriter, r *http.Request)
- func KeysGet(c web.C, w http.ResponseWriter, r *http.Request)
- func KeysList(w http.ResponseWriter, r *http.Request)
- func KeysVote(w http.ResponseWriter, r *http.Request)
- func LabelsCreate(c web.C, w http.ResponseWriter, req *http.Request)
- func LabelsDelete(c web.C, w http.ResponseWriter, req *http.Request)
- func LabelsGet(c web.C, w http.ResponseWriter, req *http.Request)
- func LabelsList(c web.C, w http.ResponseWriter, req *http.Request)
- func LabelsUpdate(c web.C, w http.ResponseWriter, req *http.Request)
- func ThreadsDelete(c web.C, w http.ResponseWriter, r *http.Request)
- func ThreadsGet(c web.C, w http.ResponseWriter, r *http.Request)
- func ThreadsList(c web.C, w http.ResponseWriter, r *http.Request)
- func ThreadsUpdate(c web.C, w http.ResponseWriter, r *http.Request)
- func TokensCreate(w http.ResponseWriter, r *http.Request)
- func TokensDelete(c web.C, w http.ResponseWriter, r *http.Request)
- func TokensGet(c web.C, w http.ResponseWriter, r *http.Request)
- type AccountsCreateRequest
- type AccountsCreateResponse
- type AccountsDeleteResponse
- type AccountsGetResponse
- type AccountsListResponse
- type AccountsStartOnboardingResponse
- type AccountsUpdateRequest
- type AccountsUpdateResponse
- type AccountsWipeDataResponse
- type AddressesListResponse
- type AuthMiddlewareResponse
- type ContactsCreateRequest
- type ContactsCreateResponse
- type ContactsDeleteResponse
- type ContactsGetResponse
- type ContactsListResponse
- type ContactsUpdateRequest
- type ContactsUpdateResponse
- type EmailsCreateRequest
- type EmailsCreateResponse
- type EmailsDeleteResponse
- type EmailsGetResponse
- type EmailsListResponse
- type FilesCreateRequest
- type FilesCreateResponse
- type FilesDeleteResponse
- type FilesGetResponse
- type FilesListResponse
- type FilesUpdateRequest
- type FilesUpdateResponse
- type HelloResponse
- type KeysCreateRequest
- type KeysCreateResponse
- type KeysGetResponse
- type KeysListResponse
- type KeysVoteResponse
- type LabelsCreateRequest
- type LabelsCreateResponse
- type LabelsDeleteResponse
- type LabelsGetResponse
- type LabelsListResponse
- type LabelsUpdateRequest
- type LabelsUpdateResponse
- type ThreadsDeleteResponse
- type ThreadsGetResponse
- type ThreadsListResponse
- type ThreadsUpdateRequest
- type ThreadsUpdateResponse
- type TokensCreateRequest
- type TokensCreateResponse
- type TokensDeleteResponse
- type TokensGetResponse
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 ¶
AccountsDelete deletes an account and everything related to it.
func AccountsGet ¶
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 AccountsUpdate ¶
AccountsUpdate allows changing the account's information (password etc.)
func AccountsWipeData ¶
AccountsWipeData wipes all data except the actual account and billing info.
func AddressesList ¶
func AuthMiddleware ¶
AuthMiddleware checks whether the token passed with the request is valid
func ContactsCreate ¶
ContactsCreate creates a new contact
func ContactsDelete ¶
ContactsDelete removes a contact from the database
func ContactsGet ¶
ContactsGet gets the requested contact from the database
func ContactsList ¶
ContactsList does *something* - TODO
func ContactsUpdate ¶
ContactsUpdate updates an existing contact in the database
func EmailsCreate ¶
EmailsCreate sends a new email
func EmailsDelete ¶
EmailsDelete remvoes an email from the system
func EmailsList ¶
EmailsList sends a list of the emails in the inbox.
func FilesCreate ¶
FilesCreate creates a new file
func FilesDelete ¶
FilesDelete removes a file from the database
func FilesUpdate ¶
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 ¶
KeysCreate appens a new key to the server
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 ¶
LabelsCreate does *something* - TODO
func LabelsDelete ¶
LabelsDelete does *something* - TODO
func LabelsList ¶
LabelsList fetches all labels
func LabelsUpdate ¶
LabelsUpdate does *something* - TODO
func ThreadsDelete ¶
ThreadsDelete removes a thread from the database
func ThreadsGet ¶
ThreadsGet returns information about a single thread.
func ThreadsList ¶
ThreadsList shows all threads
func ThreadsUpdate ¶
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 ¶
TokensDelete destroys either the current auth token or the one passed as an URL param
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 ¶
AccountsListResponse contains the result of the AccountsList request.
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 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 ¶
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 FilesDeleteResponse ¶
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 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 ¶
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 ¶
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 ¶
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 ThreadsUpdateResponse ¶
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 ¶
TokensDeleteResponse contains the result of the TokensDelete request.