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


Golang schema.AnyBlob類代碼示例

本文整理匯總了Golang中camlistore/org/pkg/schema.AnyBlob的典型用法代碼示例。如果您正苦於以下問題:Golang AnyBlob類的具體用法?Golang AnyBlob怎麽用?Golang AnyBlob使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: UploadAndSignBlob

func (c *Client) UploadAndSignBlob(b schema.AnyBlob) (*PutResult, error) {
	signed, err := c.SignBlob(b.Blob(), time.Time{})
	if err != nil {
		return nil, err
	}
	return c.uploadString(signed)
}
開發者ID:newobject,項目名稱:camlistore,代碼行數:7,代碼來源:client.go

示例2: UploadAndSignBlob

func (up *Uploader) UploadAndSignBlob(b schema.AnyBlob) (*client.PutResult, error) {
	signed, err := up.SignBlob(b.Blob(), time.Time{})
	if err != nil {
		return nil, err
	}
	return up.uploadString(signed)
}
開發者ID:proppy,項目名稱:camlistore,代碼行數:7,代碼來源:uploader.go

示例3: UploadAndSignBlob

func (c *Client) UploadAndSignBlob(b schema.AnyBlob) (*PutResult, error) {
	signed, err := c.signBlob(b.Blob(), time.Time{})
	if err != nil {
		return nil, err
	}
	c.checkMatchingKeys()
	if err := c.uploadPublicKey(); err != nil {
		return nil, err
	}
	return c.uploadString(signed, false)
}
開發者ID:rfistman,項目名稱:camlistore,代碼行數:11,代碼來源:client.go

示例4: UploadAndSignBlob

func (c *Client) UploadAndSignBlob(b schema.AnyBlob) (*PutResult, error) {
	signed, err := c.signBlob(b.Blob(), time.Time{})
	if err != nil {
		return nil, err
	}

	// sigRef is guaranteed valid at this point, because SignBlob
	// succeeded.  If we don't know for sure that the server
	// already has this public key, upload it.  And do it serially
	// so by the time we do the second upload of the signed blob,
	// any synchronous indexing on the server won't fail due to a
	// missing public key.
	sigRef := c.SignerPublicKeyBlobref()
	if _, keyUploaded := c.haveCache.StatBlobCache(sigRef); !keyUploaded {
		if _, err := c.uploadString(c.publicKeyArmored); err != nil {
			return nil, err
		}
	}

	return c.uploadString(signed)
}
開發者ID:kamoljan,項目名稱:camlistore,代碼行數:21,代碼來源:client.go

示例5: UploadBlob

func (c *Client) UploadBlob(b schema.AnyBlob) (*PutResult, error) {
	// TODO(bradfitz): ask the blob for its own blobref, rather
	// than changing the hash function with uploadString?
	return c.uploadString(b.Blob().JSON())
}
開發者ID:newobject,項目名稱:camlistore,代碼行數:5,代碼來源:client.go


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