feat: skeleton inventory service
This commit is contained in:
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
protoc -I ../../ protos/inventory.proto --go_out=plugins=grpc:.
|
||||
@@ -0,0 +1,11 @@
|
||||
module github.com/spotify/backstage/inventory
|
||||
|
||||
go 1.12
|
||||
|
||||
require (
|
||||
github.com/golang/protobuf v1.3.2
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 // indirect
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 // indirect
|
||||
google.golang.org/grpc v1.27.0
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc // indirect
|
||||
)
|
||||
@@ -0,0 +1,46 @@
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE=
|
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg=
|
||||
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
@@ -0,0 +1,31 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
"net"
|
||||
|
||||
pb "github.com/spotify/backstage/inventory/protos"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
const (
|
||||
port = ":50051"
|
||||
)
|
||||
|
||||
type inventoryServer struct {
|
||||
}
|
||||
|
||||
func (s *inventoryServer) GetEntity(ctx context.Context, req *pb.GetEntityRequest) (*pb.GetEntityReply, error) {
|
||||
return &pb.GetEntityReply{}, nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
lis, err := net.Listen("tcp", port)
|
||||
if err != nil {
|
||||
log.Fatalf("failed to listen: %v", err)
|
||||
}
|
||||
grpcServer := grpc.NewServer()
|
||||
pb.RegisterInventoryServer(grpcServer, &inventoryServer{})
|
||||
grpcServer.Serve(lis)
|
||||
}
|
||||
@@ -0,0 +1,324 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: protos/inventory.proto
|
||||
|
||||
package spotify_backstage_inventory_v1alpha1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.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 _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
type GetEntityRequest struct {
|
||||
Entity *Entity `protobuf:"bytes,1,opt,name=entity,proto3" json:"entity,omitempty"`
|
||||
IncludeFacts []string `protobuf:"bytes,2,rep,name=include_facts,json=includeFacts,proto3" json:"include_facts,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *GetEntityRequest) Reset() { *m = GetEntityRequest{} }
|
||||
func (m *GetEntityRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetEntityRequest) ProtoMessage() {}
|
||||
func (*GetEntityRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1a8706afd37ce83a, []int{0}
|
||||
}
|
||||
|
||||
func (m *GetEntityRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetEntityRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *GetEntityRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_GetEntityRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *GetEntityRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_GetEntityRequest.Merge(m, src)
|
||||
}
|
||||
func (m *GetEntityRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_GetEntityRequest.Size(m)
|
||||
}
|
||||
func (m *GetEntityRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_GetEntityRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_GetEntityRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *GetEntityRequest) GetEntity() *Entity {
|
||||
if m != nil {
|
||||
return m.Entity
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *GetEntityRequest) GetIncludeFacts() []string {
|
||||
if m != nil {
|
||||
return m.IncludeFacts
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetEntityReply struct {
|
||||
Entity *Entity `protobuf:"bytes,1,opt,name=entity,proto3" json:"entity,omitempty"`
|
||||
Facts []*Fact `protobuf:"bytes,2,rep,name=facts,proto3" json:"facts,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *GetEntityReply) Reset() { *m = GetEntityReply{} }
|
||||
func (m *GetEntityReply) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetEntityReply) ProtoMessage() {}
|
||||
func (*GetEntityReply) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1a8706afd37ce83a, []int{1}
|
||||
}
|
||||
|
||||
func (m *GetEntityReply) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetEntityReply.Unmarshal(m, b)
|
||||
}
|
||||
func (m *GetEntityReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_GetEntityReply.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *GetEntityReply) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_GetEntityReply.Merge(m, src)
|
||||
}
|
||||
func (m *GetEntityReply) XXX_Size() int {
|
||||
return xxx_messageInfo_GetEntityReply.Size(m)
|
||||
}
|
||||
func (m *GetEntityReply) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_GetEntityReply.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_GetEntityReply proto.InternalMessageInfo
|
||||
|
||||
func (m *GetEntityReply) GetEntity() *Entity {
|
||||
if m != nil {
|
||||
return m.Entity
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *GetEntityReply) GetFacts() []*Fact {
|
||||
if m != nil {
|
||||
return m.Facts
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Entity struct {
|
||||
Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"`
|
||||
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Entity) Reset() { *m = Entity{} }
|
||||
func (m *Entity) String() string { return proto.CompactTextString(m) }
|
||||
func (*Entity) ProtoMessage() {}
|
||||
func (*Entity) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1a8706afd37ce83a, []int{2}
|
||||
}
|
||||
|
||||
func (m *Entity) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Entity.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Entity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Entity.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Entity) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Entity.Merge(m, src)
|
||||
}
|
||||
func (m *Entity) XXX_Size() int {
|
||||
return xxx_messageInfo_Entity.Size(m)
|
||||
}
|
||||
func (m *Entity) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Entity.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Entity proto.InternalMessageInfo
|
||||
|
||||
func (m *Entity) GetKind() string {
|
||||
if m != nil {
|
||||
return m.Kind
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Entity) GetId() string {
|
||||
if m != nil {
|
||||
return m.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type Fact struct {
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Fact) Reset() { *m = Fact{} }
|
||||
func (m *Fact) String() string { return proto.CompactTextString(m) }
|
||||
func (*Fact) ProtoMessage() {}
|
||||
func (*Fact) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1a8706afd37ce83a, []int{3}
|
||||
}
|
||||
|
||||
func (m *Fact) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Fact.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Fact) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Fact.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Fact) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Fact.Merge(m, src)
|
||||
}
|
||||
func (m *Fact) XXX_Size() int {
|
||||
return xxx_messageInfo_Fact.Size(m)
|
||||
}
|
||||
func (m *Fact) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Fact.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Fact proto.InternalMessageInfo
|
||||
|
||||
func (m *Fact) GetName() string {
|
||||
if m != nil {
|
||||
return m.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Fact) GetValue() string {
|
||||
if m != nil {
|
||||
return m.Value
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*GetEntityRequest)(nil), "spotify.backstage.inventory.v1alpha1.GetEntityRequest")
|
||||
proto.RegisterType((*GetEntityReply)(nil), "spotify.backstage.inventory.v1alpha1.GetEntityReply")
|
||||
proto.RegisterType((*Entity)(nil), "spotify.backstage.inventory.v1alpha1.Entity")
|
||||
proto.RegisterType((*Fact)(nil), "spotify.backstage.inventory.v1alpha1.Fact")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("protos/inventory.proto", fileDescriptor_1a8706afd37ce83a) }
|
||||
|
||||
var fileDescriptor_1a8706afd37ce83a = []byte{
|
||||
// 273 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2b, 0x28, 0xca, 0x2f,
|
||||
0xc9, 0x2f, 0xd6, 0xcf, 0xcc, 0x2b, 0x4b, 0xcd, 0x2b, 0xc9, 0x2f, 0xaa, 0xd4, 0x03, 0x0b, 0x08,
|
||||
0xa9, 0x14, 0x17, 0xe4, 0x97, 0x64, 0xa6, 0x55, 0xea, 0x25, 0x25, 0x26, 0x67, 0x17, 0x97, 0x24,
|
||||
0xa6, 0xa7, 0xea, 0x21, 0x94, 0x94, 0x19, 0x26, 0xe6, 0x14, 0x64, 0x24, 0x1a, 0x2a, 0xd5, 0x72,
|
||||
0x09, 0xb8, 0xa7, 0x96, 0xb8, 0xe6, 0x95, 0x64, 0x96, 0x54, 0x06, 0xa5, 0x16, 0x96, 0xa6, 0x16,
|
||||
0x97, 0x08, 0xb9, 0x70, 0xb1, 0xa5, 0x82, 0x05, 0x24, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0x74,
|
||||
0xf4, 0x88, 0x31, 0x4a, 0x0f, 0x6a, 0x08, 0x54, 0xaf, 0x90, 0x32, 0x17, 0x6f, 0x66, 0x5e, 0x72,
|
||||
0x4e, 0x69, 0x4a, 0x6a, 0x7c, 0x5a, 0x62, 0x72, 0x49, 0xb1, 0x04, 0x93, 0x02, 0xb3, 0x06, 0x67,
|
||||
0x10, 0x0f, 0x54, 0xd0, 0x0d, 0x24, 0xa6, 0x34, 0x83, 0x91, 0x8b, 0x0f, 0xc9, 0xfe, 0x82, 0x9c,
|
||||
0x4a, 0x2a, 0xd9, 0xee, 0xc0, 0xc5, 0x8a, 0xb0, 0x95, 0xdb, 0x48, 0x8b, 0x38, 0x43, 0x40, 0x8e,
|
||||
0x0a, 0x82, 0x68, 0x54, 0xd2, 0xe1, 0x62, 0x83, 0x98, 0x29, 0x24, 0xc4, 0xc5, 0x92, 0x9d, 0x99,
|
||||
0x97, 0x02, 0x76, 0x0f, 0x67, 0x10, 0x98, 0x2d, 0xc4, 0xc7, 0xc5, 0x94, 0x99, 0x22, 0xc1, 0x04,
|
||||
0x16, 0x61, 0xca, 0x4c, 0x51, 0x32, 0xe0, 0x62, 0x01, 0x69, 0x06, 0xa9, 0xcd, 0x4b, 0xcc, 0x4d,
|
||||
0x85, 0xa9, 0x05, 0xb1, 0x85, 0x44, 0xb8, 0x58, 0xcb, 0x12, 0x73, 0x4a, 0x53, 0xa1, 0xca, 0x21,
|
||||
0x1c, 0xa3, 0x36, 0x46, 0x2e, 0x4e, 0x4f, 0x98, 0x13, 0x84, 0x2a, 0xb9, 0x38, 0xe1, 0xe1, 0x20,
|
||||
0x64, 0x46, 0x9c, 0x6b, 0xd1, 0x23, 0x4e, 0xca, 0x84, 0x64, 0x7d, 0x05, 0x39, 0x95, 0x49, 0x6c,
|
||||
0xe0, 0xf4, 0x62, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x66, 0x0d, 0x53, 0x49, 0x02, 0x00,
|
||||
0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ context.Context
|
||||
var _ grpc.ClientConnInterface
|
||||
|
||||
// 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.SupportPackageIsVersion6
|
||||
|
||||
// InventoryClient is the client API for Inventory service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type InventoryClient interface {
|
||||
GetEntity(ctx context.Context, in *GetEntityRequest, opts ...grpc.CallOption) (*GetEntityReply, error)
|
||||
}
|
||||
|
||||
type inventoryClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewInventoryClient(cc grpc.ClientConnInterface) InventoryClient {
|
||||
return &inventoryClient{cc}
|
||||
}
|
||||
|
||||
func (c *inventoryClient) GetEntity(ctx context.Context, in *GetEntityRequest, opts ...grpc.CallOption) (*GetEntityReply, error) {
|
||||
out := new(GetEntityReply)
|
||||
err := c.cc.Invoke(ctx, "/spotify.backstage.inventory.v1alpha1.Inventory/GetEntity", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// InventoryServer is the server API for Inventory service.
|
||||
type InventoryServer interface {
|
||||
GetEntity(context.Context, *GetEntityRequest) (*GetEntityReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedInventoryServer can be embedded to have forward compatible implementations.
|
||||
type UnimplementedInventoryServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedInventoryServer) GetEntity(ctx context.Context, req *GetEntityRequest) (*GetEntityReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetEntity not implemented")
|
||||
}
|
||||
|
||||
func RegisterInventoryServer(s *grpc.Server, srv InventoryServer) {
|
||||
s.RegisterService(&_Inventory_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _Inventory_GetEntity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetEntityRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(InventoryServer).GetEntity(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/spotify.backstage.inventory.v1alpha1.Inventory/GetEntity",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(InventoryServer).GetEntity(ctx, req.(*GetEntityRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Inventory_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "spotify.backstage.inventory.v1alpha1.Inventory",
|
||||
HandlerType: (*InventoryServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetEntity",
|
||||
Handler: _Inventory_GetEntity_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "protos/inventory.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user