Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/lint_markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Vale
uses: errata-ai/vale-action@v2
with:
vale_flags: "--glob=!{docs/testdata/*,CHANGELOG.md,.github/styles/proselint/README.md}"
vale_flags: "--glob=!{docs/testdata/*,CHANGELOG.md,.github/styles/proselint/README.md,examples/simple_plugin/docs/*.md}"
filter_mode: nofilter
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Expand All @@ -31,4 +31,4 @@ jobs:
with:
files: .
config_file: .markdownlint.yaml
ignore_files: "{docs/testdata/*,CHANGELOG.md}"
ignore_files: "{docs/testdata/*,CHANGELOG.md,examples/simple_plugin/docs/*.md}"
9 changes: 9 additions & 0 deletions examples/simple_plugin/docs/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Configuration
slug: configuration
description: How to configure the simple_plugin example.
---

# Configuration

This plugin requires no configuration.
9 changes: 9 additions & 0 deletions examples/simple_plugin/docs/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Overview
slug: overview
description: Overview of the simple_plugin example.
---

# Overview

This is a simple example of a plugin that is used to test the SDK.
16 changes: 2 additions & 14 deletions plugin/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,9 @@ func (m MigrateMode) String() string {

type Option func(*Plugin)

func WithTitle(title string) Option {
func WithBuildTargets(targets []BuildTarget) Option {
return func(p *Plugin) {
p.title = title
}
}

func WithDescription(description string) Option {
return func(p *Plugin) {
p.description = description
}
}

func WithShortDescription(shortDescription string) Option {
return func(p *Plugin) {
p.shortDescription = shortDescription
p.targets = targets
}
}

Expand Down
30 changes: 2 additions & 28 deletions plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,10 @@ func (UnimplementedSource) Tables(context.Context, TableOptions) (schema.Tables,
// Plugin is the base structure required to pass to sdk.serve
// We take a declarative approach to API here similar to Cobra
type Plugin struct {
// Name of plugin i.e aws,gcp, azure etc'
// Name of plugin i.e aws, gcp, azure etc
name string
// Version of the plugin
version string
// Title of the plugin as appears in CloudQuery registry
title string
// Short description of the plugin as appears in CloudQuery registry
shortDescription string
// Long description of the plugin as appears in CloudQuery registry
description string
// categories of the plugin as appears in CloudQuery registry
categories []string
// targets to build plugin for
targets []BuildTarget
// Called upon init call to validate and init configuration
Expand All @@ -84,9 +76,7 @@ func NewPlugin(name string, version string, newClient NewClientFunc, options ...
version: version,
internalColumns: true,
newClient: newClient,
title: name,
categories: []string{},
targets: buildTargets,
targets: DefaultBuildTargets,
}
for _, opt := range options {
opt(&p)
Expand All @@ -104,22 +94,6 @@ func (p *Plugin) Version() string {
return p.version
}

func (p *Plugin) Title() string {
return p.title
}

func (p *Plugin) Description() string {
return p.description
}

func (p *Plugin) ShortDescription() string {
return p.shortDescription
}

func (p *Plugin) Categories() []string {
return p.categories
}

func (p *Plugin) Targets() []BuildTarget {
return p.targets
}
Expand Down
28 changes: 28 additions & 0 deletions plugin/plugin_package.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package plugin

const (
GoOSLinux = "linux"
GoOSWindows = "windows"
GoOSDarwin = "darwin"

GoArchAmd64 = "amd64"
GoArchArm64 = "arm64"
)

type PackageType string

const (
PackageTypeNative PackageType = "native"
)

type BuildTarget struct {
OS string `json:"os"`
Arch string `json:"arch"`
}

var DefaultBuildTargets = []BuildTarget{
{GoOSLinux, GoArchAmd64},
{GoOSWindows, GoArchAmd64},
{GoOSDarwin, GoArchAmd64},
{GoOSDarwin, GoArchArm64},
}
29 changes: 0 additions & 29 deletions plugin/plugin_publish.go

This file was deleted.

Loading