add more docs

This commit is contained in:
Megan Marsh 2020-12-14 15:45:02 -08:00
parent 185614f886
commit 8650f7990c
10 changed files with 81 additions and 8 deletions

View File

@ -1,3 +1,8 @@
/*
Package none implements the 'none' communicator. Plugin maintainers should not
import this package directly, instead using the tooling in the
"packer-plugin-sdk/communicator" module.
*/
package none
import (

View File

@ -1,3 +1,8 @@
/*
Package ssh implements the SSH communicator. Plugin maintainers should not
import this package directly, instead using the tooling in the
"packer-plugin-sdk/communicator" module.
*/
package ssh
import (

View File

@ -1,3 +1,8 @@
/*
Package winrm implements the WinRM communicator. Plugin maintainers should not
import this package directly, instead using the tooling in the
"packer-plugin-sdk/communicator" module.
*/
package winrm
import (

View File

@ -5,10 +5,10 @@ relevant to plugin maintainers, as they are implementation details shared
between the HashiCorp-maintained shell-local provisioner and shell-local
post-processor.
The localexec sub-package can be used in any plugins that need local shell
access, whether that is in a driver for a hypervisor, or a command to a third
party cli tool. Please make sure that any third party tool dependencies are
noted in your plugin's documentation.
However, the localexec sub-package can be used in any plugins that need local
shell access, whether that is in a driver for a hypervisor, or a command to a
third party cli tool. Please make sure that any third party tool dependencies
are noted in your plugin's documentation.
*/
package shell_local

View File

@ -1,4 +1,8 @@
// Package shell defines code that is common in shells
// Package shell defines configuration fields that are common to many different
// kinds of shell. For example, this common configuration is imported by the
// "shell", "shell-local", and "powershell" provisioners. This provides
// consistency in the user experience and prevents provisioner maintainers from
// having to reimplement common useful functions across various environments.
package shell
import "github.com/hashicorp/packer/packer-plugin-sdk/common"

View File

@ -1,5 +1,6 @@
//go:generate struct-markdown
//Package shutdowncommand is a helper module for builder plugin configuration.
package shutdowncommand
import (
@ -9,7 +10,8 @@ import (
)
// ShutdownConfig defines implementation details for shutting down a VM once it
// is done provisioned.
// is done being provisioned.
//
// It is provided as a convenience to encourage builder developers to
// consider implementing these options, which we believe are valuable for all
// builders. It also helps guarantee that option names for similar options

View File

@ -0,0 +1,49 @@
/*
Package template helps plugins parse the Packer template into golang structures.
This package should be imported and used by all plugins. It implements the
golang template engines that Packer documentes on its website, along with input
validation, custom type decoding, and template variable interpolation.
A simple usage example that defines a config and then unpacks a user-provided
json template into the provided config:
```golang
import (
// ...
"github.com/hashicorp/packer-plugin-sdk/template/config"
"github.com/hashicorp/packer-plugin-sdk/template/interpolate"
)
type Config struct {
Field1 string `mapstructure:"field_1"`
Field2 bool `mapstructure:"field_2"`
Field3 bool `mapstructure:"field_3"`
ctx interpolate.Context
}
type Provisioner struct {
config Config
}
func (p *CommentProvisioner) Prepare(raws ...interface{}) error {
err := config.Decode(&p.config, &config.DecodeOpts{
Interpolate: true,
InterpolateContext: &p.config.ctx,
}, raws...)
if err != nil {
return err
}
return nil
}
// ...
```
More implementation details for plugins can be found in the
[extending packer](https://www.packer.io/docs/extending) section of the website.
*/
package template

View File

@ -1,3 +1,5 @@
// Package useragent creates a user agent for builders to use when calling out
// to cloud APIs or other addresses.
package useragent
import (

View File

@ -1,3 +1,4 @@
// Package uuid provides helper functions for creating time-ordered UUIDs.
package uuid
import (

View File

@ -1,5 +1,5 @@
// Version helps plugin creators set and track the plugin version using the same
// convenience functions used by the Packer core.
// Package version helps plugin creators set and track the plugin version using
// the same convenience functions used by the Packer core.
package version
import (