Skip to content

Commit fff542b

Browse files
committed
Check readme example and fix some stuff
1 parent 0896cef commit fff542b

29 files changed

+578
-581
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ Sentire includes a special `inspect` command that can parse Sentry URLs directly
8989

9090
```bash
9191
# Inspect a Sentry issue URL and get detailed event information
92-
sentire inspect "https://sentry.io/organizations/my-org/issues/123456789/"
92+
sentire inspect "https://my-org.sentry.io/issues/123456789/"
9393

9494
# Get inspection results in table format
95-
sentire inspect "https://sentry.io/organizations/my-org/issues/123456789/" --format table
95+
sentire inspect "https://my-org.sentry.io/issues/123456789/" --format table
9696

9797
# Get inspection results in markdown for documentation
98-
sentire inspect "https://sentry.io/organizations/my-org/issues/123456789/" --format markdown
98+
sentire inspect "https://my-org.sentry.io/issues/123456789/" --format markdown
9999
```
100100

101101
This command automatically extracts the organization and issue ID from the URL and fetches the most relevant debugging information.

cmd/sentire/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ import (
66

77
func main() {
88
cli.Execute()
9-
}
9+
}

internal/api/events.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type ListProjectEventsOptions struct {
3030
// ListProjectEvents retrieves events for a specific project
3131
func (e *EventsAPI) ListProjectEvents(orgSlug, projectSlug string, opts *ListProjectEventsOptions) ([]models.Event, *client.PaginationInfo, error) {
3232
endpoint := fmt.Sprintf("/projects/%s/%s/events/", orgSlug, projectSlug)
33-
33+
3434
params := url.Values{}
3535
if opts != nil {
3636
if opts.StatsPeriod != "" {
@@ -81,7 +81,7 @@ type ListIssueEventsOptions struct {
8181
// ListIssueEvents retrieves events for a specific issue
8282
func (e *EventsAPI) ListIssueEvents(orgSlug string, issueID string, opts *ListIssueEventsOptions) ([]models.Event, *client.PaginationInfo, error) {
8383
endpoint := fmt.Sprintf("/organizations/%s/issues/%s/events/", orgSlug, issueID)
84-
84+
8585
params := url.Values{}
8686
if opts != nil {
8787
if opts.Start != "" {
@@ -139,7 +139,7 @@ type ListIssuesOptions struct {
139139
// ListIssues retrieves issues for an organization
140140
func (e *EventsAPI) ListIssues(orgSlug string, opts *ListIssuesOptions) ([]models.Issue, *client.PaginationInfo, error) {
141141
endpoint := fmt.Sprintf("/organizations/%s/issues/", orgSlug)
142-
142+
143143
params := url.Values{}
144144
if opts != nil {
145145
for _, env := range opts.Environment {
@@ -187,7 +187,7 @@ func (e *EventsAPI) ListIssues(orgSlug string, opts *ListIssuesOptions) ([]model
187187
// GetProjectEvent retrieves a specific event for a project
188188
func (e *EventsAPI) GetProjectEvent(orgSlug, projectSlug, eventID string) (*models.Event, error) {
189189
endpoint := fmt.Sprintf("/projects/%s/%s/events/%s/", orgSlug, projectSlug, eventID)
190-
190+
191191
resp, err := e.client.Get(endpoint, nil)
192192
if err != nil {
193193
return nil, err
@@ -204,7 +204,7 @@ func (e *EventsAPI) GetProjectEvent(orgSlug, projectSlug, eventID string) (*mode
204204
// GetIssue retrieves a specific issue
205205
func (e *EventsAPI) GetIssue(orgSlug, issueID string) (*models.Issue, error) {
206206
endpoint := fmt.Sprintf("/organizations/%s/issues/%s/", orgSlug, issueID)
207-
207+
208208
resp, err := e.client.Get(endpoint, nil)
209209
if err != nil {
210210
return nil, err
@@ -226,7 +226,7 @@ type GetIssueEventOptions struct {
226226
// GetIssueEvent retrieves a specific event for an issue
227227
func (e *EventsAPI) GetIssueEvent(orgSlug, issueID, eventID string, opts *GetIssueEventOptions) (*models.Event, error) {
228228
endpoint := fmt.Sprintf("/organizations/%s/issues/%s/events/%s/", orgSlug, issueID, eventID)
229-
229+
230230
params := url.Values{}
231231
if opts != nil {
232232
for _, env := range opts.Environment {
@@ -245,4 +245,4 @@ func (e *EventsAPI) GetIssueEvent(orgSlug, issueID, eventID string, opts *GetIss
245245
}
246246

247247
return &event, nil
248-
}
248+
}

internal/api/organizations.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type ListProjectsOptions struct {
2525
// ListProjects retrieves projects for an organization
2626
func (o *OrganizationsAPI) ListProjects(orgSlug string, opts *ListProjectsOptions) ([]models.Project, *client.PaginationInfo, error) {
2727
endpoint := fmt.Sprintf("/organizations/%s/projects/", orgSlug)
28-
28+
2929
params := url.Values{}
3030
if opts != nil && opts.Cursor != "" {
3131
params.Set("cursor", opts.Cursor)
@@ -65,10 +65,10 @@ func (o *OrganizationsAPI) GetStats(orgSlug string, opts *GetStatsOptions) (*mod
6565
}
6666

6767
endpoint := fmt.Sprintf("/organizations/%s/stats-summary/", orgSlug)
68-
68+
6969
params := url.Values{}
7070
params.Set("field", opts.Field)
71-
71+
7272
if opts.StatsPeriod != "" {
7373
params.Set("statsPeriod", opts.StatsPeriod)
7474
}
@@ -108,4 +108,4 @@ func (o *OrganizationsAPI) GetStats(orgSlug string, opts *GetStatsOptions) (*mod
108108
}
109109

110110
return &stats, nil
111-
}
111+
}

internal/api/projects.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type ListAllProjectsOptions struct {
2525
// ListProjects retrieves all projects the user has access to
2626
func (p *ProjectsAPI) ListProjects(opts *ListAllProjectsOptions) ([]models.Project, *client.PaginationInfo, error) {
2727
endpoint := "/projects/"
28-
28+
2929
params := url.Values{}
3030
if opts != nil && opts.Cursor != "" {
3131
params.Set("cursor", opts.Cursor)
@@ -47,7 +47,7 @@ func (p *ProjectsAPI) ListProjects(opts *ListAllProjectsOptions) ([]models.Proje
4747
// GetProject retrieves a specific project
4848
func (p *ProjectsAPI) GetProject(orgSlug, projectSlug string) (*models.Project, error) {
4949
endpoint := fmt.Sprintf("/projects/%s/%s/", orgSlug, projectSlug)
50-
50+
5151
resp, err := p.client.Get(endpoint, nil)
5252
if err != nil {
5353
return nil, err
@@ -59,4 +59,4 @@ func (p *ProjectsAPI) GetProject(orgSlug, projectSlug string) (*models.Project,
5959
}
6060

6161
return &project, nil
62-
}
62+
}

internal/cli/events.go

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

33
import (
44
"sentire/internal/api"
5-
"sentire/internal/client"
65
"sentire/internal/cli/formatter"
6+
"sentire/internal/client"
77

88
"github.com/spf13/cobra"
99
)
@@ -64,7 +64,7 @@ var getIssueEventCmd = &cobra.Command{
6464

6565
func init() {
6666
rootCmd.AddCommand(eventsCmd)
67-
67+
6868
eventsCmd.AddCommand(listProjectEventsCmd)
6969
eventsCmd.AddCommand(listIssueEventsCmd)
7070
eventsCmd.AddCommand(listIssuesCmd)
@@ -133,7 +133,7 @@ func runListProjectEvents(cmd *cobra.Command, args []string) error {
133133
}
134134

135135
fetchAll, _ := cmd.Flags().GetBool("all")
136-
136+
137137
var allEvents []interface{}
138138
cursor := ""
139139

@@ -194,7 +194,7 @@ func runListIssueEvents(cmd *cobra.Command, args []string) error {
194194
}
195195

196196
fetchAll, _ := cmd.Flags().GetBool("all")
197-
197+
198198
var allEvents []interface{}
199199
cursor := ""
200200

@@ -258,7 +258,7 @@ func runListIssues(cmd *cobra.Command, args []string) error {
258258
}
259259

260260
fetchAll, _ := cmd.Flags().GetBool("all")
261-
261+
262262
var allIssues []interface{}
263263
cursor := ""
264264

@@ -341,4 +341,3 @@ func runGetIssueEvent(cmd *cobra.Command, args []string) error {
341341

342342
return formatter.Output(cmd, event)
343343
}
344-

internal/cli/formatter/formatter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ func Output(cmd *cobra.Command, data interface{}) error {
7171
default:
7272
return formatter.FormatGeneric(v)
7373
}
74-
}
74+
}

internal/cli/formatter/helpers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ func formatTime(t *time.Time) string {
1616
return ""
1717
}
1818
return t.Format("2006-01-02 15:04:05")
19-
}
19+
}

internal/cli/formatter/json.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ func (f *JSONFormatter) FormatGeneric(data interface{}) error {
5656
encoder := json.NewEncoder(f.writer)
5757
encoder.SetIndent("", " ")
5858
return encoder.Encode(data)
59-
}
59+
}

0 commit comments

Comments
 (0)