06ad983541
This adds a ReadLocations RPC function to the engine interface, alongside the singular ReadLocation. The plural function takes a single token that represents a module or class and we will then return all of the module or class (static) properties that are currently known.
301 lines
11 KiB
Go
301 lines
11 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 ""
|
|
}
|
|
|
|
type ReadLocationsRequest struct {
|
|
Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"`
|
|
}
|
|
|
|
func (m *ReadLocationsRequest) Reset() { *m = ReadLocationsRequest{} }
|
|
func (m *ReadLocationsRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*ReadLocationsRequest) ProtoMessage() {}
|
|
func (*ReadLocationsRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} }
|
|
|
|
func (m *ReadLocationsRequest) GetToken() string {
|
|
if m != nil {
|
|
return m.Token
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type ReadLocationsResponse struct {
|
|
Properties *google_protobuf.Struct `protobuf:"bytes,1,opt,name=properties" json:"properties,omitempty"`
|
|
}
|
|
|
|
func (m *ReadLocationsResponse) Reset() { *m = ReadLocationsResponse{} }
|
|
func (m *ReadLocationsResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*ReadLocationsResponse) ProtoMessage() {}
|
|
func (*ReadLocationsResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} }
|
|
|
|
func (m *ReadLocationsResponse) GetProperties() *google_protobuf.Struct {
|
|
if m != nil {
|
|
return m.Properties
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*LogRequest)(nil), "lumirpc.LogRequest")
|
|
proto.RegisterType((*ReadLocationRequest)(nil), "lumirpc.ReadLocationRequest")
|
|
proto.RegisterType((*ReadLocationsRequest)(nil), "lumirpc.ReadLocationsRequest")
|
|
proto.RegisterType((*ReadLocationsResponse)(nil), "lumirpc.ReadLocationsResponse")
|
|
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)
|
|
// ReadLocations reads a list of static or module variables from a single parent token.
|
|
ReadLocations(ctx context.Context, in *ReadLocationsRequest, opts ...grpc.CallOption) (*ReadLocationsResponse, 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
|
|
}
|
|
|
|
func (c *engineClient) ReadLocations(ctx context.Context, in *ReadLocationsRequest, opts ...grpc.CallOption) (*ReadLocationsResponse, error) {
|
|
out := new(ReadLocationsResponse)
|
|
err := grpc.Invoke(ctx, "/lumirpc.Engine/ReadLocations", 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)
|
|
// ReadLocations reads a list of static or module variables from a single parent token.
|
|
ReadLocations(context.Context, *ReadLocationsRequest) (*ReadLocationsResponse, 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)
|
|
}
|
|
|
|
func _Engine_ReadLocations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ReadLocationsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(EngineServer).ReadLocations(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/lumirpc.Engine/ReadLocations",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(EngineServer).ReadLocations(ctx, req.(*ReadLocationsRequest))
|
|
}
|
|
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,
|
|
},
|
|
{
|
|
MethodName: "ReadLocations",
|
|
Handler: _Engine_ReadLocations_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "engine.proto",
|
|
}
|
|
|
|
func init() { proto.RegisterFile("engine.proto", fileDescriptor1) }
|
|
|
|
var fileDescriptor1 = []byte{
|
|
// 348 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x7c, 0x91, 0xdd, 0x4e, 0xf2, 0x40,
|
|
0x10, 0x86, 0x5b, 0xf8, 0xf8, 0x1b, 0xf8, 0x4c, 0xb3, 0xa0, 0x92, 0x8a, 0x86, 0xf4, 0x88, 0xa8,
|
|
0x29, 0x06, 0x4d, 0x4c, 0x3c, 0xd3, 0x58, 0x08, 0x49, 0x03, 0x64, 0x89, 0x3f, 0xa7, 0x05, 0xc7,
|
|
0x4d, 0x23, 0x74, 0x6b, 0x77, 0x6b, 0xc2, 0x9d, 0x7a, 0x39, 0x86, 0x96, 0x92, 0x8a, 0xd5, 0xc3,
|
|
0xed, 0xfb, 0xcc, 0x4c, 0xe7, 0x19, 0xa8, 0xa1, 0xc7, 0x5c, 0x0f, 0x4d, 0x3f, 0xe0, 0x92, 0x93,
|
|
0xd2, 0x22, 0x5c, 0xba, 0x81, 0x3f, 0xd7, 0x8f, 0x18, 0xe7, 0x6c, 0x81, 0xdd, 0xe8, 0xf3, 0x2c,
|
|
0x7c, 0xed, 0xe2, 0xd2, 0x97, 0xab, 0x98, 0xd2, 0x5b, 0xbb, 0xa1, 0x90, 0x41, 0x38, 0x97, 0x71,
|
|
0x6a, 0x3c, 0x03, 0xd8, 0x9c, 0x51, 0x7c, 0x0f, 0x51, 0x48, 0x72, 0x01, 0x65, 0x81, 0x1f, 0x18,
|
|
0xb8, 0x72, 0xd5, 0x54, 0xdb, 0x6a, 0x67, 0xaf, 0xd7, 0x30, 0x37, 0x43, 0x4c, 0x9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