~mardy/account-polld/dekko-gmail

« back to all changes in this revision

Viewing changes to accounts/accounts.go

  • Committer: CI Train Bot
  • Author(s): Renato Araujo Oliveira Filho
  • Date: 2016-04-21 23:33:48 UTC
  • mfrom: (157.2.16 account-polld)
  • Revision ID: ci-train-bot@canonical.com-20160421233348-qu4f1eln0r771269
Create gcalendar plugin.
Approved by: Jonas G. Drange, PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
type AuthData struct {
40
40
        AccountId   uint
41
41
        ServiceName string
 
42
        ServiceType string
42
43
        Error       error
43
44
        Enabled     bool
44
45
 
76
77
}
77
78
 
78
79
//export authCallback
79
 
func authCallback(watcher unsafe.Pointer, accountId C.uint, serviceName *C.char, error *C.GError, enabled C.int, clientId, clientSecret, accessToken, tokenSecret *C.char, userData unsafe.Pointer) {
 
80
func authCallback(watcher unsafe.Pointer, accountId C.uint, serviceType *C.char, serviceName *C.char, error *C.GError, enabled C.int, clientId, clientSecret, accessToken, tokenSecret *C.char, userData unsafe.Pointer) {
80
81
        // Ideally the first argument would be of type
81
82
        // *C.AccountWatcher, but that fails with Go 1.2.
82
83
        authChannelsLock.Lock()
90
91
        var data AuthData
91
92
        data.AccountId = uint(accountId)
92
93
        data.ServiceName = C.GoString(serviceName)
 
94
        data.ServiceType = C.GoString(serviceType)
93
95
        if error != nil {
94
96
                data.Error = errors.New(C.GoString((*C.char)(error.message)))
95
97
        }