diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..8ab3ebbb91 --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +.PHONY: all proto + +all: proto + +proto: + protoc --go_out=plugins=grpc:../../../ -I. proto/*.proto diff --git a/README.md b/README.md index e69de29bb2..4603c5dc8e 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,9 @@ +# Tilt + +## Prereqs +- `make` +- **[go 1.10](https://golang.org/dl/)** +- **protobuf 3.2**: `brew install protobuf` or install `protoc-3.2.0-[your_OS]` [from Github](https://github.com/google/protobuf/releases?after=v3.2.1) + +## Developing +Run `make` from the root of the repo to generate all protobuf files. diff --git a/proto/daemon.pb.go b/proto/daemon.pb.go new file mode 100644 index 0000000000..2360cdffef --- /dev/null +++ b/proto/daemon.pb.go @@ -0,0 +1,155 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: proto/daemon.proto + +/* +Package proto is a generated protocol buffer package. + +It is generated from these files: + proto/daemon.proto + +It has these top-level messages: + Service + CreateServiceReply +*/ +package proto + +import proto1 "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto1.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto1.ProtoPackageIsVersion2 // please upgrade the proto package + +// Q: Is this sufficient? +// Q: How will we uniquely identify a service? +// ie, what's a service's "name"? +type Service struct { + K8SYaml string `protobuf:"bytes,1,opt,name=k8s_yaml,json=k8sYaml" json:"k8s_yaml,omitempty"` +} + +func (m *Service) Reset() { *m = Service{} } +func (m *Service) String() string { return proto1.CompactTextString(m) } +func (*Service) ProtoMessage() {} +func (*Service) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Service) GetK8SYaml() string { + if m != nil { + return m.K8SYaml + } + return "" +} + +type CreateServiceReply struct { +} + +func (m *CreateServiceReply) Reset() { *m = CreateServiceReply{} } +func (m *CreateServiceReply) String() string { return proto1.CompactTextString(m) } +func (*CreateServiceReply) ProtoMessage() {} +func (*CreateServiceReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func init() { + proto1.RegisterType((*Service)(nil), "daemon.Service") + proto1.RegisterType((*CreateServiceReply)(nil), "daemon.CreateServiceReply") +} + +// 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 Daemon service + +type DaemonClient interface { + CreateService(ctx context.Context, in *Service, opts ...grpc.CallOption) (*CreateServiceReply, error) +} + +type daemonClient struct { + cc *grpc.ClientConn +} + +func NewDaemonClient(cc *grpc.ClientConn) DaemonClient { + return &daemonClient{cc} +} + +func (c *daemonClient) CreateService(ctx context.Context, in *Service, opts ...grpc.CallOption) (*CreateServiceReply, error) { + out := new(CreateServiceReply) + err := grpc.Invoke(ctx, "/daemon.Daemon/CreateService", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Daemon service + +type DaemonServer interface { + CreateService(context.Context, *Service) (*CreateServiceReply, error) +} + +func RegisterDaemonServer(s *grpc.Server, srv DaemonServer) { + s.RegisterService(&_Daemon_serviceDesc, srv) +} + +func _Daemon_CreateService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Service) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DaemonServer).CreateService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/daemon.Daemon/CreateService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DaemonServer).CreateService(ctx, req.(*Service)) + } + return interceptor(ctx, in, info, handler) +} + +var _Daemon_serviceDesc = grpc.ServiceDesc{ + ServiceName: "daemon.Daemon", + HandlerType: (*DaemonServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateService", + Handler: _Daemon_CreateService_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/daemon.proto", +} + +func init() { proto1.RegisterFile("proto/daemon.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 169 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2a, 0x28, 0xca, 0x2f, + 0xc9, 0xd7, 0x4f, 0x49, 0x4c, 0xcd, 0xcd, 0xcf, 0xd3, 0x03, 0x73, 0x84, 0xd8, 0x20, 0x3c, 0x25, + 0x15, 0x2e, 0xf6, 0xe0, 0xd4, 0xa2, 0xb2, 0xcc, 0xe4, 0x54, 0x21, 0x49, 0x2e, 0x8e, 0x6c, 0x8b, + 0xe2, 0xf8, 0xca, 0xc4, 0xdc, 0x1c, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0xf6, 0x6c, 0x8b, + 0xe2, 0xc8, 0xc4, 0xdc, 0x1c, 0x25, 0x11, 0x2e, 0x21, 0xe7, 0xa2, 0xd4, 0xc4, 0x92, 0x54, 0xa8, + 0xda, 0xa0, 0xd4, 0x82, 0x9c, 0x4a, 0x23, 0x0f, 0x2e, 0x36, 0x17, 0xb0, 0x29, 0x42, 0x76, 0x5c, + 0xbc, 0x28, 0xf2, 0x42, 0xfc, 0x7a, 0x50, 0xdb, 0xa0, 0x02, 0x52, 0x52, 0x30, 0x01, 0x4c, 0x73, + 0x94, 0x18, 0x9c, 0xb4, 0xa2, 0x34, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, + 0xf5, 0xcb, 0x33, 0xf3, 0x52, 0x72, 0x33, 0x73, 0x72, 0x52, 0xf3, 0xd2, 0xf5, 0x4b, 0x32, 0x73, + 0x4a, 0xf4, 0x21, 0xee, 0xb7, 0x06, 0x53, 0x49, 0x6c, 0x60, 0xca, 0x18, 0x10, 0x00, 0x00, 0xff, + 0xff, 0xcc, 0x70, 0x03, 0xa5, 0xd6, 0x00, 0x00, 0x00, +}