separate into notification.toml, add gcp pub/sub message queue

This commit is contained in:
Chris Lu
2018-11-01 01:11:09 -07:00
parent 6219a9ad1f
commit db584ff7f8
7 changed files with 240 additions and 29 deletions

View File

@@ -3,11 +3,11 @@ package gcssink
import (
"context"
"fmt"
"log"
"os"
"cloud.google.com/go/storage"
"github.com/chrislusf/seaweedfs/weed/filer2"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/replication/sink"
"github.com/chrislusf/seaweedfs/weed/replication/source"
@@ -56,12 +56,12 @@ func (g *GcsSink) initialize(google_application_credentials, bucketName, dir str
var found bool
google_application_credentials, found = os.LookupEnv("GOOGLE_APPLICATION_CREDENTIALS")
if !found {
log.Fatalf("need to specific GOOGLE_APPLICATION_CREDENTIALS env variable or google_application_credentials in replication.toml")
glog.Fatalf("need to specific GOOGLE_APPLICATION_CREDENTIALS env variable or google_application_credentials in replication.toml")
}
}
client, err := storage.NewClient(ctx, option.WithCredentialsFile(google_application_credentials))
if err != nil {
log.Fatalf("Failed to create client: %v", err)
glog.Fatalf("Failed to create client: %v", err)
}
g.client = client