Documentation ¶
Index ¶
- Constants
- func New(m *macaron.Macaron, backend *backend.Backend)
- type AddressResp
- type Api
- func (api *Api) Auth(ctx *macaron.Context, req AuthReq)
- func (api *Api) AuthCookies(ctx *macaron.Context, req AuthCookiesReq)
- func (api *Api) AuthInfo(ctx *macaron.Context, req AuthInfoReq)
- func (api *Api) Crash(ctx *macaron.Context, req CrashReq)
- func (api *Api) CreateAddress(ctx *macaron.Context, req CreateAddressReq) (err error)
- func (api *Api) CreateContacts(ctx *macaron.Context, req CreateContactsReq)
- func (api *Api) CreateDraft(ctx *macaron.Context, req MessageReq) (err error)
- func (api *Api) CreateLabel(ctx *macaron.Context, req LabelReq) (err error)
- func (api *Api) CreatePrivateKey(ctx *macaron.Context, req CreatePrivateKeyReq)
- func (api *Api) CreateUser(ctx *macaron.Context, req CreateUserReq) (err error)
- func (api *Api) DeleteAddress(ctx *macaron.Context) (err error)
- func (api *Api) DeleteAllContacts(ctx *macaron.Context) (err error)
- func (api *Api) DeleteAllMessages(ctx *macaron.Context) (err error)
- func (api *Api) DeleteAttachment(ctx *macaron.Context) error
- func (api *Api) DeleteAuth(ctx *macaron.Context)
- func (api *Api) DeleteContacts(ctx *macaron.Context, req BatchReq)
- func (api *Api) DeleteConversations(ctx *macaron.Context, req BatchReq)
- func (api *Api) DeleteLabel(ctx *macaron.Context) (err error)
- func (api *Api) DeleteMessages(ctx *macaron.Context, req BatchReq)
- func (api *Api) GetAttachment(ctx *macaron.Context) (b []byte, err error)
- func (api *Api) GetAvailableDomains(ctx *macaron.Context) (err error)
- func (api *Api) GetContacts(ctx *macaron.Context) (err error)
- func (api *Api) GetConversation(ctx *macaron.Context) (err error)
- func (api *Api) GetConversationsCount(ctx *macaron.Context) (err error)
- func (api *Api) GetCurrentUser(ctx *macaron.Context)
- func (api *Api) GetDirectUser(ctx *macaron.Context)
- func (api *Api) GetDomain(ctx *macaron.Context) (err error)
- func (api *Api) GetEvent(ctx *macaron.Context) (err error)
- func (api *Api) GetLabels(ctx *macaron.Context) (err error)
- func (api *Api) GetMembers(ctx *macaron.Context)
- func (api *Api) GetMessage(ctx *macaron.Context) (err error)
- func (api *Api) GetMessagesCount(ctx *macaron.Context) (err error)
- func (api *Api) GetMessagesTotal(ctx *macaron.Context) (err error)
- func (api *Api) GetPaymentMethods(ctx *macaron.Context)
- func (api *Api) GetPlans(ctx *macaron.Context)
- func (api *Api) GetPublicKeys(ctx *macaron.Context) (err error)
- func (api *Api) GetSubscription(ctx *macaron.Context)
- func (api *Api) GetUserDomains(ctx *macaron.Context) (err error)
- func (api *Api) GetUserOrganization(ctx *macaron.Context)
- func (api *Api) GetUsernameAvailable(ctx *macaron.Context) (err error)
- func (api *Api) ListConversations(ctx *macaron.Context) (err error)
- func (api *Api) ListMessages(ctx *macaron.Context) (err error)
- func (api *Api) SendMessage(ctx *macaron.Context, req SendMessageReq) (err error)
- func (api *Api) ToggleAddress(ctx *macaron.Context) (err error)
- func (api *Api) UpdateAllPrivateKeys(ctx *macaron.Context, req UpdateAllPrivateKeysReq)
- func (api *Api) UpdateContact(ctx *macaron.Context, req UpdateContactReq) (err error)
- func (api *Api) UpdateConversationsLabel(ctx *macaron.Context, req UpdateConversationsLabelReq)
- func (api *Api) UpdateConversationsRead(ctx *macaron.Context, req BatchReq)
- func (api *Api) UpdateConversationsStar(ctx *macaron.Context, req BatchReq)
- func (api *Api) UpdateConversationsSystemLabel(ctx *macaron.Context, req BatchReq)
- func (api *Api) UpdateDraft(ctx *macaron.Context, req MessageReq) (err error)
- func (api *Api) UpdateLabel(ctx *macaron.Context, req LabelReq) (err error)
- func (api *Api) UpdateLabelsOrder(ctx *macaron.Context, req LabelsOrderReq) (err error)
- func (api *Api) UpdateMessagesLabel(ctx *macaron.Context, req UpdateMessagesLabelReq)
- func (api *Api) UpdateMessagesRead(ctx *macaron.Context, req BatchReq)
- func (api *Api) UpdateMessagesStar(ctx *macaron.Context, req BatchReq)
- func (api *Api) UpdateMessagesSystemLabel(ctx *macaron.Context, req BatchReq)
- func (api *Api) UpdateUserAutoSaveContacts(ctx *macaron.Context, req UpdateUserSettingsReq)
- func (api *Api) UpdateUserComposerMode(ctx *macaron.Context, req UpdateUserSettingsReq)
- func (api *Api) UpdateUserDisplayName(ctx *macaron.Context, req UpdateUserSettingsReq)
- func (api *Api) UpdateUserMessageButtons(ctx *macaron.Context, req UpdateUserSettingsReq)
- func (api *Api) UpdateUserPassword(ctx *macaron.Context, req UpdateUserPasswordReq)
- func (api *Api) UpdateUserShowImages(ctx *macaron.Context, req UpdateUserSettingsReq)
- func (api *Api) UpdateUserSignature(ctx *macaron.Context, req UpdateUserSettingsReq)
- func (api *Api) UpdateUserTheme(ctx *macaron.Context, req UpdateUserSettingsReq)
- func (api *Api) UpdateUserViewLayout(ctx *macaron.Context, req UpdateUserSettingsReq)
- func (api *Api) UploadAttachment(ctx *macaron.Context, req UploadAttachmentReq) (err error)
- type AuthCookie
- type AuthCookiesReq
- type AuthCookiesResp
- type AuthInfoReq
- type AuthInfoResp
- type AuthReq
- type AuthResp
- type AvailableDomainsResp
- type BatchReq
- type BatchResp
- type BatchRespItem
- type ClientType
- type ContactResp
- type ContactsResp
- type ConversationResp
- type ConversationsListResp
- type CrashReq
- type CreateAddressReq
- type CreateContactsReq
- type CreatePrivateKeyReq
- type CreateUserReq
- type DirectUserResp
- type DomainResp
- type DomainsResp
- type ErrorResp
- type EventResp
- type LabelReq
- type LabelResp
- type LabelsOrderReq
- type LabelsResp
- type Member
- type MembersResp
- type MessageReq
- type MessageResp
- type MessagesCountResp
- type MessagesListResp
- type MessagesTotalResp
- type Organization
- type OrganizationResp
- type PaymentMethodsResp
- type Plan
- type PlansResp
- type Req
- type Resp
- type RespCode
- type SendMessageReq
- type SendMessageResp
- type Session
- type Subscription
- type SubscriptionResp
- type TokenType
- type UpdateAllPrivateKeysReq
- type UpdateContactReq
- type UpdateConversationsLabelReq
- type UpdateLabelReq
- type UpdateMessagesLabelReq
- type UpdateUserPasswordReq
- type UpdateUserSettingsReq
- type UploadAttachmentReq
- type UploadAttachmentResp
- type UserResp
- type UsernameAvailableResp
Constants ¶
View Source
const ( Ok RespCode = 1000 Batch = 1001 BadRequest = 400 NotFound = 404 InternalServerError = 500 )
View Source
const SessionTimeout = 10 * time.Minute
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddressResp ¶
type Api ¶
type Api struct {
// contains filtered or unexported fields
}
func (*Api) AuthCookies ¶
func (api *Api) AuthCookies(ctx *macaron.Context, req AuthCookiesReq)
func (*Api) AuthInfo ¶
func (api *Api) AuthInfo(ctx *macaron.Context, req AuthInfoReq)
func (*Api) CreateAddress ¶
func (api *Api) CreateAddress(ctx *macaron.Context, req CreateAddressReq) (err error)
func (*Api) CreateContacts ¶
func (api *Api) CreateContacts(ctx *macaron.Context, req CreateContactsReq)
func (*Api) CreateDraft ¶
func (api *Api) CreateDraft(ctx *macaron.Context, req MessageReq) (err error)
func (*Api) CreateLabel ¶
func (*Api) CreatePrivateKey ¶
func (api *Api) CreatePrivateKey(ctx *macaron.Context, req CreatePrivateKeyReq)
func (*Api) CreateUser ¶
func (api *Api) CreateUser(ctx *macaron.Context, req CreateUserReq) (err error)
func (*Api) DeleteAddress ¶
func (*Api) DeleteAllContacts ¶
func (*Api) DeleteAllMessages ¶
func (*Api) DeleteAttachment ¶
func (*Api) DeleteAuth ¶
func (api *Api) DeleteAuth(ctx *macaron.Context)
func (*Api) DeleteContacts ¶
func (*Api) DeleteConversations ¶
func (*Api) DeleteLabel ¶
func (*Api) DeleteMessages ¶
func (*Api) GetAttachment ¶
func (*Api) GetAvailableDomains ¶
func (*Api) GetContacts ¶
func (*Api) GetConversation ¶
func (*Api) GetConversationsCount ¶
func (*Api) GetCurrentUser ¶
func (api *Api) GetCurrentUser(ctx *macaron.Context)
func (*Api) GetDirectUser ¶
func (api *Api) GetDirectUser(ctx *macaron.Context)
func (*Api) GetMembers ¶
func (api *Api) GetMembers(ctx *macaron.Context)
func (*Api) GetMessage ¶
func (*Api) GetMessagesCount ¶
func (*Api) GetMessagesTotal ¶
func (*Api) GetPaymentMethods ¶
func (api *Api) GetPaymentMethods(ctx *macaron.Context)
func (*Api) GetPublicKeys ¶
func (*Api) GetSubscription ¶
func (api *Api) GetSubscription(ctx *macaron.Context)
func (*Api) GetUserDomains ¶
func (*Api) GetUserOrganization ¶
func (api *Api) GetUserOrganization(ctx *macaron.Context)
func (*Api) GetUsernameAvailable ¶
func (*Api) ListConversations ¶
func (*Api) ListMessages ¶
func (*Api) SendMessage ¶
func (api *Api) SendMessage(ctx *macaron.Context, req SendMessageReq) (err error)
func (*Api) ToggleAddress ¶
func (*Api) UpdateAllPrivateKeys ¶
func (api *Api) UpdateAllPrivateKeys(ctx *macaron.Context, req UpdateAllPrivateKeysReq)
func (*Api) UpdateContact ¶
func (api *Api) UpdateContact(ctx *macaron.Context, req UpdateContactReq) (err error)
func (*Api) UpdateConversationsLabel ¶
func (api *Api) UpdateConversationsLabel(ctx *macaron.Context, req UpdateConversationsLabelReq)
func (*Api) UpdateConversationsRead ¶
func (*Api) UpdateConversationsStar ¶
func (*Api) UpdateConversationsSystemLabel ¶
func (*Api) UpdateDraft ¶
func (api *Api) UpdateDraft(ctx *macaron.Context, req MessageReq) (err error)
func (*Api) UpdateLabel ¶
func (*Api) UpdateLabelsOrder ¶
func (api *Api) UpdateLabelsOrder(ctx *macaron.Context, req LabelsOrderReq) (err error)
func (*Api) UpdateMessagesLabel ¶
func (api *Api) UpdateMessagesLabel(ctx *macaron.Context, req UpdateMessagesLabelReq)
func (*Api) UpdateMessagesRead ¶
func (*Api) UpdateMessagesStar ¶
func (*Api) UpdateMessagesSystemLabel ¶
func (*Api) UpdateUserAutoSaveContacts ¶
func (api *Api) UpdateUserAutoSaveContacts(ctx *macaron.Context, req UpdateUserSettingsReq)
func (*Api) UpdateUserComposerMode ¶
func (api *Api) UpdateUserComposerMode(ctx *macaron.Context, req UpdateUserSettingsReq)
func (*Api) UpdateUserDisplayName ¶
func (api *Api) UpdateUserDisplayName(ctx *macaron.Context, req UpdateUserSettingsReq)
func (*Api) UpdateUserMessageButtons ¶
func (api *Api) UpdateUserMessageButtons(ctx *macaron.Context, req UpdateUserSettingsReq)
func (*Api) UpdateUserPassword ¶
func (api *Api) UpdateUserPassword(ctx *macaron.Context, req UpdateUserPasswordReq)
func (*Api) UpdateUserShowImages ¶
func (api *Api) UpdateUserShowImages(ctx *macaron.Context, req UpdateUserSettingsReq)
func (*Api) UpdateUserSignature ¶
func (api *Api) UpdateUserSignature(ctx *macaron.Context, req UpdateUserSettingsReq)
func (*Api) UpdateUserTheme ¶
func (api *Api) UpdateUserTheme(ctx *macaron.Context, req UpdateUserSettingsReq)
func (*Api) UpdateUserViewLayout ¶
func (api *Api) UpdateUserViewLayout(ctx *macaron.Context, req UpdateUserSettingsReq)
func (*Api) UploadAttachment ¶
func (api *Api) UploadAttachment(ctx *macaron.Context, req UploadAttachmentReq) (err error)
type AuthCookie ¶
type AuthCookiesReq ¶
type AuthCookiesResp ¶
type AuthInfoReq ¶
type AuthInfoResp ¶
type AvailableDomainsResp ¶
type BatchResp ¶
type BatchResp struct { Resp Responses []*BatchRespItem }
type BatchRespItem ¶
type BatchRespItem struct { ID string Response interface{} }
type ContactResp ¶
type ContactsResp ¶
type ConversationResp ¶
type ConversationResp struct { Resp Conversation *backend.Conversation Messages []*backend.Message }
type ConversationsListResp ¶
type ConversationsListResp struct { Resp Total int Conversations []*backend.Conversation }
type CrashReq ¶
type CrashReq struct { Req OS string OSVersion string Browser string BrowserVersion string Client string ClientVersion string ClientType ClientType Debug json.RawMessage }
type CreateAddressReq ¶
type CreateContactsReq ¶
type CreatePrivateKeyReq ¶
type CreateUserReq ¶
type DirectUserResp ¶
type DomainResp ¶
type DomainsResp ¶
type LabelsOrderReq ¶
type LabelsOrderReq struct {
Order []int
}
type LabelsResp ¶
type MembersResp ¶
type MessageReq ¶
type MessageResp ¶
type MessagesCountResp ¶
type MessagesCountResp struct { Resp Counts []*backend.MessagesCount }
type MessagesTotalResp ¶
type MessagesTotalResp struct { Resp backend.MessagesTotal }
type Organization ¶
type OrganizationResp ¶
type OrganizationResp struct { Resp Organization *Organization }
type PaymentMethodsResp ¶
type PaymentMethodsResp struct { Resp PaymentMethods []interface{} // TODO }
type SendMessageReq ¶
type SendMessageReq struct { Req ID string `json:"id"` Packages []*backend.MessagePackage AttachmentKeys []*backend.AttachmentKey ClearBody string }
type SendMessageResp ¶
type Session ¶
func NewSession ¶
type Subscription ¶
type SubscriptionResp ¶
type SubscriptionResp struct { Resp Subscription *Subscription }
type UpdateAllPrivateKeysReq ¶
type UpdateContactReq ¶
type UpdateConversationsLabelReq ¶
type UpdateConversationsLabelReq struct { UpdateLabelReq ConversationIDs []string }
type UpdateLabelReq ¶
type UpdateMessagesLabelReq ¶
type UpdateMessagesLabelReq struct { UpdateLabelReq MessageIDs []string }
type UpdateUserPasswordReq ¶
type UpdateUserSettingsReq ¶
type UploadAttachmentReq ¶
type UploadAttachmentReq struct { Filename string `form:"Filename"` MessageID string `form:"MessageID"` MIMEType string `form:"MIMEType"` ContentID string `form:"ContentID"` KeyPackets *multipart.FileHeader `form:"KeyPackets"` DataPacket *multipart.FileHeader `form:"DataPacket"` }
form: attributes are needed to parse multipart form See https://github.com/go-macaron/binding/issues/10
type UploadAttachmentResp ¶
type UsernameAvailableResp ¶
Click to show internal directories.
Click to hide internal directories.