[ARVADOS] updated: 92fd8da1e911a2ef39fb23d944f124d4264c3322

Git user git at public.curoverse.com
Wed May 18 14:49:12 EDT 2016


Summary of changes:
 sdk/go/x/arvados/client.go     | 22 ++++++++++++++--------
 sdk/go/x/arvados/collection.go |  8 ++++++++
 2 files changed, 22 insertions(+), 8 deletions(-)

       via  92fd8da1e911a2ef39fb23d944f124d4264c3322 (commit)
      from  32899e6b4ca7b5d59e3136f44785d0971a3b19ee (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 92fd8da1e911a2ef39fb23d944f124d4264c3322
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed May 18 14:49:09 2016 -0400

    9162: documentation comments

diff --git a/sdk/go/x/arvados/client.go b/sdk/go/x/arvados/client.go
index 3039919..47bbc07 100644
--- a/sdk/go/x/arvados/client.go
+++ b/sdk/go/x/arvados/client.go
@@ -14,9 +14,14 @@ import (
 type Client struct {
 	// HTTP client used to make requests. If nil,
 	// http.DefaultClient or InsecureHTTPClient will be used.
-	Client    *http.Client
-	APIHost   string
+	Client *http.Client
+
+	// Hostname (or host:port) of Arvados API server.
+	APIHost string
+
+	// User authentication token.
 	AuthToken string
+
 	// Accept unverified certificates. If a Client is provided by
 	// the caller, this has no effect.
 	Insecure bool
@@ -27,9 +32,9 @@ var InsecureHTTPClient = &http.Client{
 		TLSClientConfig: &tls.Config{
 			InsecureSkipVerify: true}}}
 
-// NewClientFromEnv creates a new Client that uses the service
-// endpoint and credentials given by the ARVADOS_API_* environment
-// variables.
+// NewClientFromEnv creates a new Client that uses the default HTTP
+// client with the API endpoint and credentials given by the
+// ARVADOS_API_* environment variables.
 func NewClientFromEnv() *Client {
 	return &Client{
 		APIHost:   os.Getenv("ARVADOS_API_HOST"),
@@ -127,11 +132,12 @@ func (c *Client) RequestAndDecode(dst interface{}, method, path string, body io.
 }
 
 func (c *Client) httpClient() *http.Client {
-	if c.Client != nil {
+	switch {
+	case c.Client != nil:
 		return c.Client
-	} else if c.Insecure {
+	case c.Insecure:
 		return InsecureHTTPClient
-	} else {
+	default:
 		return http.DefaultClient
 	}
 }
diff --git a/sdk/go/x/arvados/collection.go b/sdk/go/x/arvados/collection.go
index 97b5e09..2aa0b09 100644
--- a/sdk/go/x/arvados/collection.go
+++ b/sdk/go/x/arvados/collection.go
@@ -10,6 +10,7 @@ import (
 	"git.curoverse.com/arvados.git/sdk/go/manifest"
 )
 
+// Collection is an arvados#collection resource.
 type Collection struct {
 	UUID                   string     `json:"uuid,omitempty"`
 	ExpiresAt              *time.Time `json:"expires_at,omitempty"`
@@ -22,6 +23,8 @@ type Collection struct {
 	ReplicationDesired     *int       `json:"replication_desired,omitempty"`
 }
 
+// SizedDigests returns the hash+size part of each data block
+// referenced by the collection.
 func (c *Collection) SizedDigests() ([]SizedDigest, error) {
 	if c.ManifestText == "" && c.PortableDataHash != "d41d8cd98f00b204e9800998ecf8427e+0" {
 		// TODO: Check more subtle forms of corruption, too
@@ -51,6 +54,7 @@ func (c *Collection) SizedDigests() ([]SizedDigest, error) {
 	return sds, scanner.Err()
 }
 
+// CollectionList is an arvados#collectionList resource.
 type CollectionList struct {
 	Items          []Collection `json:"items"`
 	ItemsAvailable int          `json:"items_available"`
@@ -58,16 +62,20 @@ type CollectionList struct {
 	Limit          int          `json:"limit"`
 }
 
+// A Filter restricts the set of records returned by a list/index API.
 type Filter struct {
 	Attr     string
 	Operator string
 	Operand  interface{}
 }
 
+// MarshalJSON encodes a Filter in the form expected by the API.
 func (f *Filter) MarshalJSON() ([]byte, error) {
 	return json.Marshal([]interface{}{f.Attr, f.Operator, f.Operand})
 }
 
+// ResourceListParams expresses which results are requested in a
+// list/index API.
 type ResourceListParams struct {
 	Select  []string `json:"select,omitempty"`
 	Filters []Filter `json:"filters,omitempty"`

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list