pulumi/sdk/go/pkg/lumirpc/engine.pb.go
joeduffy d7093188f0 Introduce an interface to read config
This change adds an engine gRPC interface, and associated implementation,
so that plugins may do interesting things that require "phoning home".
Previously, the engine would fire up plugins and talk to them directly,
but there was no way for a plugin to ask the engine to do anything.

The motivation here is so that plugins can read evaluator state, such
as config information, but this change also allows richer logging
functionality than previously possible.  We will still auto-log any
stdout/stderr writes; however, explicit errors, warnings, informational,
and even debug messages may be written over the Log API.
2017-06-20 19:45:07 -07:00

229 lines
8 KiB
Go

// Code generated by protoc-gen-go.
// source: engine.proto
// DO NOT EDIT!
package lumirpc
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import google_protobuf1 "github.com/golang/protobuf/ptypes/empty"
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
// LogSeverity is the severity level of a log message. Errors are fatal; all others are informational.
type LogSeverity int32
const (
LogSeverity_DEBUG LogSeverity = 0
LogSeverity_INFO LogSeverity = 1
LogSeverity_WARNING LogSeverity = 2
LogSeverity_ERROR LogSeverity = 3
)
var LogSeverity_name = map[int32]string{
0: "DEBUG",
1: "INFO",
2: "WARNING",
3: "ERROR",
}
var LogSeverity_value = map[string]int32{
"DEBUG": 0,
"INFO": 1,
"WARNING": 2,
"ERROR": 3,
}
func (x LogSeverity) String() string {
return proto.EnumName(LogSeverity_name, int32(x))
}
func (LogSeverity) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0} }
type LogRequest struct {
Severity LogSeverity `protobuf:"varint,1,opt,name=severity,enum=lumirpc.LogSeverity" json:"severity,omitempty"`
Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"`
}
func (m *LogRequest) Reset() { *m = LogRequest{} }
func (m *LogRequest) String() string { return proto.CompactTextString(m) }
func (*LogRequest) ProtoMessage() {}
func (*LogRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} }
func (m *LogRequest) GetSeverity() LogSeverity {
if m != nil {
return m.Severity
}
return LogSeverity_DEBUG
}
func (m *LogRequest) GetMessage() string {
if m != nil {
return m.Message
}
return ""
}
type ReadLocationRequest struct {
Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"`
}
func (m *ReadLocationRequest) Reset() { *m = ReadLocationRequest{} }
func (m *ReadLocationRequest) String() string { return proto.CompactTextString(m) }
func (*ReadLocationRequest) ProtoMessage() {}
func (*ReadLocationRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} }
func (m *ReadLocationRequest) GetToken() string {
if m != nil {
return m.Token
}
return ""
}
func init() {
proto.RegisterType((*LogRequest)(nil), "lumirpc.LogRequest")
proto.RegisterType((*ReadLocationRequest)(nil), "lumirpc.ReadLocationRequest")
proto.RegisterEnum("lumirpc.LogSeverity", LogSeverity_name, LogSeverity_value)
}
// 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 Engine service
type EngineClient interface {
// Log logs a global message in the engine, including errors and warnings.
Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error)
// ReadLocation reads the value from a location identified by a token in the current program.
ReadLocation(ctx context.Context, in *ReadLocationRequest, opts ...grpc.CallOption) (*google_protobuf.Value, error)
}
type engineClient struct {
cc *grpc.ClientConn
}
func NewEngineClient(cc *grpc.ClientConn) EngineClient {
return &engineClient{cc}
}
func (c *engineClient) Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) {
out := new(google_protobuf1.Empty)
err := grpc.Invoke(ctx, "/lumirpc.Engine/Log", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *engineClient) ReadLocation(ctx context.Context, in *ReadLocationRequest, opts ...grpc.CallOption) (*google_protobuf.Value, error) {
out := new(google_protobuf.Value)
err := grpc.Invoke(ctx, "/lumirpc.Engine/ReadLocation", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Engine service
type EngineServer interface {
// Log logs a global message in the engine, including errors and warnings.
Log(context.Context, *LogRequest) (*google_protobuf1.Empty, error)
// ReadLocation reads the value from a location identified by a token in the current program.
ReadLocation(context.Context, *ReadLocationRequest) (*google_protobuf.Value, error)
}
func RegisterEngineServer(s *grpc.Server, srv EngineServer) {
s.RegisterService(&_Engine_serviceDesc, srv)
}
func _Engine_Log_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LogRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EngineServer).Log(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/lumirpc.Engine/Log",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EngineServer).Log(ctx, req.(*LogRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Engine_ReadLocation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReadLocationRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EngineServer).ReadLocation(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/lumirpc.Engine/ReadLocation",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EngineServer).ReadLocation(ctx, req.(*ReadLocationRequest))
}
return interceptor(ctx, in, info, handler)
}
var _Engine_serviceDesc = grpc.ServiceDesc{
ServiceName: "lumirpc.Engine",
HandlerType: (*EngineServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Log",
Handler: _Engine_Log_Handler,
},
{
MethodName: "ReadLocation",
Handler: _Engine_ReadLocation_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "engine.proto",
}
func init() { proto.RegisterFile("engine.proto", fileDescriptor1) }
var fileDescriptor1 = []byte{
// 287 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x6c, 0x90, 0x4f, 0x4b, 0xc3, 0x40,
0x10, 0xc5, 0x93, 0xd6, 0x36, 0xcd, 0xb4, 0x48, 0xd8, 0x16, 0x09, 0xb1, 0x87, 0x92, 0x53, 0x51,
0xd8, 0x4a, 0xf5, 0xe4, 0x4d, 0x31, 0x2d, 0x85, 0x90, 0xc2, 0x8a, 0x7f, 0xae, 0x69, 0x1c, 0x97,
0x60, 0x92, 0x8d, 0xc9, 0x46, 0xe8, 0x17, 0xf0, 0x73, 0x4b, 0xf3, 0xa7, 0x04, 0xe9, 0x71, 0xe6,
0xbd, 0x7d, 0x6f, 0xf6, 0x07, 0x23, 0x4c, 0x78, 0x98, 0x20, 0x4d, 0x33, 0x21, 0x05, 0xd1, 0xa2,
0x22, 0x0e, 0xb3, 0x34, 0xb0, 0x2e, 0xb9, 0x10, 0x3c, 0xc2, 0x45, 0xb9, 0xde, 0x15, 0x9f, 0x0b,
0x8c, 0x53, 0xb9, 0xaf, 0x5c, 0xd6, 0xf4, 0xbf, 0x98, 0xcb, 0xac, 0x08, 0x64, 0xa5, 0xda, 0xef,
0x00, 0xae, 0xe0, 0x0c, 0xbf, 0x0b, 0xcc, 0x25, 0xb9, 0x81, 0x41, 0x8e, 0x3f, 0x98, 0x85, 0x72,
0x6f, 0xaa, 0x33, 0x75, 0x7e, 0xbe, 0x9c, 0xd0, 0xba, 0x84, 0xba, 0x82, 0x3f, 0xd7, 0x1a, 0x3b,
0xba, 0x88, 0x09, 0x5a, 0x8c, 0x79, 0xee, 0x73, 0x34, 0x3b, 0x33, 0x75, 0xae, 0xb3, 0x66, 0xb4,
0xaf, 0x61, 0xcc, 0xd0, 0xff, 0x70, 0x45, 0xe0, 0xcb, 0x50, 0x24, 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