Skip to content
Snippets Groups Projects
Commit 399a9731 authored by Pavel Antonov's avatar Pavel Antonov :asterisk:
Browse files

Merge branch 'feature/PRXS-2688-RefsLocales' into 'master'

Обновление References API: поддержка локализации контента

See merge request perxis/perxis-go!255
parents 15a713cd 87b92c5b
No related branches found
No related tags found
No related merge requests found
Showing
with 296 additions and 118 deletions
......@@ -32,7 +32,7 @@ func AccessLoggingMiddleware(logger *zap.Logger) Middleware {
}
}
func (m *accessLoggingMiddleware) Get(ctx context.Context, spaceId string, envId string, references []*references.Reference) (items []*items.Item, notfound []*references.Reference, err error) {
func (m *accessLoggingMiddleware) Get(ctx context.Context, spaceId string, envId string, references []*references.Reference, options ...*references.GetOptions) (items []*items.Item, notfound []*references.Reference, err error) {
begin := time.Now()
m.logger.Debug("Get.Request",
......@@ -40,9 +40,10 @@ func (m *accessLoggingMiddleware) Get(ctx context.Context, spaceId string, envId
zap.Reflect("spaceId", spaceId),
zap.Reflect("envId", envId),
zap.Reflect("references", references),
zap.Reflect("options", options),
)
items, notfound, err = m.next.Get(ctx, spaceId, envId, references)
items, notfound, err = m.next.Get(ctx, spaceId, envId, references, options...)
m.logger.Debug("Get.Response",
zap.Duration("time", time.Since(begin)),
......
......@@ -23,8 +23,8 @@ type encodeDecodeMiddleware struct {
colls collections.Collections
}
func (m *encodeDecodeMiddleware) Get(ctx context.Context, spaceId, envId string, refs []*references.Reference) (items []*items.Item, notfound []*references.Reference, err error) {
items, notfound, err = m.next.Get(ctx, spaceId, envId, refs)
func (m *encodeDecodeMiddleware) Get(ctx context.Context, spaceId, envId string, refs []*references.Reference, options ...*references.GetOptions) (items []*items.Item, notfound []*references.Reference, err error) {
items, notfound, err = m.next.Get(ctx, spaceId, envId, refs, options...)
if err == nil && len(items) > 0 {
for i, item := range items {
col, err := m.colls.Get(ctx, item.SpaceID, item.EnvID, item.CollectionID)
......
......@@ -30,14 +30,14 @@ func ErrorLoggingMiddleware(logger *zap.Logger) Middleware {
}
}
func (m *errorLoggingMiddleware) Get(ctx context.Context, spaceId string, envId string, references []*references.Reference) (items []*items.Item, notfound []*references.Reference, err error) {
func (m *errorLoggingMiddleware) Get(ctx context.Context, spaceId string, envId string, references []*references.Reference, options ...*references.GetOptions) (items []*items.Item, notfound []*references.Reference, err error) {
logger := m.logger
defer func() {
if err != nil {
logger.Warn("response error", zap.Error(err))
}
}()
return m.next.Get(ctx, spaceId, envId, references)
return m.next.Get(ctx, spaceId, envId, references, options...)
}
func (m *errorLoggingMiddleware) Publish(ctx context.Context, spaceId string, envId string, references []*references.Reference, recursive bool, force bool) (published []*references.Reference, notfound []*references.Reference, unpublished []*references.Reference, err error) {
......
......@@ -31,7 +31,7 @@ func RecoveringMiddleware(logger *zap.Logger) Middleware {
}
}
func (m *recoveringMiddleware) Get(ctx context.Context, spaceId string, envId string, references []*references.Reference) (items []*items.Item, notfound []*references.Reference, err error) {
func (m *recoveringMiddleware) Get(ctx context.Context, spaceId string, envId string, references []*references.Reference, options ...*references.GetOptions) (items []*items.Item, notfound []*references.Reference, err error) {
logger := m.logger
defer func() {
if r := recover(); r != nil {
......@@ -40,7 +40,7 @@ func (m *recoveringMiddleware) Get(ctx context.Context, spaceId string, envId st
}
}()
return m.next.Get(ctx, spaceId, envId, references)
return m.next.Get(ctx, spaceId, envId, references, options...)
}
func (m *recoveringMiddleware) Publish(ctx context.Context, spaceId string, envId string, references []*references.Reference, recursive bool, force bool) (published []*references.Reference, notfound []*references.Reference, unpublished []*references.Reference, err error) {
......
// Code generated by gowrap. DO NOT EDIT.
// template: ..\..\..\assets\templates\middleware\telemetry
// template: ../../../assets/templates/middleware/telemetry
// gowrap: http://github.com/hexdigest/gowrap
package middleware
//go:generate gowrap gen -p git.perx.ru/perxis/perxis-go/pkg/references -i References -t ..\..\..\assets\templates\middleware\telemetry -o telemetry_middleware.go -l ""
//go:generate gowrap gen -p git.perx.ru/perxis/perxis-go/pkg/references -i References -t ../../../assets/templates/middleware/telemetry -o telemetry_middleware.go -l ""
// source template: https://github.com/hexdigest/gowrap/blob/master/templates/opentelemetry
......@@ -50,7 +50,7 @@ func TelemetryMiddleware(base references.References, instance string, spanDecora
}
// Get implements references.References
func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, envId string, references []*references.Reference) (items []*items.Item, notfound []*references.Reference, err error) {
func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, envId string, references []*references.Reference, options ...*references.GetOptions) (items []*items.Item, notfound []*references.Reference, err error) {
attributes := otelmetric.WithAttributeSet(attribute.NewSet(
attribute.String("service", "References"),
attribute.String("method", "Get"),
......@@ -69,7 +69,8 @@ func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, envId str
"ctx": ctx,
"spaceId": spaceId,
"envId": envId,
"references": references}, map[string]interface{}{
"references": references,
"options": options}, map[string]interface{}{
"items": items,
"notfound": notfound,
"err": err})
......@@ -83,7 +84,7 @@ func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, envId str
_span.End()
}()
return _d.References.Get(ctx, spaceId, envId, references)
return _d.References.Get(ctx, spaceId, envId, references, options...)
}
// Publish implements references.References
......
// Code generated by mockery v2.22.1. DO NOT EDIT.
// Code generated by mockery v2.40.1. DO NOT EDIT.
package mocks
......@@ -16,6 +16,10 @@ type Middleware struct {
func (_m *Middleware) Execute(_a0 references.References) references.References {
ret := _m.Called(_a0)
if len(ret) == 0 {
panic("no return value specified for Execute")
}
var r0 references.References
if rf, ok := ret.Get(0).(func(references.References) references.References); ok {
r0 = rf(_a0)
......@@ -28,13 +32,12 @@ func (_m *Middleware) Execute(_a0 references.References) references.References {
return r0
}
type mockConstructorTestingTNewMiddleware interface {
// NewMiddleware creates a new instance of Middleware. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMiddleware(t interface {
mock.TestingT
Cleanup(func())
}
// NewMiddleware creates a new instance of Middleware. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewMiddleware(t mockConstructorTestingTNewMiddleware) *Middleware {
}) *Middleware {
mock := &Middleware{}
mock.Mock.Test(t)
......
// Code generated by mockery v2.22.1. DO NOT EDIT.
// Code generated by mockery v2.40.1. DO NOT EDIT.
package mocks
......@@ -16,34 +16,45 @@ type References struct {
mock.Mock
}
// Get provides a mock function with given fields: ctx, spaceId, envId, _a3
func (_m *References) Get(ctx context.Context, spaceId string, envId string, _a3 []*references.Reference) ([]*items.Item, []*references.Reference, error) {
ret := _m.Called(ctx, spaceId, envId, _a3)
// Get provides a mock function with given fields: ctx, spaceId, envId, _a3, options
func (_m *References) Get(ctx context.Context, spaceId string, envId string, _a3 []*references.Reference, options ...*references.GetOptions) ([]*items.Item, []*references.Reference, error) {
_va := make([]interface{}, len(options))
for _i := range options {
_va[_i] = options[_i]
}
var _ca []interface{}
_ca = append(_ca, ctx, spaceId, envId, _a3)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
if len(ret) == 0 {
panic("no return value specified for Get")
}
var r0 []*items.Item
var r1 []*references.Reference
var r2 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, []*references.Reference) ([]*items.Item, []*references.Reference, error)); ok {
return rf(ctx, spaceId, envId, _a3)
if rf, ok := ret.Get(0).(func(context.Context, string, string, []*references.Reference, ...*references.GetOptions) ([]*items.Item, []*references.Reference, error)); ok {
return rf(ctx, spaceId, envId, _a3, options...)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, []*references.Reference) []*items.Item); ok {
r0 = rf(ctx, spaceId, envId, _a3)
if rf, ok := ret.Get(0).(func(context.Context, string, string, []*references.Reference, ...*references.GetOptions) []*items.Item); ok {
r0 = rf(ctx, spaceId, envId, _a3, options...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*items.Item)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, string, []*references.Reference) []*references.Reference); ok {
r1 = rf(ctx, spaceId, envId, _a3)
if rf, ok := ret.Get(1).(func(context.Context, string, string, []*references.Reference, ...*references.GetOptions) []*references.Reference); ok {
r1 = rf(ctx, spaceId, envId, _a3, options...)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).([]*references.Reference)
}
}
if rf, ok := ret.Get(2).(func(context.Context, string, string, []*references.Reference) error); ok {
r2 = rf(ctx, spaceId, envId, _a3)
if rf, ok := ret.Get(2).(func(context.Context, string, string, []*references.Reference, ...*references.GetOptions) error); ok {
r2 = rf(ctx, spaceId, envId, _a3, options...)
} else {
r2 = ret.Error(2)
}
......@@ -55,6 +66,10 @@ func (_m *References) Get(ctx context.Context, spaceId string, envId string, _a3
func (_m *References) Publish(ctx context.Context, spaceId string, envId string, _a3 []*references.Reference, recursive bool, force bool) ([]*references.Reference, []*references.Reference, []*references.Reference, error) {
ret := _m.Called(ctx, spaceId, envId, _a3, recursive, force)
if len(ret) == 0 {
panic("no return value specified for Publish")
}
var r0 []*references.Reference
var r1 []*references.Reference
var r2 []*references.Reference
......@@ -95,13 +110,12 @@ func (_m *References) Publish(ctx context.Context, spaceId string, envId string,
return r0, r1, r2, r3
}
type mockConstructorTestingTNewReferences interface {
// NewReferences creates a new instance of References. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewReferences(t interface {
mock.TestingT
Cleanup(func())
}
// NewReferences creates a new instance of References. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewReferences(t mockConstructorTestingTNewReferences) *References {
}) *References {
mock := &References{}
mock.Mock.Test(t)
......
......@@ -126,3 +126,45 @@ func EqualArrays(sr1, sr2 []*Reference) bool {
func (r *Reference) IsValid() bool {
return r != nil && r.ID != "" && r.CollectionID != "" && !r.Disabled
}
type GetOptions struct {
LocaleID string `json:"locale_id,omitempty"`
TranslationsIDs []string `json:"translations_ids,omitempty"`
}
func NewGetOptions() *GetOptions {
return &GetOptions{}
}
func MergeGetOptions(opts ...*GetOptions) *GetOptions {
o := NewGetOptions()
for _, opt := range opts {
if opt == nil {
continue
}
o.LocaleID = opt.LocaleID
o.TranslationsIDs = append(o.TranslationsIDs, opt.TranslationsIDs...)
}
return o
}
func GetOptionsFromPB(opts *pb.GetOptions) *GetOptions {
if opts == nil {
return nil
}
return &GetOptions{
LocaleID: opts.LocaleId,
TranslationsIDs: opts.TranslationsIds,
}
}
func GetOptionsToPB(opts *GetOptions) *pb.GetOptions {
if opts == nil {
return nil
}
return &pb.GetOptions{
LocaleId: opts.LocaleID,
TranslationsIds: opts.TranslationsIDs,
}
}
......@@ -10,7 +10,7 @@ import (
// @protobuf git.perx.ru/perxis/perxis-go/proto/references
// @grpc-addr content.references.References
type References interface {
Get(ctx context.Context, spaceId, envId string, references []*Reference) (items []*items.Item, notfound []*Reference, err error)
Get(ctx context.Context, spaceId, envId string, references []*Reference, options ...*GetOptions) (items []*items.Item, notfound []*Reference, err error)
Publish(ctx context.Context, spaceId, envId string, references []*Reference, recursive, force bool) (published []*Reference, notfound []*Reference, unpublished []*Reference, err error)
}
......@@ -9,11 +9,12 @@ import (
references "git.perx.ru/perxis/perxis-go/pkg/references"
)
func (set EndpointsSet) Get(arg0 context.Context, arg1 string, arg2 string, arg3 []*references.Reference) (res0 []*items.Item, res1 []*references.Reference, res2 error) {
func (set EndpointsSet) Get(arg0 context.Context, arg1 string, arg2 string, arg3 []*references.Reference, arg4 ...*references.GetOptions) (res0 []*items.Item, res1 []*references.Reference, res2 error) {
request := GetRequest{
EnvId: arg2,
References: arg3,
SpaceId: arg1,
Options: arg4,
}
response, res2 := set.GetEndpoint(arg0, &request)
if res2 != nil {
......
......@@ -12,6 +12,7 @@ type (
SpaceId string `json:"space_id"`
EnvId string `json:"env_id"`
References []*references.Reference `json:"references"`
Options []*references.GetOptions `json:"options"`
}
GetResponse struct {
Items []*items.Item `json:"items"`
......
......@@ -7,6 +7,7 @@ import (
"context"
"errors"
"git.perx.ru/perxis/perxis-go/pkg/references"
"git.perx.ru/perxis/perxis-go/pkg/references/transport"
pb "git.perx.ru/perxis/perxis-go/proto/references"
)
......@@ -20,10 +21,15 @@ func _Encode_Get_Request(ctx context.Context, request interface{}) (interface{},
if err != nil {
return nil, err
}
opts := &pb.GetOptions{}
if req.Options != nil {
opts = references.GetOptionsToPB(req.Options[0])
}
return &pb.GetRequest{
EnvId: req.EnvId,
References: reqReferences,
SpaceId: req.SpaceId,
Options: opts,
}, nil
}
......@@ -59,6 +65,7 @@ func _Decode_Get_Request(ctx context.Context, request interface{}) (interface{},
EnvId: string(req.EnvId),
References: reqReferences,
SpaceId: string(req.SpaceId),
Options: []*references.GetOptions{references.GetOptionsFromPB(req.Options)},
}, nil
}
......
......@@ -69,3 +69,25 @@ func ListPtrItemsItemToProto(items []*items.Item) ([]*itemspb.Item, error) {
func ProtoToListPtrItemsItem(protoItems []*itemspb.Item) ([]*items.Item, error) {
return itemstransportgrpc.ProtoToListPtrItem(protoItems)
}
func ElPtrGetOptionsToProto(options []*service.GetOptions) ([]*pb.GetOptions, error) {
if options == nil {
return nil, nil
}
protoOption := make([]*pb.GetOptions, len(options))
for _, o := range options {
protoOption = append(protoOption, service.GetOptionsToPB(o))
}
return protoOption, nil
}
func ProtoToElPtrGetOptions(protoOptions []*pb.GetOptions) ([]*service.GetOptions, error) {
if protoOptions == nil {
return nil, nil
}
options := make([]*service.GetOptions, len(protoOptions))
for _, o := range protoOptions {
options = append(options, service.GetOptionsFromPB(o))
}
return options, nil
}
......@@ -19,7 +19,7 @@ func Endpoints(svc references.References) EndpointsSet {
func GetEndpoint(svc references.References) endpoint.Endpoint {
return func(arg0 context.Context, request interface{}) (interface{}, error) {
req := request.(*GetRequest)
res0, res1, res2 := svc.Get(arg0, req.SpaceId, req.EnvId, req.References)
res0, res1, res2 := svc.Get(arg0, req.SpaceId, req.EnvId, req.References, req.Options...)
return &GetResponse{
Items: res0,
Notfound: res1,
......
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v4.24.3
// protoc v4.25.1
// source: references/references.proto
package references
......@@ -92,6 +92,7 @@ type GetRequest struct {
SpaceId string `protobuf:"bytes,1,opt,name=space_id,json=spaceId,proto3" json:"space_id,omitempty"`
EnvId string `protobuf:"bytes,2,opt,name=env_id,json=envId,proto3" json:"env_id,omitempty"`
References []*Reference `protobuf:"bytes,3,rep,name=references,proto3" json:"references,omitempty"`
Options *GetOptions `protobuf:"bytes,4,opt,name=options,proto3" json:"options,omitempty"` // Дополнительные параметры поиска
}
func (x *GetRequest) Reset() {
......@@ -147,6 +148,13 @@ func (x *GetRequest) GetReferences() []*Reference {
return nil
}
func (x *GetRequest) GetOptions() *GetOptions {
if x != nil {
return x.Options
}
return nil
}
type GetResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
......@@ -346,6 +354,61 @@ func (x *PublishResponse) GetUnpublished() []*Reference {
return nil
}
type GetOptions struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
LocaleId string `protobuf:"bytes,1,opt,name=locale_id,json=localeId,proto3" json:"locale_id,omitempty"` // Язык перевода который будет использоваться. Если не указан, то возвращаются данные для языка по умолчанию
TranslationsIds []string `protobuf:"bytes,2,rep,name=translations_ids,json=translationsIds,proto3" json:"translations_ids,omitempty"` // Список идентификаторов переводов/локалей, которых должны быть включены в результат
}
func (x *GetOptions) Reset() {
*x = GetOptions{}
if protoimpl.UnsafeEnabled {
mi := &file_references_references_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetOptions) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetOptions) ProtoMessage() {}
func (x *GetOptions) ProtoReflect() protoreflect.Message {
mi := &file_references_references_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetOptions.ProtoReflect.Descriptor instead.
func (*GetOptions) Descriptor() ([]byte, []int) {
return file_references_references_proto_rawDescGZIP(), []int{5}
}
func (x *GetOptions) GetLocaleId() string {
if x != nil {
return x.LocaleId
}
return ""
}
func (x *GetOptions) GetTranslationsIds() []string {
if x != nil {
return x.TranslationsIds
}
return nil
}
var File_references_references_proto protoreflect.FileDescriptor
var file_references_references_proto_rawDesc = []byte{
......@@ -359,61 +422,70 @@ var file_references_references_proto_rawDesc = []byte{
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c,
0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c,
0x65, 0x64, 0x22, 0x7d, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x65,
0x6e, 0x76, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6e, 0x76,
0x49, 0x64, 0x12, 0x3d, 0x0a, 0x0a, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73,
0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
0x2e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x66, 0x65,
0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0a, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65,
0x73, 0x22, 0x73, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x29, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x13, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x2e,
0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x39, 0x0a, 0x08, 0x6e,
0x6f, 0x74, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e,
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63,
0x65, 0x73, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x6e, 0x6f,
0x74, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x22, 0xb5, 0x01, 0x0a, 0x0e, 0x50, 0x75, 0x62, 0x6c, 0x69,
0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x61,
0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x70, 0x61,
0x63, 0x65, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x65, 0x6e, 0x76, 0x5f, 0x69, 0x64, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6e, 0x76, 0x49, 0x64, 0x12, 0x3d, 0x0a, 0x0a, 0x72,
0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x1d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65,
0x6e, 0x63, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0a,
0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65,
0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x72,
0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63,
0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0xca,
0x01, 0x0a, 0x0f, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x3b, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18,
0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e,
0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72,
0x65, 0x6e, 0x63, 0x65, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12,
0x39, 0x0a, 0x08, 0x6e, 0x6f, 0x74, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66, 0x65,
0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65,
0x52, 0x08, 0x6e, 0x6f, 0x74, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x3f, 0x0a, 0x0b, 0x75, 0x6e,
0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x1d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65,
0x6e, 0x63, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0b,
0x75, 0x6e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x32, 0xac, 0x01, 0x0a, 0x0a,
0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x48, 0x0a, 0x03, 0x47, 0x65,
0x74, 0x12, 0x1e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66, 0x65,
0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x1f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66, 0x65,
0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x07, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x12,
0x22, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65,
0x6e, 0x63, 0x65, 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65,
0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69,
0x74, 0x2e, 0x70, 0x65, 0x72, 0x78, 0x2e, 0x72, 0x75, 0x2f, 0x70, 0x65, 0x72, 0x78, 0x69, 0x73,
0x2f, 0x70, 0x65, 0x72, 0x78, 0x69, 0x73, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x2f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x3b, 0x72, 0x65, 0x66, 0x65,
0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x65, 0x64, 0x22, 0xb7, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06,
0x65, 0x6e, 0x76, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6e,
0x76, 0x49, 0x64, 0x12, 0x3d, 0x0a, 0x0a, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65,
0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
0x74, 0x2e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x66,
0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0a, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63,
0x65, 0x73, 0x12, 0x38, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65,
0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x73, 0x0a, 0x0b,
0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x05, 0x69,
0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6e,
0x74, 0x65, 0x6e, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52,
0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x39, 0x0a, 0x08, 0x6e, 0x6f, 0x74, 0x66, 0x6f, 0x75,
0x6e, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65,
0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x52, 0x65,
0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x6e, 0x6f, 0x74, 0x66, 0x6f, 0x75, 0x6e,
0x64, 0x22, 0xb5, 0x01, 0x0a, 0x0e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12,
0x15, 0x0a, 0x06, 0x65, 0x6e, 0x76, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x05, 0x65, 0x6e, 0x76, 0x49, 0x64, 0x12, 0x3d, 0x0a, 0x0a, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65,
0x6e, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6e,
0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e,
0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0a, 0x72, 0x65, 0x66, 0x65, 0x72,
0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69,
0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73,
0x69, 0x76, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01,
0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0xca, 0x01, 0x0a, 0x0f, 0x50, 0x75,
0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a,
0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66, 0x65, 0x72,
0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52,
0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, 0x39, 0x0a, 0x08, 0x6e, 0x6f,
0x74, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63,
0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65,
0x73, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x6e, 0x6f, 0x74,
0x66, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x3f, 0x0a, 0x0b, 0x75, 0x6e, 0x70, 0x75, 0x62, 0x6c, 0x69,
0x73, 0x68, 0x65, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6e,
0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e,
0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0b, 0x75, 0x6e, 0x70, 0x75, 0x62,
0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x22, 0x54, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x5f, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x49,
0x64, 0x12, 0x29, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x74, 0x72, 0x61,
0x6e, 0x73, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x64, 0x73, 0x32, 0xac, 0x01, 0x0a,
0x0a, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x48, 0x0a, 0x03, 0x47,
0x65, 0x74, 0x12, 0x1e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66,
0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66,
0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x07, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68,
0x12, 0x22, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66, 0x65, 0x72,
0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72,
0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73,
0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x3a, 0x5a, 0x38, 0x67,
0x69, 0x74, 0x2e, 0x70, 0x65, 0x72, 0x78, 0x2e, 0x72, 0x75, 0x2f, 0x70, 0x65, 0x72, 0x78, 0x69,
0x73, 0x2f, 0x70, 0x65, 0x72, 0x78, 0x69, 0x73, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x2f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x3b, 0x72, 0x65, 0x66,
0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
......@@ -428,32 +500,34 @@ func file_references_references_proto_rawDescGZIP() []byte {
return file_references_references_proto_rawDescData
}
var file_references_references_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_references_references_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_references_references_proto_goTypes = []interface{}{
(*Reference)(nil), // 0: content.references.Reference
(*GetRequest)(nil), // 1: content.references.GetRequest
(*GetResponse)(nil), // 2: content.references.GetResponse
(*PublishRequest)(nil), // 3: content.references.PublishRequest
(*PublishResponse)(nil), // 4: content.references.PublishResponse
(*items.Item)(nil), // 5: content.items.Item
(*GetOptions)(nil), // 5: content.references.GetOptions
(*items.Item)(nil), // 6: content.items.Item
}
var file_references_references_proto_depIdxs = []int32{
0, // 0: content.references.GetRequest.references:type_name -> content.references.Reference
5, // 1: content.references.GetResponse.items:type_name -> content.items.Item
0, // 2: content.references.GetResponse.notfound:type_name -> content.references.Reference
0, // 3: content.references.PublishRequest.references:type_name -> content.references.Reference
0, // 4: content.references.PublishResponse.published:type_name -> content.references.Reference
0, // 5: content.references.PublishResponse.notfound:type_name -> content.references.Reference
0, // 6: content.references.PublishResponse.unpublished:type_name -> content.references.Reference
1, // 7: content.references.References.Get:input_type -> content.references.GetRequest
3, // 8: content.references.References.Publish:input_type -> content.references.PublishRequest
2, // 9: content.references.References.Get:output_type -> content.references.GetResponse
4, // 10: content.references.References.Publish:output_type -> content.references.PublishResponse
9, // [9:11] is the sub-list for method output_type
7, // [7:9] is the sub-list for method input_type
7, // [7:7] is the sub-list for extension type_name
7, // [7:7] is the sub-list for extension extendee
0, // [0:7] is the sub-list for field type_name
5, // 1: content.references.GetRequest.options:type_name -> content.references.GetOptions
6, // 2: content.references.GetResponse.items:type_name -> content.items.Item
0, // 3: content.references.GetResponse.notfound:type_name -> content.references.Reference
0, // 4: content.references.PublishRequest.references:type_name -> content.references.Reference
0, // 5: content.references.PublishResponse.published:type_name -> content.references.Reference
0, // 6: content.references.PublishResponse.notfound:type_name -> content.references.Reference
0, // 7: content.references.PublishResponse.unpublished:type_name -> content.references.Reference
1, // 8: content.references.References.Get:input_type -> content.references.GetRequest
3, // 9: content.references.References.Publish:input_type -> content.references.PublishRequest
2, // 10: content.references.References.Get:output_type -> content.references.GetResponse
4, // 11: content.references.References.Publish:output_type -> content.references.PublishResponse
10, // [10:12] is the sub-list for method output_type
8, // [8:10] is the sub-list for method input_type
8, // [8:8] is the sub-list for extension type_name
8, // [8:8] is the sub-list for extension extendee
0, // [0:8] is the sub-list for field type_name
}
func init() { file_references_references_proto_init() }
......@@ -522,6 +596,18 @@ func file_references_references_proto_init() {
return nil
}
}
file_references_references_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetOptions); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
......@@ -529,7 +615,7 @@ func file_references_references_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_references_references_proto_rawDesc,
NumEnums: 0,
NumMessages: 5,
NumMessages: 6,
NumExtensions: 0,
NumServices: 1,
},
......
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v4.24.3
// - protoc v4.25.1
// source: references/references.proto
package references
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment