本文整理匯總了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)
}
示例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)
}
示例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)
}
示例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)
}
示例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())
}