Skip to content

Commit 00764b4

Browse files
committed
Move project-name flag to project-id
Signed-off-by: Elis Lulja <[email protected]>
1 parent 84258c8 commit 00764b4

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

cmd/firestore/firestore.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func NewFirestoreCommand() *cobra.Command {
6868

6969
// -- Flags
7070
cmd.Flags().StringVarP(&opts.serviceAccountPath, "service-account-path", "s", "", "the path to the service account")
71-
cmd.Flags().StringVarP(&opts.projectName, "project-name", "n", "", "the name of the firebase project")
71+
cmd.Flags().StringVarP(&opts.projectID, "project-id", "i", "", "the id of the firebase project")
7272
cmd.Flags().StringVarP(&opts.chatsCollection, "chats-collection", "c", "", "the name of the collections where chats are stored")
7373
cmd.Flags().BoolVar(&opts.listen, "listen", true, "whether to listening to chat updates or not")
7474

@@ -94,7 +94,7 @@ func runFirestore(opts *firestoreOptions) {
9494

9595
// -- Get the backend
9696
fs, err := firestore.NewBackend(ctx, opts.serviceAccountPath, &firestore.Options{
97-
ProjectName: opts.projectName,
97+
ProjectID: opts.projectID,
9898
ChatsCollection: opts.chatsCollection,
9999
UseCache: true,
100100
})

cmd/firestore/options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ type firestoreOptions struct {
55
debug bool
66
listen bool
77
serviceAccountPath string
8-
projectName string
8+
projectID string
99
address string
1010
port int
1111
}

deploy/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ spec:
3737
- firestore
3838
- --chats-collection
3939
- $(CHATS_COLLECTION)
40-
- --project-name
40+
- --project-id
4141
- $(FIREBASE_PROJECT_ID)
4242
- --service-account-path
4343
- /credentials/service-account.json

pkg/firestore/fs-opts.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package firestore
22

33
// Options contains options for firestore
44
type Options struct {
5-
// ProjectName is the name of the firebase project
6-
ProjectName string `yaml:"projectName"`
5+
// ProjectID is the id of the firebase project
6+
ProjectID string `yaml:"projectId"`
77
// ChatsCollection is the name of the collections where
88
// chats are stored
99
ChatsCollection string `yaml:"chatsCollection"`

pkg/firestore/fs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ func NewBackend(ctx context.Context, servAcc string, opts *Options) (backend.Bac
4848
if len(opts.ChatsCollection) == 0 {
4949
return nil, fmt.Errorf("no chat collection set")
5050
}
51-
if len(opts.ProjectName) == 0 {
51+
if len(opts.ProjectID) == 0 {
5252
return nil, fmt.Errorf("no project name set")
5353
}
5454

5555
// -- Load firebase
56-
conf := &firebase.Config{ProjectID: opts.ProjectName}
56+
conf := &firebase.Config{ProjectID: opts.ProjectID}
5757
app, err := firebase.NewApp(ctx, conf, option.WithServiceAccountFile(servAcc))
5858
if err != nil {
5959
return nil, err

0 commit comments

Comments
 (0)