當前位置: 首頁>>代碼示例>>Golang>>正文


Golang JSONObject.GetAsString方法代碼示例

本文整理匯總了Golang中github.com/pomack/jsonhelper/go/jsonhelper.JSONObject.GetAsString方法的典型用法代碼示例。如果您正苦於以下問題:Golang JSONObject.GetAsString方法的具體用法?Golang JSONObject.GetAsString怎麽用?Golang JSONObject.GetAsString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/pomack/jsonhelper/go/jsonhelper.JSONObject的用法示例。


在下文中一共展示了JSONObject.GetAsString方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: SetFromJSON

func (p *loginAccountContext) SetFromJSON(obj jsonhelper.JSONObject) {
	p.username = obj.GetAsString("username")
	p.password = obj.GetAsString("password")
	p.inputValidated = false
	p.user = nil
	p.result = nil
}
開發者ID:pomack,項目名稱:dsocial.go,代碼行數:7,代碼來源:login.go

示例2: FromJSON

func (p *Name) FromJSON(o jsonhelper.JSONObject) {
	p.GivenName = o.GetAsString("givenName")
	p.MiddleName = o.GetAsString("middleName")
	p.FamilyName = o.GetAsString("familyName")
	p.Prefix = o.GetAsString("prefix")
	p.Suffix = o.GetAsString("suffix")
	p.GivenNameSound = o.GetAsString("givenNameSound")
	p.FamilyNameSound = o.GetAsString("familyNameSound")
}
開發者ID:pombredanne,項目名稱:contacts.go,代碼行數:9,代碼來源:structs.go

示例3: FromJSON

func (p *smugMugUserInfoResult) FromJSON(props jsonhelper.JSONObject) {
	LogDebug("user info result from json: ", props)
	p.id = props.GetAsInt64("id")
	p.accountStatus = props.GetAsString("AccountStatus")
	p.accountType = props.GetAsString("AccountType")
	p.fileSizeLimit = props.GetAsInt64("FileSizeLimit")
	p.name = props.GetAsString("Name")
	p.nickname = props.GetAsString("NickName")
	p.smugVault = props.GetAsBool("SmugVault")
	p.url = props.GetAsString("URL")
}
開發者ID:pomack,項目名稱:oauth2_client.go,代碼行數:11,代碼來源:smugmug.go

示例4: SetFromJSON

func (p *createAccountContext) SetFromJSON(obj jsonhelper.JSONObject) {
	p.user = nil
	p.consumer = nil
	p.externalUser = nil
	theType := p.theType
	if theType == "" {
		theType = obj.GetAsString("type")
	}
	switch theType {
	case "user":
		p.user = new(dm.User)
		p.user.InitFromJSONObject(obj)
	case "consumer":
		p.consumer = new(dm.Consumer)
		p.consumer.InitFromJSONObject(obj)
	case "external_user":
		p.externalUser = new(dm.ExternalUser)
		p.externalUser.InitFromJSONObject(obj)
	}
}
開發者ID:pombredanne,項目名稱:dsocial.go,代碼行數:20,代碼來源:create.go

示例5: InitFromJSONObject

func (p *Consumer) InitFromJSONObject(obj jsonhelper.JSONObject) {
	p.PersistableModel.InitFromJSONObject(obj)
	p.DomainName = obj.GetAsString("domain_name")
	p.HomePage = obj.GetAsString("home_page")
	p.AuthorizationPage = obj.GetAsString("authorization_page")
	p.ShortName = obj.GetAsString("short_name")
	p.Name = obj.GetAsString("name")
	p.Email = obj.GetAsString("email")
	p.PhoneNumber = obj.GetAsString("phone_number")
	p.IsTrusted = obj.GetAsBool("is_trusted")
	p.IsSuggested = obj.GetAsBool("is_suggested")
	p.AllowLogin = obj.GetAsBool("allow_login")
	p.DisableLoginAt = obj.GetAsInt64("disable_login_at")
}
開發者ID:pombredanne,項目名稱:dsocial.go,代碼行數:14,代碼來源:accounts.go

示例6: SetFromJSON

func (p *setPasswordContext) SetFromJSON(obj jsonhelper.JSONObject) {
	p.password = obj.GetAsString("password")
	p.result = nil
}
開發者ID:pomack,項目名稱:dsocial.go,代碼行數:4,代碼來源:set_password.go

示例7: Initialize

func (p *linkedInClient) Initialize(properties jsonhelper.JSONObject) {
	if p.currentCredentials == nil {
		p.currentCredentials = NewStandardAuthToken()
	}
	if properties == nil {
		return
	}
	if v := properties.GetAsString("linkedin.api.key"); len(v) > 0 {
		p.consumerKey = v
		//p.Credentials.Token = v
	}
	if v := properties.GetAsString("linkedin.client.redirect_uri"); len(v) > 0 {
		p.callbackUrl = v
	}
	if v := properties.GetAsString("linkedin.secret.key"); len(v) > 0 {
		p.consumerSecret = v
		//p.Credentials.Secret = v
	}
	if v := properties.GetAsString("linkedin.oauth1.scope"); len(v) > 0 {
		//p.Scope = v
	}
	if v := properties.GetAsString("linkedin.client.token"); len(v) > 0 {
		p.currentCredentials.SetToken(v)
	}
	if v := properties.GetAsString("linkedin.client.secret"); len(v) > 0 {
		p.currentCredentials.SetSecret(v)
	}
}
開發者ID:pomack,項目名稱:oauth2_client.go,代碼行數:28,代碼來源:linkedin.go

示例8: FromJSON

func (p *yahooUserInfoIm) FromJSON(props jsonhelper.JSONObject) {
	p.handle = props.GetAsString("handle")
	p.id = props.GetAsInt("id")
	p.theType = props.GetAsString("type")
}
開發者ID:pomack,項目名稱:oauth2_client.go,代碼行數:5,代碼來源:yahoo.go

示例9: Initialize

func (p *yahooClient) Initialize(properties jsonhelper.JSONObject) {
	if p.currentCredentials == nil {
		p.currentCredentials = &yahooAccessTokenResult{}
	}
	if properties == nil {
		return
	}
	if v := properties.GetAsString("yahoo.realm"); len(v) > 0 {
		p.realm = v
	}
	if v := properties.GetAsString("yahoo.consumer.key"); len(v) > 0 {
		p.consumerKey = v
		//p.Credentials.Token = v
	}
	if v := properties.GetAsString("yahoo.consumer.secret"); len(v) > 0 {
		p.consumerSecret = v
		//p.Credentials.Secret = v
	}
	if v := properties.GetAsString("yahoo.client.redirect_uri"); len(v) > 0 {
		p.callbackUrl = v
	}
	if v := properties.GetAsString("yahoo.oauth1.scope"); len(v) > 0 {
		//p.Scope = v
	}
	if v := properties.GetAsString("yahoo.client.token"); len(v) > 0 {
		p.currentCredentials.SetToken(v)
	}
	if v := properties.GetAsString("yahoo.client.secret"); len(v) > 0 {
		p.currentCredentials.SetSecret(v)
	}
}
開發者ID:pomack,項目名稱:oauth2_client.go,代碼行數:31,代碼來源:yahoo.go

示例10: Initialize

func (p *smugMugClient) Initialize(properties jsonhelper.JSONObject) {
	if p.currentCredentials == nil {
		p.currentCredentials = NewStandardAuthToken()
	}
	if properties == nil {
		return
	}
	if v := properties.GetAsString("smugmug.realm"); len(v) > 0 {
		p.realm = v
	}
	if v := properties.GetAsString("smugmug.app.name"); len(v) > 0 {
		p.appName = v
	}
	if v := properties.GetAsString("smugmug.consumer.key"); len(v) > 0 {
		p.consumerKey = v
		//p.Credentials.Token = v
	}
	if v := properties.GetAsString("smugmug.consumer.secret"); len(v) > 0 {
		p.consumerSecret = v
		//p.Credentials.Secret = v
	}
	if v := properties.GetAsString("smugmug.client.redirect_uri"); len(v) > 0 {
		p.callbackUrl = v
	}
	if v := properties.GetAsString("smugmug.oauth1.scope"); len(v) > 0 {
		//p.Scope = v
	}
	if v := properties.GetAsString("smugmug.client.token"); len(v) > 0 {
		p.currentCredentials.SetToken(v)
	}
	if v := properties.GetAsString("smugmug.client.secret"); len(v) > 0 {
		p.currentCredentials.SetSecret(v)
	}
}
開發者ID:pomack,項目名稱:oauth2_client.go,代碼行數:34,代碼來源:smugmug.go

示例11: FromJSON

func (p *facebookLocation) FromJSON(props jsonhelper.JSONObject) {
	p.id = props.GetAsString("id")
	p.name = props.GetAsString("name")
}
開發者ID:pomack,項目名稱:oauth2_client.go,代碼行數:4,代碼來源:facebook.go

示例12: InitFromJSONObject

func (p *PersistableModel) InitFromJSONObject(obj jsonhelper.JSONObject) {
	p.Id = obj.GetAsString("id")
	p.Etag = obj.GetAsString("etag")
	p.CreatedAt = obj.GetAsInt64("created_at")
	p.ModifiedAt = obj.GetAsInt64("modified_at")
}
開發者ID:pombredanne,項目名稱:dsocial.go,代碼行數:6,代碼來源:util.go

示例13: FromJSON

func (p *linkedInUserInfoResult) FromJSON(props jsonhelper.JSONObject) {
	p.id = props.GetAsString("id")
	p.firstName = props.GetAsString("firstName")
	p.lastName = props.GetAsString("lastName")
	p.publicProfileUrl = props.GetAsString("publicProfileUrl")
}
開發者ID:pomack,項目名稱:oauth2_client.go,代碼行數:6,代碼來源:linkedin.go


注:本文中的github.com/pomack/jsonhelper/go/jsonhelper.JSONObject.GetAsString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。