Documentation ¶
Overview ¶
Package codegen generates custom datatypes, PDK plugin code and SDK host code from a `schema.Plugin` in the Go and MoonBit programming languages.
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) GenCustomTypes() (GeneratedFiles, error)
- func (c *Client) GenHostDir(dirName string) error
- func (c *Client) GenHostSDK() (GeneratedFiles, error)
- func (c *Client) GenPluginDir(dirName string) error
- func (c *Client) GenPluginPDK() (GeneratedFiles, error)
- func (c *Client) GenTypesDir(dirName string) error
- type ClientOpts
- type GeneratedFiles
Constants ¶
View Source
const VERSION = "0.1.0"
VERSION is on a line by itself for use with "bump_version": https://github.com/Shyp/bump_version
Variables ¶
View Source
var (
ErrNoCodeGeneration = errors.New("code generation not supported for version v0")
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { PkgName string Lang string // "go" or "mbt" Plugin *schema.Plugin CustTypesFilename string CustTypes string CustTypesTestsFilename string CustTypesTests string // contains filtered or unexported fields }
Client represents a codegen client.
func New ¶
New returns a new codegen `Client` for either "go" or "mbt" and the provided plugin with the given package name.
func (*Client) GenCustomTypes ¶
func (c *Client) GenCustomTypes() (GeneratedFiles, error)
func (*Client) GenHostDir ¶
func (*Client) GenHostSDK ¶
func (c *Client) GenHostSDK() (GeneratedFiles, error)
GenHostSDK generates Host SDK code to call the extension plugin.
func (*Client) GenPluginDir ¶
func (*Client) GenPluginPDK ¶
func (c *Client) GenPluginPDK() (GeneratedFiles, error)
GenPluginPDK generates Plugin PDK code to process plugin calls.
func (*Client) GenTypesDir ¶
type ClientOpts ¶
type ClientOpts struct { // Force causes existing file to be overwritten. Force bool // Quiet prevents warning messages from being printed Quiet bool }
ClientOpts represents options to the codegen Client.
type GeneratedFiles ¶
GeneratedFiles represents the files in the generated code.
Click to show internal directories.
Click to hide internal directories.