-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from ellisvalentiner/fix/issue-7-initial-plugi…
…n-suggestions fix: initial plugin suggestions
- Loading branch information
Showing
14 changed files
with
509 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
|
||
install: | ||
go build -o ~/.steampipe/plugins/hub.steampipe.io/plugins/confluence/confluence@latest/steampipe-plugin-confluence.plugin *.go | ||
go build -o ~/.steampipe/plugins/hub.steampipe.io/plugins/ellisvalentiner/confluence@latest/steampipe-plugin-confluence.plugin *.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package confluence | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/ctreminiom/go-atlassian/confluence" | ||
|
||
"github.com/turbot/steampipe-plugin-sdk/grpc/proto" | ||
"github.com/turbot/steampipe-plugin-sdk/plugin" | ||
) | ||
|
||
//// TABLE DEFINITION | ||
|
||
func tableConfluenceContentBodyStorage() *plugin.Table { | ||
return &plugin.Table{ | ||
Name: "confluence_content_body_storage", | ||
Description: "Confluence Content Body in the Storage Format.", | ||
List: &plugin.ListConfig{ | ||
ParentHydrate: listContent, | ||
Hydrate: listContentBodyStorage, | ||
}, | ||
Columns: []*plugin.Column{ | ||
{ | ||
Name: "id", | ||
Type: proto.ColumnType_STRING, | ||
Description: "The ID of the content.", | ||
}, | ||
{ | ||
Name: "representation", | ||
Type: proto.ColumnType_STRING, | ||
Description: "The representation type of the content.", | ||
}, | ||
{ | ||
Name: "value", | ||
Type: proto.ColumnType_STRING, | ||
Description: "The content body.", | ||
}, | ||
}, | ||
} | ||
} | ||
|
||
// structs | ||
type contentBody struct { | ||
ID string `json:"id,omitempty"` | ||
Representation string `json:"representation,omitempty"` | ||
Value string `json:"value,omitempty"` | ||
} | ||
|
||
//// LIST FUNCTIONS | ||
|
||
func listContentBodyStorage(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { | ||
logger := plugin.Logger(ctx) | ||
logger.Trace("listContentBody") | ||
|
||
content := h.Item.(*confluence.ContentScheme) | ||
c := contentBody{ | ||
ID: content.ID, | ||
Representation: content.Body.Storage.Representation, | ||
Value: content.Body.Storage.Value, | ||
} | ||
d.StreamListItem(ctx, c) | ||
|
||
return nil, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package confluence | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/ctreminiom/go-atlassian/confluence" | ||
|
||
"github.com/turbot/steampipe-plugin-sdk/grpc/proto" | ||
"github.com/turbot/steampipe-plugin-sdk/plugin" | ||
) | ||
|
||
//// TABLE DEFINITION | ||
|
||
func tableConfluenceContentBodyView() *plugin.Table { | ||
return &plugin.Table{ | ||
Name: "confluence_content_body_view", | ||
Description: "Confluence Content Body in the View Format.", | ||
List: &plugin.ListConfig{ | ||
ParentHydrate: listContent, | ||
Hydrate: listContentBodyView, | ||
}, | ||
Columns: []*plugin.Column{ | ||
{ | ||
Name: "id", | ||
Type: proto.ColumnType_STRING, | ||
Description: "The ID of the content.", | ||
}, | ||
{ | ||
Name: "representation", | ||
Type: proto.ColumnType_STRING, | ||
Description: "The representation type of the content.", | ||
}, | ||
{ | ||
Name: "value", | ||
Type: proto.ColumnType_STRING, | ||
Description: "The content body.", | ||
}, | ||
}, | ||
} | ||
} | ||
|
||
//// LIST FUNCTIONS | ||
|
||
func listContentBodyView(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { | ||
logger := plugin.Logger(ctx) | ||
logger.Trace("listContentBody") | ||
|
||
content := h.Item.(*confluence.ContentScheme) | ||
c := contentBody{ | ||
ID: content.ID, | ||
Representation: content.Body.View.Representation, | ||
Value: content.Body.View.Value, | ||
} | ||
d.StreamListItem(ctx, c) | ||
|
||
return nil, nil | ||
} |
Oops, something went wrong.