This repository has been archived by the owner on Jan 14, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
153 additions
and
44 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 |
---|---|---|
@@ -0,0 +1,81 @@ | ||
+++ | ||
title = "Plugin API" | ||
description = "Plugin API Specification" | ||
date = "2018-06-14T00:00:00+10:00" | ||
weight = 20 | ||
draft = false | ||
bref = "" | ||
toc = true | ||
layout = "docs" | ||
+++ | ||
|
||
|
||
## `pkg/plugins/api` | ||
|
||
### func RegisterMapping | ||
|
||
```go | ||
func RegisterMapping( | ||
mapping func( | ||
name string, | ||
data string, | ||
) (cf types.TemplateObject), | ||
) func( | ||
name string, | ||
data string, | ||
) []byte | ||
``` | ||
|
||
RegisterMapping for your plugin | ||
|
||
### func RegisterOutput | ||
|
||
```go | ||
func RegisterOutput( | ||
output func( | ||
name string, | ||
data string, | ||
) (cf types.TemplateObject), | ||
) func( | ||
name string, | ||
data string, | ||
) []byte | ||
``` | ||
|
||
RegisterOutput for your plugin | ||
|
||
### func RegisterPlugin | ||
|
||
```go | ||
func RegisterPlugin(config apiTypes.Config) []byte | ||
``` | ||
|
||
RegisterPlugin to provide the name, prefix and version, and requiresAWSSession | ||
|
||
### func RegisterResource | ||
|
||
```go | ||
func RegisterResource( | ||
resource func( | ||
name string, | ||
data string, | ||
) (cf types.TemplateObject), | ||
) func( | ||
name string, | ||
data string, | ||
) []byte | ||
``` | ||
|
||
RegisterResource for your plugin | ||
|
||
__Usage__ | ||
|
||
```go | ||
var Resources = map[string]func( | ||
name string, | ||
data string, | ||
) []byte{ | ||
// resources.ParseLambdaFunction is explained in the next section | ||
"Function": api.RegisterResource(resources.ParseLambdaFunction), | ||
} | ||
``` |
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
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
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