Skip to content

Commit ca8242f

Browse files
authored
add license headers (#79)
1 parent ab642cb commit ca8242f

File tree

14 files changed

+227
-21
lines changed

14 files changed

+227
-21
lines changed

cmd/generate.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// Copyright (c) 2024 Parseable, Inc
2+
//
3+
// This program is free software: you can redistribute it and/or modify
4+
// it under the terms of the GNU Affero General Public License as published by
5+
// the Free Software Foundation, either version 3 of the License, or
6+
// (at your option) any later version.
7+
//
8+
// This program is distributed in the hope that it will be useful
9+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
// GNU Affero General Public License for more details.
12+
//
13+
// You should have received a copy of the GNU Affero General Public License
14+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
116
package cmd
217

318
import (
@@ -7,6 +22,7 @@ import (
722
"io"
823
"net/http"
924
"os"
25+
1026
"pb/pkg/common"
1127
internalHTTP "pb/pkg/http"
1228

@@ -157,5 +173,4 @@ func init() {
157173
GenerateSchemaCmd.Flags().StringP("file", "f", "", "Path to the JSON file to generate schema")
158174
CreateSchemaCmd.Flags().StringP("stream", "s", "", "Name of the stream to associate with the schema")
159175
CreateSchemaCmd.Flags().StringP("file", "f", "", "Path to the JSON file to create schema")
160-
161176
}

cmd/installer.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// Copyright (c) 2024 Parseable, Inc
2+
//
3+
// This program is free software: you can redistribute it and/or modify
4+
// it under the terms of the GNU Affero General Public License as published by
5+
// the Free Software Foundation, either version 3 of the License, or
6+
// (at your option) any later version.
7+
//
8+
// This program is distributed in the hope that it will be useful
9+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
// GNU Affero General Public License for more details.
12+
//
13+
// You should have received a copy of the GNU Affero General Public License
14+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
116
package cmd
217

318
import (

cmd/uninstaller.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
1+
// Copyright (c) 2024 Parseable, Inc
2+
//
3+
// This program is free software: you can redistribute it and/or modify
4+
// it under the terms of the GNU Affero General Public License as published by
5+
// the Free Software Foundation, either version 3 of the License, or
6+
// (at your option) any later version.
7+
//
8+
// This program is distributed in the hope that it will be useful
9+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
// GNU Affero General Public License for more details.
12+
//
13+
// You should have received a copy of the GNU Affero General Public License
14+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
116
package cmd
217

318
import (
419
"fmt"
20+
521
"pb/pkg/common"
622
"pb/pkg/installer"
723

pkg/analytics/analytics.go

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// Copyright (c) 2024 Parseable, Inc
2+
//
3+
// This program is free software: you can redistribute it and/or modify
4+
// it under the terms of the GNU Affero General Public License as published by
5+
// the Free Software Foundation, either version 3 of the License, or
6+
// (at your option) any later version.
7+
//
8+
// This program is distributed in the hope that it will be useful
9+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
// GNU Affero General Public License for more details.
12+
//
13+
// You should have received a copy of the GNU Affero General Public License
14+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
116
package analytics
217

318
import (
@@ -92,7 +107,7 @@ func CheckAndCreateULID(_ *cobra.Command, _ []string) error {
92107
// Check if config path exists
93108
if _, err := os.Stat(configPath); os.IsNotExist(err) {
94109
// Create the directory if needed
95-
if err := os.MkdirAll(filepath.Dir(configPath), 0755); err != nil {
110+
if err := os.MkdirAll(filepath.Dir(configPath), 0o755); err != nil {
96111
fmt.Printf("could not create config directory: %v\n", err)
97112
return err
98113
}
@@ -123,7 +138,7 @@ func CheckAndCreateULID(_ *cobra.Command, _ []string) error {
123138
}
124139

125140
// Write updated config with ULID back to the file
126-
if err := os.WriteFile(configPath, newData, 0644); err != nil {
141+
if err := os.WriteFile(configPath, newData, 0o644); err != nil {
127142
fmt.Printf("could not write to config file: %v\n", err)
128143
return err
129144
}
@@ -152,7 +167,6 @@ func PostRunAnalytics(cmd *cobra.Command, name string, args []string) {
152167
if err != nil {
153168
fmt.Println("Error sending analytics event:", err)
154169
}
155-
156170
}
157171

158172
// sendEvent is a placeholder function to simulate sending an event after command execution.
@@ -223,7 +237,6 @@ func sendEvent(commandName string, arguments []string, errors *string, execution
223237
return fmt.Errorf("received non-2xx response: %v", resp.Status)
224238
}
225239

226-
//fmt.Println("Event sent successfully:", string(eventJSON))
227240
return nil
228241
}
229242

@@ -383,5 +396,4 @@ func GetProfile() (config.Profile, error) {
383396
}
384397

385398
return conf.Profiles[conf.DefaultProfile], nil
386-
387399
}

pkg/common/common.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// Copyright (c) 2024 Parseable, Inc
2+
//
3+
// This program is free software: you can redistribute it and/or modify
4+
// it under the terms of the GNU Affero General Public License as published by
5+
// the Free Software Foundation, either version 3 of the License, or
6+
// (at your option) any later version.
7+
//
8+
// This program is distributed in the hope that it will be useful
9+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
// GNU Affero General Public License for more details.
12+
//
13+
// You should have received a copy of the GNU Affero General Public License
14+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
116
package common
217

318
// ANSI escape codes for colors

pkg/helm/helm.go

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// Copyright (c) 2024 Parseable, Inc
2+
//
3+
// This program is free software: you can redistribute it and/or modify
4+
// it under the terms of the GNU Affero General Public License as published by
5+
// the Free Software Foundation, either version 3 of the License, or
6+
// (at your option) any later version.
7+
//
8+
// This program is distributed in the hope that it will be useful
9+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
// GNU Affero General Public License for more details.
12+
//
13+
// You should have received a copy of the GNU Affero General Public License
14+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
116
package helm
217

318
import (
@@ -40,15 +55,14 @@ func ListReleases(namespace string) ([]*release.Release, error) {
4055
}
4156

4257
client := action.NewList(actionConfig)
43-
//client.Deployed = true
58+
// client.Deployed = true
4459

4560
return client.Run()
4661
}
4762

4863
// Apply applies a Helm chart using the provided Helm struct configuration.
4964
// It returns an error if any operation fails, otherwise, it returns nil.
5065
func Apply(h Helm, verbose bool) error {
51-
5266
// Create a logger that does nothing by default
5367
silentLogger := func(_ string, _ ...interface{}) {}
5468

@@ -82,7 +96,7 @@ func Apply(h Helm, verbose bool) error {
8296
// Add repository
8397
repoAdd(h)
8498

85-
//RepoUpdate()
99+
// RepoUpdate()
86100

87101
// Locate chart path
88102
cp, err := client.ChartPathOptions.LocateChart(fmt.Sprintf("%s/%s", h.RepoName, h.ChartName), settings)
@@ -104,7 +118,7 @@ func Apply(h Helm, verbose bool) error {
104118
client.Wait = true
105119
client.Timeout = 300 * time.Second
106120
client.WaitForJobs = true
107-
//client.IncludeCRDs = true
121+
// client.IncludeCRDs = true
108122

109123
// Merge values
110124
values := values.Options{
@@ -132,7 +146,7 @@ func repoAdd(h Helm) error {
132146
// Get the repository file path
133147
repoFile := settings.RepositoryConfig
134148

135-
//Ensure the file directory exists as it is required for file locking
149+
// Ensure the file directory exists as it is required for file locking
136150
err := os.MkdirAll(filepath.Dir(repoFile), os.ModePerm)
137151
if err != nil && !os.IsExist(err) {
138152
return err
@@ -200,7 +214,7 @@ func repoAdd(h Helm) error {
200214
f.Update(&c)
201215

202216
// Write the updated repository file
203-
if err := f.WriteFile(repoFile, 0644); err != nil {
217+
if err := f.WriteFile(repoFile, 0o644); err != nil {
204218
return err
205219
}
206220
return nil
@@ -294,7 +308,6 @@ func DeleteRelease(chartName, namespace string) error {
294308
}
295309

296310
func Upgrade(h Helm) error {
297-
298311
settings := cli.New()
299312

300313
// Initialize action configuration
@@ -311,7 +324,7 @@ func Upgrade(h Helm) error {
311324
// Add repository
312325
repoAdd(h)
313326

314-
//RepoUpdate()
327+
// RepoUpdate()
315328

316329
// Locate chart path
317330
cp, err := client.ChartPathOptions.LocateChart(fmt.Sprintf("%s/%s", h.RepoName, h.ChartName), settings)
@@ -332,7 +345,7 @@ func Upgrade(h Helm) error {
332345
client.Wait = true
333346
client.Timeout = 300 * time.Second
334347
client.WaitForJobs = true
335-
//client.IncludeCRDs = true
348+
// client.IncludeCRDs = true
336349

337350
// Merge values
338351
values := values.Options{
@@ -352,7 +365,6 @@ func Upgrade(h Helm) error {
352365
}
353366

354367
func Uninstall(h Helm, verbose bool) (*release.UninstallReleaseResponse, error) {
355-
356368
// Create a logger that does nothing by default
357369
silentLogger := func(_ string, _ ...interface{}) {}
358370

pkg/installer/installer.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// Copyright (c) 2024 Parseable, Inc
2+
//
3+
// This program is free software: you can redistribute it and/or modify
4+
// it under the terms of the GNU Affero General Public License as published by
5+
// the Free Software Foundation, either version 3 of the License, or
6+
// (at your option) any later version.
7+
//
8+
// This program is distributed in the hope that it will be useful
9+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
// GNU Affero General Public License for more details.
12+
//
13+
// You should have received a copy of the GNU Affero General Public License
14+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
116
package installer
217

318
import (

pkg/installer/model.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// Copyright (c) 2024 Parseable, Inc
2+
//
3+
// This program is free software: you can redistribute it and/or modify
4+
// it under the terms of the GNU Affero General Public License as published by
5+
// the Free Software Foundation, either version 3 of the License, or
6+
// (at your option) any later version.
7+
//
8+
// This program is distributed in the hope that it will be useful
9+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
// GNU Affero General Public License for more details.
12+
//
13+
// You should have received a copy of the GNU Affero General Public License
14+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
116
package installer
217

318
// deploymentType represents the type of deployment for the application.

pkg/installer/plans.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// Copyright (c) 2024 Parseable, Inc
2+
//
3+
// This program is free software: you can redistribute it and/or modify
4+
// it under the terms of the GNU Affero General Public License as published by
5+
// the Free Software Foundation, either version 3 of the License, or
6+
// (at your option) any later version.
7+
//
8+
// This program is distributed in the hope that it will be useful
9+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
// GNU Affero General Public License for more details.
12+
//
13+
// You should have received a copy of the GNU Affero General Public License
14+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
116
package installer
217

318
import (

pkg/installer/spinner.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
1+
// Copyright (c) 2024 Parseable, Inc
2+
//
3+
// This program is free software: you can redistribute it and/or modify
4+
// it under the terms of the GNU Affero General Public License as published by
5+
// the Free Software Foundation, either version 3 of the License, or
6+
// (at your option) any later version.
7+
//
8+
// This program is distributed in the hope that it will be useful
9+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
// GNU Affero General Public License for more details.
12+
//
13+
// You should have received a copy of the GNU Affero General Public License
14+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
116
package installer
217

318
import (
419
"fmt"
5-
"pb/pkg/common"
620
"time"
721

22+
"pb/pkg/common"
23+
824
"github.com/briandowns/spinner"
925
)
1026

0 commit comments

Comments
 (0)