Skip to content

Commit

Permalink
Add OpenGraph to steampipe_mod reflection table. Closes #692
Browse files Browse the repository at this point in the history
  • Loading branch information
kaidaguerre committed Jul 26, 2021
1 parent 71fd508 commit 4ae82bf
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion steampipeconfig/modconfig/mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type Mod struct {

// blocks
Requires *Requires `hcl:"requires,block"`
OpenGraph *OpenGraph `hcl:"opengraph,block"`
OpenGraph *OpenGraph `hcl:"opengraph,block" column:"opengraph,jsonb"`

// TODO do we need this?
Version *string
Expand Down
6 changes: 3 additions & 3 deletions steampipeconfig/modconfig/mod_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ type ModVersion struct {
ShortName string `hcl:"name,label"`
FullName string `cty:"name"`

Version string `cty:"version" hcl:"version"`
Alias *string `cty:"alias" hcl:"alias,optional"`
DeclRange hcl.Range
Version string `cty:"version" hcl:"version"`
Alias *string `cty:"alias" hcl:"alias,optional"`
DeclRange hcl.Range `json:"-"`
}

// Name returns Name@Version
Expand Down
6 changes: 3 additions & 3 deletions steampipeconfig/modconfig/open_graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type OpenGraph struct {
// The opengraph description (og:description) of the mod, for use in social media applications
Description string `cty:"description" hcl:"description"`
// The opengraph display title (og:title) of the mod, for use in social media applications.
Title string `cty:"title" hcl:"title"`
Image *string `cty:"image" hcl:"image"`
DeclRange hcl.Range
Title string `cty:"title" hcl:"title"`
Image *string `cty:"image" hcl:"image"`
DeclRange hcl.Range `json:"-"`
}
14 changes: 6 additions & 8 deletions steampipeconfig/modconfig/plugin_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,21 @@ package modconfig
import (
"fmt"

"github.com/turbot/steampipe/ociinstaller"

version "github.com/hashicorp/go-version"

"github.com/hashicorp/hcl/v2"
"github.com/turbot/steampipe/ociinstaller"
)

type PluginVersion struct {
// the plugin name, as specified in the mod requires block. , e.g. turbot/mod1, aws
RawName string `cty:"name" hcl:"name,label"`
// the version STREAM, can be either a major or minor version stream i.e. 1 or 1.1
Version string `cty:"version" hcl:"version,optional"`
DeclRange hcl.Range
ParsedVersion *version.Version
Version string `cty:"version" hcl:"version,optional"`
ParsedVersion *version.Version `json:"-"`
// the org and name which are parsed from the raw name
Org string
Name string
Org string
Name string
DeclRange hcl.Range `json:"-"`
}

func (p *PluginVersion) FullName() string {
Expand Down
2 changes: 1 addition & 1 deletion steampipeconfig/modconfig/requires.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ type Requires struct {
Steampipe string `hcl:"steampipe,optional"`
Plugins []*PluginVersion `hcl:"plugin,block"`
Mods []*ModVersion `hcl:"mod,block"`
DeclRange hcl.Range
DeclRange hcl.Range `json:"-"`
}

0 comments on commit 4ae82bf

Please sign in to comment.