Documentation ¶
Overview ¶
Package clientlib provides utility functions to help with downloading client libraries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadURL ¶
DownloadURL returns the URL of the client library archive for the given language and service name/version. If an unknown language is provided, an error is returned.
func DownloadUnzip ¶
DownloadUnzip downloads and unzips client libraries.
`url` is assumed to be a zip archive containing things we want. `dst` is the directory that the content should be unzipped to. `buf` is used to as buffer space for unzipping.
If non-nil error is returned, there is no guarantee as to which files, if any, were written to `dst`.
DownloadUnzip is safe to be called in parallel. However, races can happen if two invocations want to write to the same files.
func DownloadUnzipIfMissing ¶
DownloadUnzipIfMissing downloads libraries `libs` into directory `dst` if the libraries don't already exist.
Library `l` is considered to "exist" if directory "dstDir/{l.Name}" exists. If the library doesn't yet exist, the content of l.URL is unzipped into "dstDir/{l.Name}". TODO(vchudnov-g): Add version
func LandingPage ¶
LandingPage returns the client library landing page for the given language and service name/version. If an unknown language is provided, an error is returned.
Types ¶
type Buffer ¶
type Buffer interface { io.Writer // FinishWrite is called after all writes and before any read, giving Buffer a chance to prepare // for reading. It should return the amount of data it has read, in bytes, // and any errors encountered. FinishWrite() (int64, error) io.ReaderAt }
Buffer is the interface to provide DownloadUnzip with buffer space.
type MemBuffer ¶
MemBuffer implements Buffer in-memory.
func (*MemBuffer) FinishWrite ¶
FinishWrite prepares b for reading. Always return nil error.