Documentation
¶
Overview ¶
Package rpc contains the implementation of the remote procedure call code that the Packer core uses to communicate with packer plugins. As a plugin maintainer, you are unlikely to need to directly import or use this package, but it underpins the packer server that all plugins must implement.
Index ¶
- Constants
- Variables
- func Communicator(client *rpc.Client) *communicator
- func NewFileInfo(fi os.FileInfo) *fileInfo
- type ArtifactServer
- func (s *ArtifactServer) BuilderId(args *interface{}, reply *string) error
- func (s *ArtifactServer) Destroy(args *interface{}, reply *error) error
- func (s *ArtifactServer) Files(args *interface{}, reply *[]string) error
- func (s *ArtifactServer) Id(args *interface{}, reply *string) error
- func (s *ArtifactServer) State(name string, reply *interface{}) error
- func (s *ArtifactServer) String(args *interface{}, reply *string) error
- type Attr
- type BasicError
- type Block
- type BlockList
- type BuildPrepareResponse
- type BuildServer
- func (b *BuildServer) Cancel(args *interface{}, reply *interface{}) error
- func (b *BuildServer) Name(args *interface{}, reply *string) error
- func (b *BuildServer) Prepare(args *interface{}, resp *BuildPrepareResponse) error
- func (b *BuildServer) Run(streamId uint32, reply *[]uint32) error
- func (b *BuildServer) SetDebug(val *bool, reply *interface{}) error
- func (b *BuildServer) SetForce(val *bool, reply *interface{}) error
- func (b *BuildServer) SetOnError(val *string, reply *interface{}) error
- type BuilderPrepareArgs
- type BuilderPrepareResponse
- type BuilderServer
- func (b *BuilderServer) Cancel(args *interface{}, reply *interface{}) error
- func (s *BuilderServer) ConfigSpec(_ interface{}, reply *ConfigSpecResponse) error
- func (b *BuilderServer) Prepare(args *BuilderPrepareArgs, reply *BuilderPrepareResponse) error
- func (b *BuilderServer) Run(streamId uint32, reply *uint32) error
- type Client
- func (c *Client) Artifact() packer.Artifact
- func (c *Client) Build() packer.Build
- func (c *Client) Builder() packer.Builder
- func (c *Client) Close() error
- func (c *Client) Communicator() packer.Communicator
- func (c *Client) Datasource() packer.Datasource
- func (c *Client) Hook() packer.Hook
- func (c *Client) PostProcessor() packer.PostProcessor
- func (c *Client) Provisioner() packer.Provisioner
- func (c *Client) Ui() packer.Ui
- type CommandFinished
- type CommunicatorDownloadArgs
- type CommunicatorDownloadDirArgs
- type CommunicatorServer
- func (s *CommunicatorServer) ConfigSpec(_ interface{}, reply *ConfigSpecResponse) error
- func (c *CommunicatorServer) Download(args *CommunicatorDownloadArgs, reply *interface{}) (err error)
- func (c *CommunicatorServer) DownloadDir(args *CommunicatorUploadDirArgs, reply *error) error
- func (c *CommunicatorServer) Start(args *CommunicatorStartArgs, reply *interface{}) error
- func (c *CommunicatorServer) Upload(args *CommunicatorUploadArgs, reply *interface{}) (err error)
- func (c *CommunicatorServer) UploadDir(args *CommunicatorUploadDirArgs, reply *error) error
- type CommunicatorStartArgs
- type CommunicatorUploadArgs
- type CommunicatorUploadDirArgs
- type ConfigSpecResponse
- type CtyList
- type CtyMap
- type CtyPrimitive
- type CtyType
- func (*CtyType) Descriptor() ([]byte, []int)deprecated
- func (x *CtyType) GetList() *CtyList
- func (x *CtyType) GetMap() *CtyMap
- func (x *CtyType) GetPrimitive() *CtyPrimitive
- func (m *CtyType) GetTypeDef() isCtyType_TypeDef
- func (*CtyType) ProtoMessage()
- func (x *CtyType) ProtoReflect() protoreflect.Message
- func (x *CtyType) Reset()
- func (x *CtyType) String() string
- type CtyType_List
- type CtyType_Map
- type CtyType_Primitive
- type DatasourceConfigureArgs
- type DatasourceConfigureResponse
- type DatasourceServer
- func (d *DatasourceServer) Cancel(args *interface{}, reply *interface{}) error
- func (s *DatasourceServer) ConfigSpec(_ interface{}, reply *ConfigSpecResponse) error
- func (d *DatasourceServer) Configure(args *DatasourceConfigureArgs, reply *DatasourceConfigureResponse) error
- func (d *DatasourceServer) Execute(args *interface{}, reply *ExecuteResponse) error
- func (d *DatasourceServer) OutputSpec(args *DatasourceConfigureArgs, reply *OutputSpecResponse) error
- type ExecuteResponse
- type HCL2Spec
- type HookRunArgs
- type HookServer
- type Object
- type OutputSpecResponse
- type PluginServer
- func (s *PluginServer) Close() error
- func (s *PluginServer) RegisterArtifact(a packer.Artifact) error
- func (s *PluginServer) RegisterBuild(b packer.Build) error
- func (s *PluginServer) RegisterBuilder(b packer.Builder) error
- func (s *PluginServer) RegisterCommunicator(c packer.Communicator) error
- func (s *PluginServer) RegisterDatasource(d packer.Datasource) error
- func (s *PluginServer) RegisterHook(h packer.Hook) error
- func (s *PluginServer) RegisterPostProcessor(p packer.PostProcessor) error
- func (s *PluginServer) RegisterProvisioner(p packer.Provisioner) error
- func (s *PluginServer) RegisterUi(ui packer.Ui) error
- func (s *PluginServer) Serve()
- type PostProcessorConfigureArgs
- type PostProcessorProcessResponse
- type PostProcessorServer
- func (b *PostProcessorServer) Cancel(args *interface{}, reply *interface{}) error
- func (s *PostProcessorServer) ConfigSpec(_ interface{}, reply *ConfigSpecResponse) error
- func (p *PostProcessorServer) Configure(args *PostProcessorConfigureArgs, reply *interface{}) (err error)
- func (p *PostProcessorServer) PostProcess(streamId uint32, reply *PostProcessorProcessResponse) error
- type ProgressTrackingClient
- type ProgressTrackingServer
- type ProvisionerPrepareArgs
- type ProvisionerProvisionArgs
- type ProvisionerServer
- func (p *ProvisionerServer) Cancel(args *interface{}, reply *interface{}) error
- func (s *ProvisionerServer) ConfigSpec(_ interface{}, reply *ConfigSpecResponse) error
- func (p *ProvisionerServer) Prepare(args *ProvisionerPrepareArgs, reply *interface{}) error
- func (p *ProvisionerServer) Provision(args *ProvisionerProvisionArgs, reply *interface{}) error
- type Spec
- func (*Spec) Descriptor() ([]byte, []int)deprecated
- func (spec *Spec) FromProto() (hcldec.Spec, error)
- func (x *Spec) GetAttr() *Attr
- func (m *Spec) GetBlock() isSpec_Block
- func (x *Spec) GetBlockList() *BlockList
- func (x *Spec) GetBlockValue() *Block
- func (x *Spec) GetObject() *Object
- func (*Spec) ProtoMessage()
- func (x *Spec) ProtoReflect() protoreflect.Message
- func (x *Spec) Reset()
- func (x *Spec) String() string
- type Spec_Attr
- type Spec_BlockList
- type Spec_BlockValue
- type Spec_Object
- type TrackProgressParameters
- type Ui
- func (u *Ui) Ask(query string) (result string, err error)
- func (u *Ui) Askf(query string, args ...any) (string, error)
- func (p *Ui) ConfigSpec() hcldec.ObjectSpec
- func (u *Ui) Error(message string)
- func (u *Ui) Errorf(message string, args ...any)
- func (u *Ui) Machine(t string, args ...string)
- func (u *Ui) Message(message string)deprecated
- func (u *Ui) Say(message string)
- func (u *Ui) Sayf(message string, args ...any)
- func (u *Ui) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) io.ReadCloser
- type UiMachineArgs
- type UiServer
- func (u *UiServer) Ask(query string, reply *string) (err error)
- func (u *UiServer) Error(message *string, reply *interface{}) error
- func (u *UiServer) Machine(args *UiMachineArgs, reply *interface{}) error
- func (u *UiServer) Message(message *string, reply *interface{}) errordeprecated
- func (ui *UiServer) NewTrackProgress(pl *TrackProgressParameters, reply *string) error
- func (u *UiServer) Say(message *string, reply *interface{}) error
Constants ¶
const ( DefaultArtifactEndpoint string = "Artifact" DefaultBuildEndpoint string = "Build" DefaultBuilderEndpoint string = "Builder" DefaultCacheEndpoint string = "Cache" DefaultCommandEndpoint string = "Command" DefaultCommunicatorEndpoint string = "Communicator" DefaultHookEndpoint string = "Hook" DefaultPostProcessorEndpoint string = "PostProcessor" DefaultProvisionerEndpoint string = "Provisioner" DefaultDatasourceEndpoint string = "Datasource" DefaultUiEndpoint string = "Ui" )
Variables ¶
var File_hcl_spec_proto protoreflect.FileDescriptor
Functions ¶
func Communicator ¶
func NewFileInfo ¶
Types ¶
type ArtifactServer ¶
type ArtifactServer struct {
// contains filtered or unexported fields
}
ArtifactServer wraps a packersdk.Artifact implementation and makes it exportable as part of a Golang RPC server.
func (*ArtifactServer) BuilderId ¶
func (s *ArtifactServer) BuilderId(args *interface{}, reply *string) error
func (*ArtifactServer) Destroy ¶
func (s *ArtifactServer) Destroy(args *interface{}, reply *error) error
func (*ArtifactServer) Files ¶
func (s *ArtifactServer) Files(args *interface{}, reply *[]string) error
func (*ArtifactServer) Id ¶
func (s *ArtifactServer) Id(args *interface{}, reply *string) error
func (*ArtifactServer) State ¶
func (s *ArtifactServer) State(name string, reply *interface{}) error
func (*ArtifactServer) String ¶
func (s *ArtifactServer) String(args *interface{}, reply *string) error
type Attr ¶ added in v0.6.0
type Attr struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Type *CtyType `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
Required bool `protobuf:"varint,3,opt,name=required,proto3" json:"required,omitempty"`
// contains filtered or unexported fields
}
Attr spec type reads the value of an attribute in the current body and returns that value as its result. It also creates validation constraints for the given attribute name and its value.
func (*Attr) Descriptor
deprecated
added in
v0.6.0
func (*Attr) GetRequired ¶ added in v0.6.0
func (*Attr) ProtoMessage ¶ added in v0.6.0
func (*Attr) ProtoMessage()
func (*Attr) ProtoReflect ¶ added in v0.6.0
func (x *Attr) ProtoReflect() protoreflect.Message
type BasicError ¶
type BasicError struct {
Message string
}
This is a type that wraps error types so that they can be messaged across RPC channels. Since "error" is an interface, we can't always gob-encode the underlying structure. This is a valid error interface implementer that we will push across.
func NewBasicError ¶
func NewBasicError(err error) *BasicError
func (*BasicError) Error ¶
func (e *BasicError) Error() string
type Block ¶ added in v0.6.0
type Block struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Required bool `protobuf:"varint,2,opt,name=required,proto3" json:"required,omitempty"`
Nested *Spec `protobuf:"bytes,3,opt,name=nested,proto3" json:"nested,omitempty"`
// contains filtered or unexported fields
}
Block spec type applies one nested spec block to the contents of a block within the current body and returns the result of that spec. It also creates validation constraints for the given block type name.
func (*Block) Descriptor
deprecated
added in
v0.6.0
func (*Block) GetRequired ¶ added in v0.6.0
func (*Block) ProtoMessage ¶ added in v0.6.0
func (*Block) ProtoMessage()
func (*Block) ProtoReflect ¶ added in v0.6.0
func (x *Block) ProtoReflect() protoreflect.Message
type BlockList ¶ added in v0.6.0
type BlockList struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Nested *Spec `protobuf:"bytes,2,opt,name=nested,proto3" json:"nested,omitempty"`
// contains filtered or unexported fields
}
BlockList spec type is similar to `Block`, but it accepts zero or more blocks of a specified type rather than requiring zero or one. The result is a JSON array with one entry per block of the given type.
func (*BlockList) Descriptor
deprecated
added in
v0.6.0
func (*BlockList) ProtoMessage ¶ added in v0.6.0
func (*BlockList) ProtoMessage()
func (*BlockList) ProtoReflect ¶ added in v0.6.0
func (x *BlockList) ProtoReflect() protoreflect.Message
type BuildPrepareResponse ¶
type BuildPrepareResponse struct {
Warnings []string
Error *BasicError
}
type BuildServer ¶
type BuildServer struct {
// contains filtered or unexported fields
}
BuildServer wraps a packersdk.Build implementation and makes it exportable as part of a Golang RPC server.
func (*BuildServer) Cancel ¶
func (b *BuildServer) Cancel(args *interface{}, reply *interface{}) error
func (*BuildServer) Name ¶
func (b *BuildServer) Name(args *interface{}, reply *string) error
func (*BuildServer) Prepare ¶
func (b *BuildServer) Prepare(args *interface{}, resp *BuildPrepareResponse) error
func (*BuildServer) SetDebug ¶
func (b *BuildServer) SetDebug(val *bool, reply *interface{}) error
func (*BuildServer) SetForce ¶
func (b *BuildServer) SetForce(val *bool, reply *interface{}) error
func (*BuildServer) SetOnError ¶
func (b *BuildServer) SetOnError(val *string, reply *interface{}) error
type BuilderPrepareArgs ¶
type BuilderPrepareArgs struct {
Configs []interface{}
}
type BuilderPrepareResponse ¶
type BuilderPrepareResponse struct {
GeneratedVars []string
Warnings []string
Error *BasicError
}
type BuilderServer ¶
type BuilderServer struct {
// contains filtered or unexported fields
}
BuilderServer wraps a packersdk.Builder implementation and makes it exportable as part of a Golang RPC server.
func (*BuilderServer) Cancel ¶
func (b *BuilderServer) Cancel(args *interface{}, reply *interface{}) error
func (*BuilderServer) ConfigSpec ¶
func (s *BuilderServer) ConfigSpec(_ interface{}, reply *ConfigSpecResponse) error
func (*BuilderServer) Prepare ¶
func (b *BuilderServer) Prepare(args *BuilderPrepareArgs, reply *BuilderPrepareResponse) error
type Client ¶
type Client struct {
// UseProto makes it so that clients started from this will use
// protobuf/msgpack for serialisation instead of gob
UseProto bool
// contains filtered or unexported fields
}
Client is the client end that communicates with a Packer RPC server. Establishing a connection is up to the user. The Client can communicate over any ReadWriteCloser. In Packer, each "plugin" (builder, provisioner, and post-processor) creates and launches a server. The the packer "core" creates and uses the client.
func (*Client) Communicator ¶
func (c *Client) Communicator() packer.Communicator
func (*Client) Datasource ¶ added in v0.0.7
func (c *Client) Datasource() packer.Datasource
func (*Client) PostProcessor ¶
func (c *Client) PostProcessor() packer.PostProcessor
func (*Client) Provisioner ¶
func (c *Client) Provisioner() packer.Provisioner
type CommandFinished ¶
type CommandFinished struct {
ExitStatus int
}
type CommunicatorServer ¶
type CommunicatorServer struct {
// contains filtered or unexported fields
}
CommunicatorServer wraps a packersdk.Communicator implementation and makes it exportable as part of a Golang RPC server.
func (*CommunicatorServer) ConfigSpec ¶
func (s *CommunicatorServer) ConfigSpec(_ interface{}, reply *ConfigSpecResponse) error
func (*CommunicatorServer) Download ¶
func (c *CommunicatorServer) Download(args *CommunicatorDownloadArgs, reply *interface{}) (err error)
func (*CommunicatorServer) DownloadDir ¶
func (c *CommunicatorServer) DownloadDir(args *CommunicatorUploadDirArgs, reply *error) error
func (*CommunicatorServer) Start ¶
func (c *CommunicatorServer) Start(args *CommunicatorStartArgs, reply *interface{}) error
func (*CommunicatorServer) Upload ¶
func (c *CommunicatorServer) Upload(args *CommunicatorUploadArgs, reply *interface{}) (err error)
func (*CommunicatorServer) UploadDir ¶
func (c *CommunicatorServer) UploadDir(args *CommunicatorUploadDirArgs, reply *error) error
type CommunicatorStartArgs ¶
type CommunicatorUploadArgs ¶
type ConfigSpecResponse ¶
type ConfigSpecResponse struct {
ConfigSpec []byte
}
type CtyList ¶ added in v0.6.0
type CtyList struct {
ElementType *CtyType `protobuf:"bytes,1,opt,name=elementType,proto3" json:"elementType,omitempty"`
// contains filtered or unexported fields
}
CtyList is a list of a cty.Type
func (*CtyList) Descriptor
deprecated
added in
v0.6.0
func (*CtyList) GetElementType ¶ added in v0.6.0
func (*CtyList) ProtoMessage ¶ added in v0.6.0
func (*CtyList) ProtoMessage()
func (*CtyList) ProtoReflect ¶ added in v0.6.0
func (x *CtyList) ProtoReflect() protoreflect.Message
type CtyMap ¶ added in v0.6.0
type CtyMap struct {
ElementType *CtyType `protobuf:"bytes,1,opt,name=elementType,proto3" json:"elementType,omitempty"`
// contains filtered or unexported fields
}
CtyMap is a map from one type to another
func (*CtyMap) Descriptor
deprecated
added in
v0.6.0
func (*CtyMap) GetElementType ¶ added in v0.6.0
func (*CtyMap) ProtoMessage ¶ added in v0.6.0
func (*CtyMap) ProtoMessage()
func (*CtyMap) ProtoReflect ¶ added in v0.6.0
func (x *CtyMap) ProtoReflect() protoreflect.Message
type CtyPrimitive ¶ added in v0.6.0
type CtyPrimitive struct {
TypeString string `protobuf:"bytes,1,opt,name=typeString,proto3" json:"typeString,omitempty"`
// contains filtered or unexported fields
}
CtyPrimitive is any of the cty.Type that match the `IsPrimitiveType` function i.e. either Number, Bool or String.
func (*CtyPrimitive) Descriptor
deprecated
added in
v0.6.0
func (*CtyPrimitive) Descriptor() ([]byte, []int)
Deprecated: Use CtyPrimitive.ProtoReflect.Descriptor instead.
func (*CtyPrimitive) GetTypeString ¶ added in v0.6.0
func (x *CtyPrimitive) GetTypeString() string
func (*CtyPrimitive) ProtoMessage ¶ added in v0.6.0
func (*CtyPrimitive) ProtoMessage()
func (*CtyPrimitive) ProtoReflect ¶ added in v0.6.0
func (x *CtyPrimitive) ProtoReflect() protoreflect.Message
func (*CtyPrimitive) Reset ¶ added in v0.6.0
func (x *CtyPrimitive) Reset()
func (*CtyPrimitive) String ¶ added in v0.6.0
func (x *CtyPrimitive) String() string
type CtyType ¶ added in v0.6.0
type CtyType struct {
// Types that are assignable to TypeDef:
//
// *CtyType_Primitive
// *CtyType_List
// *CtyType_Map
TypeDef isCtyType_TypeDef `protobuf_oneof:"typeDef"`
// contains filtered or unexported fields
}
CtyType is any of the cty types that can be used for a Attribute.
Bodies aren't an issue since they're encompassing a bunch of different attributes, which end-up referencing a type from this structure.
func (*CtyType) Descriptor
deprecated
added in
v0.6.0
func (*CtyType) GetPrimitive ¶ added in v0.6.0
func (x *CtyType) GetPrimitive() *CtyPrimitive
func (*CtyType) GetTypeDef ¶ added in v0.6.0
func (m *CtyType) GetTypeDef() isCtyType_TypeDef
func (*CtyType) ProtoMessage ¶ added in v0.6.0
func (*CtyType) ProtoMessage()
func (*CtyType) ProtoReflect ¶ added in v0.6.0
func (x *CtyType) ProtoReflect() protoreflect.Message
type CtyType_List ¶ added in v0.6.0
type CtyType_List struct {
List *CtyList `protobuf:"bytes,2,opt,name=list,proto3,oneof"`
}
type CtyType_Map ¶ added in v0.6.0
type CtyType_Map struct {
Map *CtyMap `protobuf:"bytes,3,opt,name=map,proto3,oneof"`
}
type CtyType_Primitive ¶ added in v0.6.0
type CtyType_Primitive struct {
Primitive *CtyPrimitive `protobuf:"bytes,1,opt,name=primitive,proto3,oneof"`
}
type DatasourceConfigureArgs ¶ added in v0.0.7
type DatasourceConfigureArgs struct {
Configs []interface{}
}
type DatasourceConfigureResponse ¶ added in v0.0.7
type DatasourceConfigureResponse struct {
Error *BasicError
}
type DatasourceServer ¶ added in v0.0.7
type DatasourceServer struct {
// contains filtered or unexported fields
}
DatasourceServer wraps a packer.Datasource implementation and makes it exportable as part of a Golang RPC server.
func (*DatasourceServer) Cancel ¶ added in v0.0.7
func (d *DatasourceServer) Cancel(args *interface{}, reply *interface{}) error
func (*DatasourceServer) ConfigSpec ¶ added in v0.0.7
func (s *DatasourceServer) ConfigSpec(_ interface{}, reply *ConfigSpecResponse) error
func (*DatasourceServer) Configure ¶ added in v0.0.7
func (d *DatasourceServer) Configure(args *DatasourceConfigureArgs, reply *DatasourceConfigureResponse) error
func (*DatasourceServer) Execute ¶ added in v0.0.7
func (d *DatasourceServer) Execute(args *interface{}, reply *ExecuteResponse) error
func (*DatasourceServer) OutputSpec ¶ added in v0.0.7
func (d *DatasourceServer) OutputSpec(args *DatasourceConfigureArgs, reply *OutputSpecResponse) error
type ExecuteResponse ¶ added in v0.0.7
type ExecuteResponse struct {
Value []byte
Error *BasicError
}
type HCL2Spec ¶ added in v0.6.0
type HCL2Spec struct {
TypeSpec map[string]*Spec `` /* 157-byte string literal not displayed */
// contains filtered or unexported fields
}
HCL2Spec matches what Packer already consumes from plugins in order to describe their contents' schema, and lets Packer decode the configuration provided by the user to cty values, and detect problems with the contents before executing them.
These are sent over-the-wire over gRPC, much like the old system did using gob encoding and standard go RPC servers.
func (*HCL2Spec) Descriptor
deprecated
added in
v0.6.0
func (*HCL2Spec) GetTypeSpec ¶ added in v0.6.0
func (*HCL2Spec) ProtoMessage ¶ added in v0.6.0
func (*HCL2Spec) ProtoMessage()
func (*HCL2Spec) ProtoReflect ¶ added in v0.6.0
func (x *HCL2Spec) ProtoReflect() protoreflect.Message
type HookRunArgs ¶
type HookServer ¶
type HookServer struct {
// contains filtered or unexported fields
}
HookServer wraps a packersdk.Hook implementation and makes it exportable as part of a Golang RPC server.
func (*HookServer) Cancel ¶
func (h *HookServer) Cancel(args *interface{}, reply *interface{}) error
func (*HookServer) Run ¶
func (h *HookServer) Run(args *HookRunArgs, reply *interface{}) error
type Object ¶ added in v0.6.0
type Object struct {
Attributes map[string]*Spec `` /* 161-byte string literal not displayed */
// contains filtered or unexported fields
}
Object spec type is the most commonly used at the root of a spec file. Its result is a JSON object whose properties are set based on any nested spec blocks:
func (*Object) Descriptor
deprecated
added in
v0.6.0
func (*Object) GetAttributes ¶ added in v0.6.0
func (*Object) ProtoMessage ¶ added in v0.6.0
func (*Object) ProtoMessage()
func (*Object) ProtoReflect ¶ added in v0.6.0
func (x *Object) ProtoReflect() protoreflect.Message
type OutputSpecResponse ¶ added in v0.0.7
type OutputSpecResponse struct {
OutputSpec []byte
}
type PluginServer ¶ added in v0.0.11
type PluginServer struct {
// UseProto forces the server to use protobuf/msgpack for serialization
// instead of gob.
// Setting UseProto on a server endpoint that only supports gob is
// treated as a noop.
// This field is set by the plugin `Set` type for plugins who support
// protocol version v2.
UseProto bool
// contains filtered or unexported fields
}
PluginServer represents an RPC server for Packer. This must be paired on the other side with a PluginClient. In Packer, each "plugin" (builder, provisioner, and post-processor) creates and launches a server. The client created and used by the packer "core"
func NewServer ¶
func NewServer(conn io.ReadWriteCloser) (*PluginServer, error)
NewServer returns a new Packer RPC server.
func (*PluginServer) Close ¶ added in v0.0.11
func (s *PluginServer) Close() error
func (*PluginServer) RegisterArtifact ¶ added in v0.0.11
func (s *PluginServer) RegisterArtifact(a packer.Artifact) error
func (*PluginServer) RegisterBuild ¶ added in v0.0.11
func (s *PluginServer) RegisterBuild(b packer.Build) error
func (*PluginServer) RegisterBuilder ¶ added in v0.0.11
func (s *PluginServer) RegisterBuilder(b packer.Builder) error
func (*PluginServer) RegisterCommunicator ¶ added in v0.0.11
func (s *PluginServer) RegisterCommunicator(c packer.Communicator) error
func (*PluginServer) RegisterDatasource ¶ added in v0.0.11
func (s *PluginServer) RegisterDatasource(d packer.Datasource) error
func (*PluginServer) RegisterHook ¶ added in v0.0.11
func (s *PluginServer) RegisterHook(h packer.Hook) error
func (*PluginServer) RegisterPostProcessor ¶ added in v0.0.11
func (s *PluginServer) RegisterPostProcessor(p packer.PostProcessor) error
func (*PluginServer) RegisterProvisioner ¶ added in v0.0.11
func (s *PluginServer) RegisterProvisioner(p packer.Provisioner) error
func (*PluginServer) RegisterUi ¶ added in v0.0.11
func (s *PluginServer) RegisterUi(ui packer.Ui) error
func (*PluginServer) Serve ¶ added in v0.0.11
func (s *PluginServer) Serve()
ServeConn serves a single connection over the RPC server. It is up to the caller to obtain a proper io.ReadWriteCloser.
type PostProcessorConfigureArgs ¶
type PostProcessorConfigureArgs struct {
Configs []interface{}
}
type PostProcessorProcessResponse ¶
type PostProcessorProcessResponse struct {
Err *BasicError
Keep bool
ForceOverride bool
StreamId uint32
}
type PostProcessorServer ¶
type PostProcessorServer struct {
// contains filtered or unexported fields
}
PostProcessorServer wraps a packersdk.PostProcessor implementation and makes it exportable as part of a Golang RPC server.
func (*PostProcessorServer) Cancel ¶
func (b *PostProcessorServer) Cancel(args *interface{}, reply *interface{}) error
func (*PostProcessorServer) ConfigSpec ¶
func (s *PostProcessorServer) ConfigSpec(_ interface{}, reply *ConfigSpecResponse) error
func (*PostProcessorServer) Configure ¶
func (p *PostProcessorServer) Configure(args *PostProcessorConfigureArgs, reply *interface{}) (err error)
func (*PostProcessorServer) PostProcess ¶
func (p *PostProcessorServer) PostProcess(streamId uint32, reply *PostProcessorProcessResponse) error
type ProgressTrackingClient ¶
type ProgressTrackingClient struct {
// contains filtered or unexported fields
}
func (*ProgressTrackingClient) Close ¶
func (u *ProgressTrackingClient) Close() error
type ProgressTrackingServer ¶
type ProgressTrackingServer struct {
// contains filtered or unexported fields
}
func (*ProgressTrackingServer) Add ¶
func (t *ProgressTrackingServer) Add(size int, _ *interface{}) error
func (*ProgressTrackingServer) Close ¶
func (t *ProgressTrackingServer) Close(_, _ *interface{}) error
type ProvisionerPrepareArgs ¶
type ProvisionerPrepareArgs struct {
Configs []interface{}
}
type ProvisionerServer ¶
type ProvisionerServer struct {
// contains filtered or unexported fields
}
ProvisionerServer wraps a packersdk.Provisioner implementation and makes it exportable as part of a Golang RPC server.
func (*ProvisionerServer) Cancel ¶
func (p *ProvisionerServer) Cancel(args *interface{}, reply *interface{}) error
func (*ProvisionerServer) ConfigSpec ¶
func (s *ProvisionerServer) ConfigSpec(_ interface{}, reply *ConfigSpecResponse) error
func (*ProvisionerServer) Prepare ¶
func (p *ProvisionerServer) Prepare(args *ProvisionerPrepareArgs, reply *interface{}) error
func (*ProvisionerServer) Provision ¶
func (p *ProvisionerServer) Provision(args *ProvisionerProvisionArgs, reply *interface{}) error
type Spec ¶ added in v0.6.0
type Spec struct {
// Types that are assignable to Block:
//
// *Spec_Object
// *Spec_Attr
// *Spec_BlockValue
// *Spec_BlockList
Block isSpec_Block `protobuf_oneof:"block"`
// contains filtered or unexported fields
}
A Spec is any kind of object that can convert losslessly to any of the hcldec.Spec types.
func ToProto ¶ added in v0.6.0
ToProto converts a hcldec.Spec to a protobuf-serialisable equivalent.
This can then be used for gRPC communication over-the-wire for Packer plugins.
func (*Spec) Descriptor
deprecated
added in
v0.6.0
func (*Spec) GetBlockList ¶ added in v0.6.0
func (*Spec) GetBlockValue ¶ added in v0.6.0
func (*Spec) ProtoMessage ¶ added in v0.6.0
func (*Spec) ProtoMessage()
func (*Spec) ProtoReflect ¶ added in v0.6.0
func (x *Spec) ProtoReflect() protoreflect.Message
type Spec_Attr ¶ added in v0.6.0
type Spec_Attr struct {
Attr *Attr `protobuf:"bytes,2,opt,name=attr,proto3,oneof"`
}
type Spec_BlockList ¶ added in v0.6.0
type Spec_BlockList struct {
BlockList *BlockList `protobuf:"bytes,4,opt,name=block_list,json=blockList,proto3,oneof"`
}
type Spec_BlockValue ¶ added in v0.6.0
type Spec_BlockValue struct {
BlockValue *Block `protobuf:"bytes,3,opt,name=block_value,json=blockValue,proto3,oneof"`
}
type Spec_Object ¶ added in v0.6.0
type Spec_Object struct {
Object *Object `protobuf:"bytes,1,opt,name=object,proto3,oneof"`
}
type TrackProgressParameters ¶
type Ui ¶
type Ui struct {
// contains filtered or unexported fields
}
An implementation of packersdk.Ui where the Ui is actually executed over an RPC connection.
func (*Ui) ConfigSpec ¶
func (p *Ui) ConfigSpec() hcldec.ObjectSpec
func (*Ui) TrackProgress ¶
func (u *Ui) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) io.ReadCloser
TrackProgress starts a pair of ProgressTrackingClient and ProgressProgressTrackingServer that will send the size of each read bytes of stream. In order to track an operation on the terminal side.
type UiMachineArgs ¶
The arguments sent to Ui.Machine
type UiServer ¶
type UiServer struct {
// contains filtered or unexported fields
}
UiServer wraps a packersdk.Ui implementation and makes it exportable as part of a Golang RPC server.
func (*UiServer) Machine ¶
func (u *UiServer) Machine(args *UiMachineArgs, reply *interface{}) error
func (*UiServer) NewTrackProgress ¶
func (ui *UiServer) NewTrackProgress(pl *TrackProgressParameters, reply *string) error