This changes a few things about "components": * Rename what was previously ExternalResource to CustomResource, and all of the related fields and parameters that this implies. This just seems like a much nicer and expected name for what these represent. I realize I am stealing a name we had thought about using elsewhere, but this seems like an appropriate use. * Introduce ComponentResource, to make initializing resources that merely aggregate other resources easier to do correctly. * Add a withParent and parentScope concept to Resource, to make allocating children less error-prone. Now there's no need to explicitly adopt children as they are allocated; instead, any children allocated as part of the withParent callback will auto-parent to the resource provided. This is used by ComponentResource's initialization function to make initialization easier, including the distinction between inputs and outputs.
406 lines
14 KiB
Go
406 lines
14 KiB
Go
// Code generated by protoc-gen-go.
|
|
// source: languages.proto
|
|
// DO NOT EDIT!
|
|
|
|
package pulumirpc
|
|
|
|
import proto "github.com/golang/protobuf/proto"
|
|
import fmt "fmt"
|
|
import math "math"
|
|
import google_protobuf "github.com/golang/protobuf/ptypes/struct"
|
|
|
|
import (
|
|
context "golang.org/x/net/context"
|
|
grpc "google.golang.org/grpc"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// RunRequest asks the interpreter to execute a program.
|
|
type RunRequest struct {
|
|
Pwd string `protobuf:"bytes,1,opt,name=pwd" json:"pwd,omitempty"`
|
|
Program string `protobuf:"bytes,2,opt,name=program" json:"program,omitempty"`
|
|
Args []string `protobuf:"bytes,3,rep,name=args" json:"args,omitempty"`
|
|
Config map[string]string `protobuf:"bytes,4,rep,name=config" json:"config,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
|
|
DryRun bool `protobuf:"varint,5,opt,name=dryRun" json:"dryRun,omitempty"`
|
|
Parallel int32 `protobuf:"varint,6,opt,name=parallel" json:"parallel,omitempty"`
|
|
}
|
|
|
|
func (m *RunRequest) Reset() { *m = RunRequest{} }
|
|
func (m *RunRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*RunRequest) ProtoMessage() {}
|
|
func (*RunRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} }
|
|
|
|
func (m *RunRequest) GetPwd() string {
|
|
if m != nil {
|
|
return m.Pwd
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *RunRequest) GetProgram() string {
|
|
if m != nil {
|
|
return m.Program
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *RunRequest) GetArgs() []string {
|
|
if m != nil {
|
|
return m.Args
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *RunRequest) GetConfig() map[string]string {
|
|
if m != nil {
|
|
return m.Config
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *RunRequest) GetDryRun() bool {
|
|
if m != nil {
|
|
return m.DryRun
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (m *RunRequest) GetParallel() int32 {
|
|
if m != nil {
|
|
return m.Parallel
|
|
}
|
|
return 0
|
|
}
|
|
|
|
// RunResponse is the response back from the interpreter/source back to the monitor.
|
|
type RunResponse struct {
|
|
Error string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"`
|
|
}
|
|
|
|
func (m *RunResponse) Reset() { *m = RunResponse{} }
|
|
func (m *RunResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*RunResponse) ProtoMessage() {}
|
|
func (*RunResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} }
|
|
|
|
func (m *RunResponse) GetError() string {
|
|
if m != nil {
|
|
return m.Error
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// NewResourceRequest contains information about a resource object that was newly allocated.
|
|
type NewResourceRequest struct {
|
|
Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"`
|
|
Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
|
|
Children []string `protobuf:"bytes,3,rep,name=children" json:"children,omitempty"`
|
|
Custom bool `protobuf:"varint,4,opt,name=custom" json:"custom,omitempty"`
|
|
Object *google_protobuf.Struct `protobuf:"bytes,5,opt,name=object" json:"object,omitempty"`
|
|
}
|
|
|
|
func (m *NewResourceRequest) Reset() { *m = NewResourceRequest{} }
|
|
func (m *NewResourceRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*NewResourceRequest) ProtoMessage() {}
|
|
func (*NewResourceRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} }
|
|
|
|
func (m *NewResourceRequest) GetType() string {
|
|
if m != nil {
|
|
return m.Type
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *NewResourceRequest) GetName() string {
|
|
if m != nil {
|
|
return m.Name
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *NewResourceRequest) GetChildren() []string {
|
|
if m != nil {
|
|
return m.Children
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *NewResourceRequest) GetCustom() bool {
|
|
if m != nil {
|
|
return m.Custom
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (m *NewResourceRequest) GetObject() *google_protobuf.Struct {
|
|
if m != nil {
|
|
return m.Object
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// NewResourceResponse reflects back the properties initialized during creation, if applicable.
|
|
type NewResourceResponse struct {
|
|
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
|
|
Urn string `protobuf:"bytes,2,opt,name=urn" json:"urn,omitempty"`
|
|
Object *google_protobuf.Struct `protobuf:"bytes,3,opt,name=object" json:"object,omitempty"`
|
|
Stable bool `protobuf:"varint,4,opt,name=stable" json:"stable,omitempty"`
|
|
Stables []string `protobuf:"bytes,5,rep,name=stables" json:"stables,omitempty"`
|
|
}
|
|
|
|
func (m *NewResourceResponse) Reset() { *m = NewResourceResponse{} }
|
|
func (m *NewResourceResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*NewResourceResponse) ProtoMessage() {}
|
|
func (*NewResourceResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} }
|
|
|
|
func (m *NewResourceResponse) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *NewResourceResponse) GetUrn() string {
|
|
if m != nil {
|
|
return m.Urn
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *NewResourceResponse) GetObject() *google_protobuf.Struct {
|
|
if m != nil {
|
|
return m.Object
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *NewResourceResponse) GetStable() bool {
|
|
if m != nil {
|
|
return m.Stable
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (m *NewResourceResponse) GetStables() []string {
|
|
if m != nil {
|
|
return m.Stables
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*RunRequest)(nil), "pulumirpc.RunRequest")
|
|
proto.RegisterType((*RunResponse)(nil), "pulumirpc.RunResponse")
|
|
proto.RegisterType((*NewResourceRequest)(nil), "pulumirpc.NewResourceRequest")
|
|
proto.RegisterType((*NewResourceResponse)(nil), "pulumirpc.NewResourceResponse")
|
|
}
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ context.Context
|
|
var _ grpc.ClientConn
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
const _ = grpc.SupportPackageIsVersion4
|
|
|
|
// Client API for LanguageRuntime service
|
|
|
|
type LanguageRuntimeClient interface {
|
|
Run(ctx context.Context, in *RunRequest, opts ...grpc.CallOption) (*RunResponse, error)
|
|
}
|
|
|
|
type languageRuntimeClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewLanguageRuntimeClient(cc *grpc.ClientConn) LanguageRuntimeClient {
|
|
return &languageRuntimeClient{cc}
|
|
}
|
|
|
|
func (c *languageRuntimeClient) Run(ctx context.Context, in *RunRequest, opts ...grpc.CallOption) (*RunResponse, error) {
|
|
out := new(RunResponse)
|
|
err := grpc.Invoke(ctx, "/pulumirpc.LanguageRuntime/Run", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// Server API for LanguageRuntime service
|
|
|
|
type LanguageRuntimeServer interface {
|
|
Run(context.Context, *RunRequest) (*RunResponse, error)
|
|
}
|
|
|
|
func RegisterLanguageRuntimeServer(s *grpc.Server, srv LanguageRuntimeServer) {
|
|
s.RegisterService(&_LanguageRuntime_serviceDesc, srv)
|
|
}
|
|
|
|
func _LanguageRuntime_Run_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(RunRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(LanguageRuntimeServer).Run(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/pulumirpc.LanguageRuntime/Run",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(LanguageRuntimeServer).Run(ctx, req.(*RunRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _LanguageRuntime_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "pulumirpc.LanguageRuntime",
|
|
HandlerType: (*LanguageRuntimeServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Run",
|
|
Handler: _LanguageRuntime_Run_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "languages.proto",
|
|
}
|
|
|
|
// Client API for ResourceMonitor service
|
|
|
|
type ResourceMonitorClient interface {
|
|
Invoke(ctx context.Context, in *InvokeRequest, opts ...grpc.CallOption) (*InvokeResponse, error)
|
|
NewResource(ctx context.Context, in *NewResourceRequest, opts ...grpc.CallOption) (*NewResourceResponse, error)
|
|
}
|
|
|
|
type resourceMonitorClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewResourceMonitorClient(cc *grpc.ClientConn) ResourceMonitorClient {
|
|
return &resourceMonitorClient{cc}
|
|
}
|
|
|
|
func (c *resourceMonitorClient) Invoke(ctx context.Context, in *InvokeRequest, opts ...grpc.CallOption) (*InvokeResponse, error) {
|
|
out := new(InvokeResponse)
|
|
err := grpc.Invoke(ctx, "/pulumirpc.ResourceMonitor/Invoke", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *resourceMonitorClient) NewResource(ctx context.Context, in *NewResourceRequest, opts ...grpc.CallOption) (*NewResourceResponse, error) {
|
|
out := new(NewResourceResponse)
|
|
err := grpc.Invoke(ctx, "/pulumirpc.ResourceMonitor/NewResource", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// Server API for ResourceMonitor service
|
|
|
|
type ResourceMonitorServer interface {
|
|
Invoke(context.Context, *InvokeRequest) (*InvokeResponse, error)
|
|
NewResource(context.Context, *NewResourceRequest) (*NewResourceResponse, error)
|
|
}
|
|
|
|
func RegisterResourceMonitorServer(s *grpc.Server, srv ResourceMonitorServer) {
|
|
s.RegisterService(&_ResourceMonitor_serviceDesc, srv)
|
|
}
|
|
|
|
func _ResourceMonitor_Invoke_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(InvokeRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ResourceMonitorServer).Invoke(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/pulumirpc.ResourceMonitor/Invoke",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ResourceMonitorServer).Invoke(ctx, req.(*InvokeRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ResourceMonitor_NewResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(NewResourceRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ResourceMonitorServer).NewResource(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/pulumirpc.ResourceMonitor/NewResource",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ResourceMonitorServer).NewResource(ctx, req.(*NewResourceRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _ResourceMonitor_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "pulumirpc.ResourceMonitor",
|
|
HandlerType: (*ResourceMonitorServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Invoke",
|
|
Handler: _ResourceMonitor_Invoke_Handler,
|
|
},
|
|
{
|
|
MethodName: "NewResource",
|
|
Handler: _ResourceMonitor_NewResource_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "languages.proto",
|
|
}
|
|
|
|
func init() { proto.RegisterFile("languages.proto", fileDescriptor2) }
|
|
|
|
var fileDescriptor2 = []byte{
|
|
// 481 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x8c, 0x52, 0x4d, 0x6f, 0xd3, 0x40,
|
|
0x10, 0xc5, 0x71, 0x62, 0x9a, 0x89, 0xd4, 0xa0, 0x05, 0xca, 0x62, 0x01, 0x0a, 0xe1, 0x92, 0x93,
|
|
0x23, 0x05, 0x09, 0x51, 0x2e, 0x1c, 0x10, 0x87, 0x4a, 0xd0, 0xc3, 0xf2, 0x0b, 0x1c, 0x67, 0x6a,
|
|
0x4c, 0x9c, 0x5d, 0xb3, 0x1f, 0xa9, 0xf2, 0x57, 0xb8, 0xc1, 0x8f, 0xe4, 0x8c, 0xf6, 0x2b, 0x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