Documentation ¶
Index ¶
- Variables
- func AddFlags()
- func AndroidOutput() bool
- func Androidf(format string, args ...interface{})
- func ConfigFilePath() string
- func ExplicitServer() string
- func ListMissingDestinationBlobs(destMissing chan<- blobref.SizedBlobRef, sizeMismatch chan<- *blobref.BlobRef, ...)
- func NoteFileUploaded(fullPath string, uploaded bool)
- func SignerPublicKeyBlobref() *blobref.BlobRef
- type AndroidStatsTransport
- type AndroidStatusReceiver
- type ByCountAndBytes
- type Client
- func (c *Client) BlobRoot() (string, error)
- func (c *Client) DialFunc() func(network, addr string) (net.Conn, error)
- func (c *Client) EnumerateBlobs(dest chan<- blobref.SizedBlobRef, after string, limit int, wait time.Duration) error
- func (c *Client) EnumerateBlobsOpts(ch chan<- blobref.SizedBlobRef, opts EnumerateOpts) error
- func (c *Client) FetchSchemaBlob(b *blobref.BlobRef) (*schema.Blob, error)
- func (c *Client) FetchStreaming(b *blobref.BlobRef) (io.ReadCloser, int64, error)
- func (c *Client) FetchVia(b *blobref.BlobRef, v []*blobref.BlobRef) (io.ReadCloser, int64, error)
- func (c *Client) FileHasContents(f, wholeRef *blobref.BlobRef) bool
- func (c *Client) GetBlobFetcher() blobref.SeekFetcher
- func (c *Client) GetRecentPermanodes(req *search.RecentRequest) (*search.RecentResponse, error)
- func (c *Client) GetTrustedCerts() []string
- func (c *Client) ReceiveBlob(blob *blobref.BlobRef, source io.Reader) (blobref.SizedBlobRef, error)
- func (c *Client) RemoveBlob(b *blobref.BlobRef) error
- func (c *Client) RemoveBlobs(blobs []*blobref.BlobRef) error
- func (c *Client) SearchExistingFileSchema(wholeRef *blobref.BlobRef) (*blobref.BlobRef, error)
- func (c *Client) SearchRoot() (string, error)
- func (c *Client) SecretRingFile() string
- func (c *Client) SetHTTPClient(client *http.Client)
- func (c *Client) SetHaveCache(cache HaveCache)
- func (c *Client) SetLogger(logger *log.Logger)
- func (c *Client) SetupAuth() error
- func (c *Client) SetupAuthFromConfig(conf jsonconfig.Obj) error
- func (c *Client) SignerPublicKeyBlobref() *blobref.BlobRef
- func (c *Client) SimpleEnumerateBlobs(ch chan<- blobref.SizedBlobRef) error
- func (c *Client) StatBlobs(dest chan<- blobref.SizedBlobRef, blobs []*blobref.BlobRef, wait time.Duration) error
- func (c *Client) Stats() Stats
- func (c *Client) StorageGeneration() (string, error)
- func (c *Client) SyncHandlers() ([]*SyncInfo, error)
- func (c *Client) TLSConfig() (*tls.Config, error)
- func (c *Client) Upload(h *UploadHandle) (*PutResult, error)
- type EnumerateOpts
- type HaveCache
- type PutResult
- type ResponseFormatError
- type Stats
- type SyncInfo
- type UploadHandle
Constants ¶
This section is empty.
Variables ¶
var ErrNoSearchRoot = errors.New("client: server doesn't support search")
ErrNoSearchRoot is returned by SearchRoot if the server doesn't support search.
var ErrNoStorageGeneration = errors.New("client: server doesn't report a storage generation")
ErrNoStorageGeneration is returned by StorageGeneration if the server doesn't report a storage generation value.
var ErrNoSync = errors.New("client: server has no sync handlers")
ErrNoSync is returned by SyncHandlers if the server does not advertise syncs.
Functions ¶
func AndroidOutput ¶
func AndroidOutput() bool
func ConfigFilePath ¶
func ConfigFilePath() string
func ExplicitServer ¶
func ExplicitServer() string
ExplicitServer returns the blobserver given in the flags, if any.
func ListMissingDestinationBlobs ¶
func ListMissingDestinationBlobs(destMissing chan<- blobref.SizedBlobRef, sizeMismatch chan<- *blobref.BlobRef, srcch, dstch <-chan blobref.SizedBlobRef)
ListMissingDestinationBlobs reads from 'srcch' and 'dstch' (sorted enumerations of blobs from two blob servers) and sends to 'destMissing' any blobs which appear on the source but not at the destination. destMissing is closed at the end. sizeMismatch is never closed.
func NoteFileUploaded ¶
func SignerPublicKeyBlobref ¶
TODO: move to config package?
Types ¶
type AndroidStatsTransport ¶
type AndroidStatsTransport struct {
Rt http.RoundTripper
}
type AndroidStatusReceiver ¶
type AndroidStatusReceiver struct { Sr blobserver.StatReceiver Path string }
androidStatusReceiver is a blobserver.StatReceiver wrapper that reports the full filename path and size of uploaded blobs. The android app wrapping camput watches stdout for this, for progress bars.
func (AndroidStatusReceiver) ReceiveBlob ¶
func (asr AndroidStatusReceiver) ReceiveBlob(blob *blobref.BlobRef, source io.Reader) (blobref.SizedBlobRef, error)
func (AndroidStatusReceiver) StatBlobs ¶
func (asr AndroidStatusReceiver) StatBlobs(dest chan<- blobref.SizedBlobRef, blobs []*blobref.BlobRef, wait time.Duration) error
type ByCountAndBytes ¶
func (*ByCountAndBytes) String ¶
func (bb *ByCountAndBytes) String() string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client provides access to a Camlistore server.
func New ¶
New returns a new Camlistore Client. The provided server is either "host:port" (assumed http, not https) or a URL prefix, with or without a path. Errors are not returned until subsequent operations.
func NewFromShareRoot ¶
func (*Client) BlobRoot ¶
BlobRoot returns the server's blobroot URL prefix. If the client was constructed with an explicit path, that path is used. Otherwise the server's default advertised blobRoot is used.
func (*Client) DialFunc ¶
DialFunc returns the adequate dial function, depending on whether SSL is required, the client's config has some trusted certs, and we're on android. If the client's config has some trusted certs, the server's certificate will be checked against those in the config after the TLS handshake.
func (*Client) EnumerateBlobs ¶
func (*Client) EnumerateBlobsOpts ¶
func (c *Client) EnumerateBlobsOpts(ch chan<- blobref.SizedBlobRef, opts EnumerateOpts) error
Note: closes ch.
func (*Client) FetchSchemaBlob ¶
func (*Client) FetchStreaming ¶
func (*Client) FileHasContents ¶
FileHasContents returns true iff f refers to a "file" or "bytes" schema blob, the server is configured with a "download helper", and the server responds that all chunks of 'f' are available and match the digest of wholeRef.
func (*Client) GetBlobFetcher ¶
func (c *Client) GetBlobFetcher() blobref.SeekFetcher
func (*Client) GetRecentPermanodes ¶
func (c *Client) GetRecentPermanodes(req *search.RecentRequest) (*search.RecentResponse, error)
SearchRecent implements search.IGetRecentPermanodes against a remote server over HTTP.
func (*Client) GetTrustedCerts ¶
func (*Client) ReceiveBlob ¶
func (*Client) RemoveBlob ¶
Remove the single blob. An error is returned if the server failed to remove the blob. Removing a non-existent blob isn't an error.
func (*Client) RemoveBlobs ¶
Remove the list of blobs. An error is returned if the server failed to remove a blob. Removing a non-existent blob isn't an error.
func (*Client) SearchExistingFileSchema ¶
SearchExistingFileSchema does a search query looking for an existing file with entire contents of wholeRef, then does a HEAD request to verify the file still exists on the server. If so, it returns that file schema's blobref.
May return (nil, nil) on ENOENT. A non-nil error is only returned if there were problems searching.
func (*Client) SearchRoot ¶
SearchRoot returns the server's search handler. If the server isn't running an index and search handler, the error will be ErrNoSearchRoot.
func (*Client) SecretRingFile ¶
func (*Client) SetHTTPClient ¶
SetHTTPClient sets the Camlistore client's HTTP client. If nil, the default HTTP client is used.
func (*Client) SetHaveCache ¶
func (*Client) SetupAuthFromConfig ¶
func (c *Client) SetupAuthFromConfig(conf jsonconfig.Obj) error
func (*Client) SignerPublicKeyBlobref ¶
Returns blobref of signer's public key, or nil if unconfigured.
func (*Client) SimpleEnumerateBlobs ¶
func (c *Client) SimpleEnumerateBlobs(ch chan<- blobref.SizedBlobRef) error
Note: closes ch.
func (*Client) StorageGeneration ¶
StorageGeneration returns the server's unique ID for its storage generation, reset whenever storage is reset, moved, or partially lost.
This is a value that can be used in client cache keys to add certainty that they're talking to the same instance as previously.
If the server doesn't return such a value, the error will be ErrNoStorageGeneration.
func (*Client) SyncHandlers ¶
SyncHandlers returns the server's sync handlers "from" and "to" prefix URLs. If the server isn't running any sync handler, the error will be ErrNoSync.
type EnumerateOpts ¶
type HaveCache ¶
type HaveCache interface { StatBlobCache(br *blobref.BlobRef) (size int64, ok bool) NoteBlobExists(br *blobref.BlobRef, size int64) }
A HaveCache caches whether a remote blobserver has a blob.
type PutResult ¶
type PutResult struct { BlobRef *blobref.BlobRef Size int64 Skipped bool // already present on blobserver }
func (*PutResult) SizedBlobRef ¶
func (pr *PutResult) SizedBlobRef() blobref.SizedBlobRef
type ResponseFormatError ¶
type ResponseFormatError error
type Stats ¶
type Stats struct { // The number of uploads that were requested, but perhaps // not actually performed if the server already had the items. UploadRequests ByCountAndBytes // The uploads which were actually sent to the blobserver // due to the server not having the blobs Uploads ByCountAndBytes }
type SyncInfo ¶
SyncInfo holds the data that were acquired with a discovery and that are relevant to a syncHandler.
type UploadHandle ¶
type UploadHandle struct { BlobRef *blobref.BlobRef Size int64 // or -1 if size isn't known Contents io.Reader Vivify bool }
func NewUploadHandleFromString ¶
func NewUploadHandleFromString(data string) *UploadHandle