MCPcopy Create free account
hub / github.com/dropbox/dbxcli / UnmarshalJSON

Method UnmarshalJSON

cmd/auth.go:126–140  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

124}
125
126func (c *storedCredential) UnmarshalJSON(b []byte) error {
127 var accessToken string
128 if err := json.Unmarshal(b, &accessToken); err == nil {
129 *c = storedCredential{AccessToken: accessToken}
130 return nil
131 }
132
133 type storedCredentialAlias storedCredential
134 var credential storedCredentialAlias
135 if err := json.Unmarshal(b, &credential); err != nil {
136 return err
137 }
138 *c = storedCredential(credential)
139 return nil
140}
141
142func storedCredentialFromOAuthToken(token *oauth2.Token, appKey string) storedCredential {
143 credential := storedCredential{

Callers 1

decodeJSONValueForSchemaFunction · 0.80

Calls 1

storedCredentialStruct · 0.85

Tested by 1

decodeJSONValueForSchemaFunction · 0.64