Documentation ¶
Overview ¶
A client-side library for interacting with Context.IO.
Index ¶
- Constants
- type Account
- type AccountEmailAddressBlock
- type AddAccountResponse
- type Address
- type Client
- type ConnectToken
- type ConnectTokenAccountBlock
- type Contact
- type ContactList
- type ContactListQueryBlock
- type CreateAccount
- type CreateAccountAndSource
- type CreateSource
- type Error
- type File
- type Message
- type MessageAddressesBlock
- type MessageBody
- type MessageFilesBlock
- type MessagePersonInfoBlock
- type MessageSourcesBlock
- type Source
- type SyncMailboxBlock
- type SyncResponse
- type Thread
- type ThreadList
- type ThumbnailBlock
Constants ¶
const ( API_URL = "https://api.context.io" API_VERSION = "2.0" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { Id string `json:"id"` Username string `json:"username"` Created int `json:"created"` Suspended int `json:"suspended"` EmailAddresses []string `json:"email_addresses"` FirstName string `json:"first_name"` LastName string `json:"last_name"` PasswordExpired int `json:"password_expired"` Sources []Source `json:"sources"` NBMessages int `json:"nb_messages"` NBFiles int `json:"nb_files"` }
Represents a JSON object representing an account, in context.io.
type AddAccountResponse ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Do ¶
func (c *Client) Do(method string, params map[string]string, parts ...string) (resp *http.Response, err error)
Perform a two-legged OAuth 1.0 request against the context.io API.
The supported values for the method are "GET", "POST", "PUT", and "DELETE".
The params string-string map is for any extra parameters you wish to provide to an endpoint, that will be URL-encoded.
The rest of the arguments are the various parts of the API endpoint's URI, done like a print-like function:
var account Account ... c.Do("GET", nil, "accounts", account.Id, "files")
...this is so that you do not have to constantly re-create the a URI string to pass to this function.
func (*Client) EnableDebugging ¶
Enables debugging of the OAuth consumer when set to true. Providing a value of false disables debugging.
type ConnectToken ¶
type ConnectToken struct { Token string `json:"token"` Email string `json:"email"` Created int `json:"created"` Used int `json:"used"` Expires interface{} `json:"expires"` // Can be an int, or a boolean CallbackUrl string `json:"callback_url"` FirstName string `json:"first_name"` LastName string `json:"last_name"` Account ConnectTokenAccountBlock `json:"account,omitempty"` }
type ContactList ¶
type ContactList struct { Query ContactListQueryBlock `json:"query"` Matches []Contact `json:"matches"` }
type ContactListQueryBlock ¶
type CreateAccount ¶
type CreateAccountAndSource ¶
type CreateAccountAndSource struct { CreateAccount CreateSource }
type CreateSource ¶
type CreateSource struct { Email string `json:"email"` Server string `json:"server"` Username string `json:"username"` UseSSL int `json:"use_ssl"` Port int `json:"port"` Type string `json:"type"` OriginIP string `json:"origin_ip,omitempty"` SyncPeriod string `json:"sync_period,omitempty"` ExpungeOnDeletedFlag int `json:"expunge_on_deleted_flag,omitempty"` SyncFlags int `json:"sync_flags,omitempty"` SyncAllFolders int `json:"sync_all_folders,omitempty"` RawFileList int `json:"raw_file_list,omitempty"` Password string `json:"password,omitempty"` ProviderRefreshToken string `json:"password_refresh_token,omitempty"` ProviderToken string `json:"provider_token,omitempty"` ProviderTokenSecret string `json:"provider_token_secret,omitempty"` ProviderConsumerKey string `json:"provider_consumer_key,omitempty"` CallbackUrl string `json:"callback_url,omitempty"` }
type File ¶
type File struct { Size int `json:"size"` Type string `json:"type"` Subject string `json:"subject"` Date int `json:"date"` DateIndexed int `json:"date_indexed"` Addresses MessageAddressesBlock `json:"addresses"` PersonInfo MessagePersonInfoBlock `json:"person_info"` FileName string `json:"file_name"` FileNameStructure map[string][]string `json:"file_name_structure"` BodySection int `json:"body_section"` FileId string `json:"file_id"` SupportsPreview bool `json:"supports_preview"` IsEmbedded bool `json:"is_embedded"` ContentDisposition string `json:"content_disposition"` ContentId string `json:"content_id"` MessageId string `json:"message_id"` EmailMessageId string `json:"email_message_id"` GmailMessageId string `json:"gmail_message_id"` GmailThreadId string `json:"gmail_thread_id"` }
type Message ¶
type Message struct { Date int `json:"date,omitempty"` DateIndexed int `json:"date_indexed,omitempty"` DateReceived int `json:"date_received,omitempty"` Addresses MessageAddressesBlock `json:"addresses,omitempty"` PersonInfo MessagePersonInfoBlock `json:"person_info,omitempty"` EmailMessageId string `json:"email_message_id,omitempty"` MessageId string `json:"message_id,omitempty"` GmailMessageId string `json:"gmail_message_id,omitempty"` GmailThreadId string `json:"gmail_thread_id,omitempty"` Files []MessageFilesBlock `json:"files,omitempty,omitempty"` Subject string `json:"subject,omitempty"` Folders []string `json:"folders,omitempty"` Sources []MessageSourcesBlock `json:"sources,omitempty"` ResourceURL string `json:"resource_url,omitempty"` }
type MessageAddressesBlock ¶
type MessageBody ¶
type MessageFilesBlock ¶
type MessageFilesBlock struct { Size int `json:"size,omitempty"` Type string `json:"type"` FileName string `json:"file_name"` FileNameStructure [][]string `json:"file_name_structure"` BodySection string `json:"body_section,omitempty"` FileId string `json:"file_id"` IsEmbedded bool `json:"is_embedded"` ContentDisposition string `json:"content_disposition"` ContentId string `json:"content_id"` }
type MessagePersonInfoBlock ¶
type MessagePersonInfoBlock map[string]ThumbnailBlock
type MessageSourcesBlock ¶
type Source ¶
type Source struct { Server string `json:"server"` Label string `json:"label"` Username string `json:"username"` Port int `json:"port"` AuthenticationType string `json:"authentication_type"` Status string `json:"status"` ServiceLevel string `json:"service_level"` SyncPeriod string `json:"sync_period"` UseSSL bool `json:"use_ssl"` Type string `json:"type"` ResourceURL string `json:"resource_url"` }
type SyncMailboxBlock ¶
type SyncResponse ¶
type SyncResponse map[string]map[string]SyncMailboxBlock
type Thread ¶
type Thread struct { GmailThreadId string `json:"gmail_thread_id"` EmailMessagesId []string `json:"email_messages_id"` PersonInfo MessagePersonInfoBlock `json:"person_info"` Messages []Message `json:"messages"` }
type ThreadList ¶
type ThreadList []string
type ThumbnailBlock ¶
type ThumbnailBlock struct {
Thumbnail string `json:"thumbnail"`
}