From 09a80dff99307d3f43104ae817cb750a3b869fd0 Mon Sep 17 00:00:00 2001 From: mpl Date: Fri, 18 Apr 2014 21:56:31 +0200 Subject: [PATCH 1/3] importer: doc typo Change-Id: Ib8d2a7d1daf318ed2ec2228269942ff480331c2f --- pkg/importer/importer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/importer/importer.go b/pkg/importer/importer.go index fb7727a46..62a9f9cbf 100644 --- a/pkg/importer/importer.go +++ b/pkg/importer/importer.go @@ -204,7 +204,7 @@ func (rc *RunContext) Credentials() (clientID, clientSecret string, err error) { // missing anything). func (rc *RunContext) AccountNode() *Object { return rc.ia.acct } -// AccountNode returns the initially-empty permanode storing the root +// RootNode returns the initially-empty permanode storing the root // of this account's data. You can change anything at will. This will // typically be modeled as a dynamic directory (with camliPath:xxxx // attributes), where each path element is either a file, object, or From 04a38a2515c6f95111def7e4090617f96e6dd72c Mon Sep 17 00:00:00 2001 From: Edward Sheffler III Date: Fri, 18 Apr 2014 12:57:47 -0700 Subject: [PATCH 2/3] schema: unexport NewClaim Change-Id: If088d7b8dd521f89093376282b84a64c59c7b778 --- pkg/schema/schema.go | 12 ++++++------ pkg/schema/schema_test.go | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/schema/schema.go b/pkg/schema/schema.go index 4dc938762..5fb7e63d5 100644 --- a/pkg/schema/schema.go +++ b/pkg/schema/schema.go @@ -712,7 +712,7 @@ type claimParam struct { target blob.Ref } -func NewClaim(claims ...*claimParam) *Builder { +func newClaim(claims ...*claimParam) *Builder { bb := base(1, "claim") bb.SetClaimDate(clockNow()) if len(claims) == 1 { @@ -751,7 +751,7 @@ func populateClaimMap(m map[string]interface{}, cp *claimParam) { // NewShareRef creates a *Builder for a "share" claim. func NewShareRef(authType string, target blob.Ref, transitive bool) *Builder { - return NewClaim(&claimParam{ + return newClaim(&claimParam{ claimType: ShareClaim, authType: authType, target: target, @@ -760,7 +760,7 @@ func NewShareRef(authType string, target blob.Ref, transitive bool) *Builder { } func NewSetAttributeClaim(permaNode blob.Ref, attr, value string) *Builder { - return NewClaim(&claimParam{ + return newClaim(&claimParam{ permanode: permaNode, claimType: SetAttributeClaim, attribute: attr, @@ -769,7 +769,7 @@ func NewSetAttributeClaim(permaNode blob.Ref, attr, value string) *Builder { } func NewAddAttributeClaim(permaNode blob.Ref, attr, value string) *Builder { - return NewClaim(&claimParam{ + return newClaim(&claimParam{ permanode: permaNode, claimType: AddAttributeClaim, attribute: attr, @@ -781,7 +781,7 @@ func NewAddAttributeClaim(permaNode blob.Ref, attr, value string) *Builder { // values set for the attribute attr of permaNode. If value is empty then // all the values for attribute are cleared. func NewDelAttributeClaim(permaNode blob.Ref, attr, value string) *Builder { - return NewClaim(&claimParam{ + return newClaim(&claimParam{ permanode: permaNode, claimType: DelAttributeClaim, attribute: attr, @@ -791,7 +791,7 @@ func NewDelAttributeClaim(permaNode blob.Ref, attr, value string) *Builder { // NewDeleteClaim creates a new claim to delete a target claim or permanode. func NewDeleteClaim(target blob.Ref) *Builder { - return NewClaim(&claimParam{ + return newClaim(&claimParam{ target: target, claimType: DeleteClaim, }) diff --git a/pkg/schema/schema_test.go b/pkg/schema/schema_test.go index fe901816b..10dd96780 100644 --- a/pkg/schema/schema_test.go +++ b/pkg/schema/schema_test.go @@ -194,7 +194,7 @@ func TestAttribute(t *testing.T) { }`, }, { - bb: NewClaim(&claimParam{ + bb: newClaim(&claimParam{ permanode: br, claimType: SetAttributeClaim, attribute: "foo", From 98e895de4506894543dddf625dab090c1cc82f9e Mon Sep 17 00:00:00 2001 From: mpl Date: Fri, 18 Apr 2014 22:16:36 +0200 Subject: [PATCH 3/3] importer/foursquare: remove unused initRoot function Change-Id: I74537a28ee31bf5062322aea113453030950a077 --- pkg/importer/foursquare/foursquare.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/pkg/importer/foursquare/foursquare.go b/pkg/importer/foursquare/foursquare.go index e30fcd5d9..89ca55b05 100644 --- a/pkg/importer/foursquare/foursquare.go +++ b/pkg/importer/foursquare/foursquare.go @@ -113,16 +113,6 @@ func (r *run) token() string { return r.RunContext.AccountNode().Attr(acctAttrAccessToken) } -func (r *run) initRoot() error { - root := r.RootNode() - user := r.AccountNode().Attr("foursquareUser") - if user == "" { - return errors.New("The 'foursquareUser' attribute on the account node is empty.") - } - title := fmt.Sprintf("Foursquare (%s)", user) - return root.SetAttr("title", title) -} - func (im *imp) Run(ctx *importer.RunContext) error { clientId, secret, err := ctx.Credentials() if err != nil {