func mantaFactory(conf map[string]string) (Client, error) { path, ok := conf["path"] if !ok { return nil, fmt.Errorf("missing 'path' configuration") } objectName, ok := conf["objectName"] if !ok { objectName = DEFAULT_OBJECT_NAME } creds, err := getCredentialsFromEnvironment() if err != nil { return nil, fmt.Errorf("Error getting Manta credentials: %s", err.Error()) } client := manta.New(joyentclient.NewClient( creds.MantaEndpoint.URL, "", creds, log.New(os.Stderr, "", log.LstdFlags), )) return &MantaClient{ Client: client, Path: path, ObjectName: objectName, }, nil }
func newStorage(cfg *environConfig, name string) (storage.Storage, error) { creds, err := credentials(cfg) if err != nil { return nil, err } client := client.NewClient(cfg.mantaUrl(), "", creds, &logger) if name == "" { name = cfg.controlDir() } return &JoyentStorage{ ecfg: cfg, containerName: name, manta: manta.New(client)}, nil }
func (s *LiveTests) SetUpTest(c *gc.C) { client := client.NewClient(s.creds.MantaEndpoint.URL, "", s.creds, log.New(os.Stderr, "", log.LstdFlags)) c.Assert(client, gc.NotNil) s.testClient = manta.New(client) c.Assert(s.testClient, gc.NotNil) }
func (s *LocalTests) SetUpTest(c *gc.C) { client := client.NewClient(s.creds.MantaEndpoint.URL, "", s.creds, &manta.Logger) c.Assert(client, gc.NotNil) s.testClient = manta.New(client) c.Assert(s.testClient, gc.NotNil) }