Initial QSfera import

This commit is contained in:
Курнат Андрей
2026-06-07 10:20:04 +03:00
commit 2315f25754
16485 changed files with 4826827 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
# maintain v2 separate mocks dir
dir: "{{.InterfaceDir}}/mocks"
structname: "{{.InterfaceName}}"
filename: "{{.InterfaceName | snakecase }}.go"
pkgname: mocks
template: testify
packages:
github.com/qsfera/server/protogen/gen/qsfera/services/eventhistory/v0:
interfaces:
EventHistoryService: {}
github.com/qsfera/server/protogen/gen/qsfera/services/policies/v0:
interfaces:
PoliciesProviderService: {}
github.com/qsfera/server/protogen/gen/qsfera/services/search/v0:
interfaces:
SearchProviderService: {}
github.com/qsfera/server/protogen/gen/qsfera/services/settings/v0:
interfaces:
ValueService: {}
github.com/qsfera/server/protogen/gen/qsfera/services/thumbnails/v0:
interfaces:
ThumbnailService: {}
+15
View File
@@ -0,0 +1,15 @@
SHELL := bash
NAME := protogen
ifneq (, $(shell command -v go 2> /dev/null)) # suppress `command not found warnings` for non go targets in CI
include ../.bingo/Variables.mk
endif
include ../.make/default.mk
.PHONY: go-generate
go-generate: $(MOCKERY)
$(MOCKERY)
.PHONY: clean
clean:
$(NOOP)
+95
View File
@@ -0,0 +1,95 @@
---
{{- $package := (index .Files 0).Package }}
title: "{{ $package }}"
url: /apis/grpc_apis/{{ $package | replace "." "_" }}
date: {{ now | date "2006-01-02T15:04:05Z07:00" }}
weight: 50
geekdocRepo: https://github.com/qsfera/server
---
{{`{{< toc >}}`}}
{{ range .Files -}}
{{ $filename := .Name }}
{{ $filenameParts := splitList "/" $filename }}
## {{ .Name }}
{{ .Description }}
{{- range .Messages -}}
{{- /* remove newline */}}### {{ .LongName }}
{{ .Description }}
{{ if .HasFields -}}
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
{{ range .Fields -}}
{{- $loca := printf "#%s" (.LongType | lower | replace "." "") -}}
{{- if and (hasPrefix "qsfera." .LongType) (ge (len $filenameParts) 3) -}}
{{- $ltypeSpl := .LongType | splitList "." -}}
{{- $ltypePkg := slice $ltypeSpl 0 (sub (len $ltypeSpl) 1) | join "_" -}}
{{- $loca = printf "/apis/grpc_apis/%s/#%s" $ltypePkg (.Type | lower) -}}
{{- end -}}
| {{.Name}} | [{{.LongType}}]({{ $loca }}) | {{.Label}} | {{ .Description | replace "\n" "<br>" }}{{if .DefaultValue}} Default: {{.DefaultValue}}{{end }} |
{{ end -}}
{{ end }}
{{ if .HasExtensions -}}
| Extension | Type | Base | Number | Description |
| --------- | ---- | ---- | ------ | ----------- |
{{ range .Extensions -}}
| {{.Name}} | {{.LongType}} | {{.ContainingLongType}} | {{.Number}} | {{ .Description | replace "\n" "<br>" }}{{if .DefaultValue}} Default: {{.DefaultValue}}{{end}} |
{{ end -}}
{{ end -}}
{{ end -}}
{{- range .Enums -}}
### {{ .LongName }}
{{ .Description }}
| Name | Number | Description |
| ---- | ------ | ----------- |
{{range .Values -}}
| {{.Name}} | {{.Number}} | {{ .Description | replace "\n" "<br>" }} |
{{ end -}}
{{ end -}}
{{ if .HasExtensions }}
### File-level Extensions
| Extension | Type | Base | Number | Description |
| --------- | ---- | ---- | ------ | ----------- |
{{ range .Extensions -}}
| {{.Name}} | {{.LongType}} | {{.ContainingLongType}} | {{.Number}} | {{ .Description | replace "\n" "<br>" }}{{if .DefaultValue}} Default: `{{.DefaultValue}}`{{end}} |
{{ end -}}
{{ end -}}
{{- range .Services }}
### {{ .Name }}
{{ .Description }}
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
{{ range .Methods -}}
{{- $reqLoca := printf "#%s" (.RequestLongType | lower | replace "." "") -}}
{{- $respLoca := printf "#%s" (.ResponseLongType | lower | replace "." "") -}}
{{- if and (hasPrefix ".qsfera." .RequestLongType) (ge (len $filenameParts) 3) }}
{{- $ltypeSpl := .RequestLongType | substr 1 -1 | splitList "." -}}
{{- $ltypePkg := slice $ltypeSpl 0 (sub (len $ltypeSpl) 1) | join "_" -}}
{{- $reqLoca = printf "/grpc_apis/%s/#%s" $ltypePkg (.RequestType | lower) -}}
{{- end -}}
{{- if and (hasPrefix ".qsfera." .ResponseLongType) (ge (len $filenameParts) 3) }}
{{- $ltypeSpl := .ResponseLongType | substr 1 -1 | splitList "." -}}
{{- $ltypePkg := slice $ltypeSpl 0 (sub (len $ltypeSpl) 1) | join "_" -}}
{{- $respLoca = printf "/grpc_apis/%s/#%s" $ltypePkg (.ResponseType | lower) -}}
{{- end -}}
| {{.Name}} | [{{.RequestLongType}}]({{ $reqLoca }}){{if .RequestStreaming}} stream{{end}} | [{{.ResponseLongType}}]({{ $respLoca }}){{if .ResponseStreaming}} stream{{end}} | {{ .Description | replace "\n" "<br>" }} |
{{ end -}}
{{ end -}}
{{ end }}
## Scalar Value Types
| .proto Type | Notes | C++ | Java |
| ----------- | ----- | --- | ---- |
{{ range .Scalars -}}
| {{`{{< div id="`}}{{.ProtoType}}{{`" content="`}}{{.ProtoType}}{{`" >}}`}} | {{.Notes}} | {{.CppType}} | {{.JavaType}} |
{{ end }}
@@ -0,0 +1,171 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc (unknown)
// source: qsfera/messages/eventhistory/v0/eventhistory.proto
package v0
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Event struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// REQUIRED.
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
// REQUIRED.
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
// REQUIRED
Event []byte `protobuf:"bytes,3,opt,name=event,proto3" json:"event,omitempty"`
}
func (x *Event) Reset() {
*x = Event{}
if protoimpl.UnsafeEnabled {
mi := &file_qsfera_messages_eventhistory_v0_eventhistory_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Event) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Event) ProtoMessage() {}
func (x *Event) ProtoReflect() protoreflect.Message {
mi := &file_qsfera_messages_eventhistory_v0_eventhistory_proto_msgTypes[0]
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 Event.ProtoReflect.Descriptor instead.
func (*Event) Descriptor() ([]byte, []int) {
return file_qsfera_messages_eventhistory_v0_eventhistory_proto_rawDescGZIP(), []int{0}
}
func (x *Event) GetType() string {
if x != nil {
return x.Type
}
return ""
}
func (x *Event) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *Event) GetEvent() []byte {
if x != nil {
return x.Event
}
return nil
}
var File_qsfera_messages_eventhistory_v0_eventhistory_proto protoreflect.FileDescriptor
var file_qsfera_messages_eventhistory_v0_eventhistory_proto_rawDesc = []byte{
0x0a, 0x35, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x73, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72,
0x79, 0x2f, 0x76, 0x30, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72,
0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x22, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f,
0x75, 0x64, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e,
0x74, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x76, 0x30, 0x22, 0x41, 0x0a, 0x05, 0x45,
0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e,
0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x53,
0x5a, 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65,
0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x65, 0x75, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x65, 0x6e,
0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x73, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79,
0x2f, 0x76, 0x30, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_qsfera_messages_eventhistory_v0_eventhistory_proto_rawDescOnce sync.Once
file_qsfera_messages_eventhistory_v0_eventhistory_proto_rawDescData = file_qsfera_messages_eventhistory_v0_eventhistory_proto_rawDesc
)
func file_qsfera_messages_eventhistory_v0_eventhistory_proto_rawDescGZIP() []byte {
file_qsfera_messages_eventhistory_v0_eventhistory_proto_rawDescOnce.Do(func() {
file_qsfera_messages_eventhistory_v0_eventhistory_proto_rawDescData = protoimpl.X.CompressGZIP(file_qsfera_messages_eventhistory_v0_eventhistory_proto_rawDescData)
})
return file_qsfera_messages_eventhistory_v0_eventhistory_proto_rawDescData
}
var file_qsfera_messages_eventhistory_v0_eventhistory_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_qsfera_messages_eventhistory_v0_eventhistory_proto_goTypes = []interface{}{
(*Event)(nil), // 0: qsfera.messages.eventhistory.v0.Event
}
var file_qsfera_messages_eventhistory_v0_eventhistory_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_qsfera_messages_eventhistory_v0_eventhistory_proto_init() }
func file_qsfera_messages_eventhistory_v0_eventhistory_proto_init() {
if File_qsfera_messages_eventhistory_v0_eventhistory_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_qsfera_messages_eventhistory_v0_eventhistory_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Event); 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{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_qsfera_messages_eventhistory_v0_eventhistory_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_qsfera_messages_eventhistory_v0_eventhistory_proto_goTypes,
DependencyIndexes: file_qsfera_messages_eventhistory_v0_eventhistory_proto_depIdxs,
MessageInfos: file_qsfera_messages_eventhistory_v0_eventhistory_proto_msgTypes,
}.Build()
File_qsfera_messages_eventhistory_v0_eventhistory_proto = out.File
file_qsfera_messages_eventhistory_v0_eventhistory_proto_rawDesc = nil
file_qsfera_messages_eventhistory_v0_eventhistory_proto_goTypes = nil
file_qsfera_messages_eventhistory_v0_eventhistory_proto_depIdxs = nil
}
@@ -0,0 +1,15 @@
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: qsfera/messages/eventhistory/v0/eventhistory.proto
package v0
import (
fmt "fmt"
proto "google.golang.org/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
@@ -0,0 +1,43 @@
{
"swagger": "2.0",
"info": {
"title": "qsfera/messages/eventhistory/v0/eventhistory.proto",
"version": "version not set"
},
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {},
"definitions": {
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"rpcStatus": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"$ref": "#/definitions/protobufAny"
}
}
}
}
}
}
@@ -0,0 +1,656 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc (unknown)
// source: qsfera/messages/policies/v0/policies.proto
package v0
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Stage int32
const (
Stage_STAGE_PP Stage = 0
Stage_STAGE_HTTP Stage = 1
)
// Enum value maps for Stage.
var (
Stage_name = map[int32]string{
0: "STAGE_PP",
1: "STAGE_HTTP",
}
Stage_value = map[string]int32{
"STAGE_PP": 0,
"STAGE_HTTP": 1,
}
)
func (x Stage) Enum() *Stage {
p := new(Stage)
*p = x
return p
}
func (x Stage) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Stage) Descriptor() protoreflect.EnumDescriptor {
return file_qsfera_messages_policies_v0_policies_proto_enumTypes[0].Descriptor()
}
func (Stage) Type() protoreflect.EnumType {
return &file_qsfera_messages_policies_v0_policies_proto_enumTypes[0]
}
func (x Stage) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Stage.Descriptor instead.
func (Stage) EnumDescriptor() ([]byte, []int) {
return file_qsfera_messages_policies_v0_policies_proto_rawDescGZIP(), []int{0}
}
type User struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id *User_ID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
Mail string `protobuf:"bytes,3,opt,name=mail,proto3" json:"mail,omitempty"`
DisplayName string `protobuf:"bytes,4,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`
Groups []string `protobuf:"bytes,5,rep,name=groups,proto3" json:"groups,omitempty"`
}
func (x *User) Reset() {
*x = User{}
if protoimpl.UnsafeEnabled {
mi := &file_qsfera_messages_policies_v0_policies_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *User) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*User) ProtoMessage() {}
func (x *User) ProtoReflect() protoreflect.Message {
mi := &file_qsfera_messages_policies_v0_policies_proto_msgTypes[0]
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 User.ProtoReflect.Descriptor instead.
func (*User) Descriptor() ([]byte, []int) {
return file_qsfera_messages_policies_v0_policies_proto_rawDescGZIP(), []int{0}
}
func (x *User) GetId() *User_ID {
if x != nil {
return x.Id
}
return nil
}
func (x *User) GetUsername() string {
if x != nil {
return x.Username
}
return ""
}
func (x *User) GetMail() string {
if x != nil {
return x.Mail
}
return ""
}
func (x *User) GetDisplayName() string {
if x != nil {
return x.DisplayName
}
return ""
}
func (x *User) GetGroups() []string {
if x != nil {
return x.Groups
}
return nil
}
type Resource struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id *Resource_ID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Size uint64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
Url string `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"`
}
func (x *Resource) Reset() {
*x = Resource{}
if protoimpl.UnsafeEnabled {
mi := &file_qsfera_messages_policies_v0_policies_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Resource) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Resource) ProtoMessage() {}
func (x *Resource) ProtoReflect() protoreflect.Message {
mi := &file_qsfera_messages_policies_v0_policies_proto_msgTypes[1]
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 Resource.ProtoReflect.Descriptor instead.
func (*Resource) Descriptor() ([]byte, []int) {
return file_qsfera_messages_policies_v0_policies_proto_rawDescGZIP(), []int{1}
}
func (x *Resource) GetId() *Resource_ID {
if x != nil {
return x.Id
}
return nil
}
func (x *Resource) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Resource) GetSize() uint64 {
if x != nil {
return x.Size
}
return 0
}
func (x *Resource) GetUrl() string {
if x != nil {
return x.Url
}
return ""
}
type Request struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"`
Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
}
func (x *Request) Reset() {
*x = Request{}
if protoimpl.UnsafeEnabled {
mi := &file_qsfera_messages_policies_v0_policies_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Request) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Request) ProtoMessage() {}
func (x *Request) ProtoReflect() protoreflect.Message {
mi := &file_qsfera_messages_policies_v0_policies_proto_msgTypes[2]
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 Request.ProtoReflect.Descriptor instead.
func (*Request) Descriptor() ([]byte, []int) {
return file_qsfera_messages_policies_v0_policies_proto_rawDescGZIP(), []int{2}
}
func (x *Request) GetMethod() string {
if x != nil {
return x.Method
}
return ""
}
func (x *Request) GetPath() string {
if x != nil {
return x.Path
}
return ""
}
type Environment struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Stage Stage `protobuf:"varint,1,opt,name=stage,proto3,enum=qsfera.messages.policies.v0.Stage" json:"stage,omitempty"`
User *User `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"`
Request *Request `protobuf:"bytes,3,opt,name=request,proto3" json:"request,omitempty"`
Resource *Resource `protobuf:"bytes,4,opt,name=resource,proto3" json:"resource,omitempty"`
}
func (x *Environment) Reset() {
*x = Environment{}
if protoimpl.UnsafeEnabled {
mi := &file_qsfera_messages_policies_v0_policies_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Environment) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Environment) ProtoMessage() {}
func (x *Environment) ProtoReflect() protoreflect.Message {
mi := &file_qsfera_messages_policies_v0_policies_proto_msgTypes[3]
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 Environment.ProtoReflect.Descriptor instead.
func (*Environment) Descriptor() ([]byte, []int) {
return file_qsfera_messages_policies_v0_policies_proto_rawDescGZIP(), []int{3}
}
func (x *Environment) GetStage() Stage {
if x != nil {
return x.Stage
}
return Stage_STAGE_PP
}
func (x *Environment) GetUser() *User {
if x != nil {
return x.User
}
return nil
}
func (x *Environment) GetRequest() *Request {
if x != nil {
return x.Request
}
return nil
}
func (x *Environment) GetResource() *Resource {
if x != nil {
return x.Resource
}
return nil
}
type User_ID struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
OpaqueId string `protobuf:"bytes,1,opt,name=opaque_id,json=opaqueId,proto3" json:"opaque_id,omitempty"`
}
func (x *User_ID) Reset() {
*x = User_ID{}
if protoimpl.UnsafeEnabled {
mi := &file_qsfera_messages_policies_v0_policies_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *User_ID) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*User_ID) ProtoMessage() {}
func (x *User_ID) ProtoReflect() protoreflect.Message {
mi := &file_qsfera_messages_policies_v0_policies_proto_msgTypes[4]
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 User_ID.ProtoReflect.Descriptor instead.
func (*User_ID) Descriptor() ([]byte, []int) {
return file_qsfera_messages_policies_v0_policies_proto_rawDescGZIP(), []int{0, 0}
}
func (x *User_ID) GetOpaqueId() string {
if x != nil {
return x.OpaqueId
}
return ""
}
type Resource_ID struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
StorageId string `protobuf:"bytes,1,opt,name=storage_id,json=storageId,proto3" json:"storage_id,omitempty"`
OpaqueId string `protobuf:"bytes,2,opt,name=opaque_id,json=opaqueId,proto3" json:"opaque_id,omitempty"`
SpaceId string `protobuf:"bytes,3,opt,name=space_id,json=spaceId,proto3" json:"space_id,omitempty"`
}
func (x *Resource_ID) Reset() {
*x = Resource_ID{}
if protoimpl.UnsafeEnabled {
mi := &file_qsfera_messages_policies_v0_policies_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Resource_ID) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Resource_ID) ProtoMessage() {}
func (x *Resource_ID) ProtoReflect() protoreflect.Message {
mi := &file_qsfera_messages_policies_v0_policies_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 Resource_ID.ProtoReflect.Descriptor instead.
func (*Resource_ID) Descriptor() ([]byte, []int) {
return file_qsfera_messages_policies_v0_policies_proto_rawDescGZIP(), []int{1, 0}
}
func (x *Resource_ID) GetStorageId() string {
if x != nil {
return x.StorageId
}
return ""
}
func (x *Resource_ID) GetOpaqueId() string {
if x != nil {
return x.OpaqueId
}
return ""
}
func (x *Resource_ID) GetSpaceId() string {
if x != nil {
return x.SpaceId
}
return ""
}
var File_qsfera_messages_policies_v0_policies_proto protoreflect.FileDescriptor
var file_qsfera_messages_policies_v0_policies_proto_rawDesc = []byte{
0x0a, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x76, 0x30,
0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x1e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2e, 0x76, 0x30, 0x22,
0xcd, 0x01, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69,
0x65, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x2e, 0x49, 0x44, 0x52, 0x02, 0x69,
0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a,
0x04, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x69,
0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79,
0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x05,
0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x1a, 0x21, 0x0a, 0x02,
0x49, 0x44, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x5f, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x49, 0x64, 0x22,
0xde, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x02,
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63,
0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x6f,
0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x2e, 0x49, 0x44, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a,
0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a,
0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x75, 0x72, 0x6c, 0x1a, 0x5b, 0x0a, 0x02, 0x49, 0x44, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x6f,
0x72, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73,
0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x61, 0x71,
0x75, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x61,
0x71, 0x75, 0x65, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69,
0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64,
0x22, 0x35, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d,
0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74,
0x68, 0x6f, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x8d, 0x02, 0x0a, 0x0b, 0x45, 0x6e, 0x76, 0x69,
0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f,
0x75, 0x64, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x6c, 0x69,
0x63, 0x69, 0x65, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x53, 0x74, 0x61, 0x67, 0x65, 0x52, 0x05, 0x73,
0x74, 0x61, 0x67, 0x65, 0x12, 0x38, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73,
0x2e, 0x76, 0x30, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x41,
0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2e, 0x76, 0x30,
0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x44, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e,
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65,
0x73, 0x2e, 0x76, 0x30, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72,
0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2a, 0x25, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x67, 0x65,
0x12, 0x0c, 0x0a, 0x08, 0x53, 0x54, 0x41, 0x47, 0x45, 0x5f, 0x50, 0x50, 0x10, 0x00, 0x12, 0x0e,
0x0a, 0x0a, 0x53, 0x54, 0x41, 0x47, 0x45, 0x5f, 0x48, 0x54, 0x54, 0x50, 0x10, 0x01, 0x42, 0x4f,
0x5a, 0x4d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65,
0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x65, 0x75, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x65, 0x6e,
0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x76, 0x30, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_qsfera_messages_policies_v0_policies_proto_rawDescOnce sync.Once
file_qsfera_messages_policies_v0_policies_proto_rawDescData = file_qsfera_messages_policies_v0_policies_proto_rawDesc
)
func file_qsfera_messages_policies_v0_policies_proto_rawDescGZIP() []byte {
file_qsfera_messages_policies_v0_policies_proto_rawDescOnce.Do(func() {
file_qsfera_messages_policies_v0_policies_proto_rawDescData = protoimpl.X.CompressGZIP(file_qsfera_messages_policies_v0_policies_proto_rawDescData)
})
return file_qsfera_messages_policies_v0_policies_proto_rawDescData
}
var file_qsfera_messages_policies_v0_policies_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_qsfera_messages_policies_v0_policies_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_qsfera_messages_policies_v0_policies_proto_goTypes = []interface{}{
(Stage)(0), // 0: qsfera.messages.policies.v0.Stage
(*User)(nil), // 1: qsfera.messages.policies.v0.User
(*Resource)(nil), // 2: qsfera.messages.policies.v0.Resource
(*Request)(nil), // 3: qsfera.messages.policies.v0.Request
(*Environment)(nil), // 4: qsfera.messages.policies.v0.Environment
(*User_ID)(nil), // 5: qsfera.messages.policies.v0.User.ID
(*Resource_ID)(nil), // 6: qsfera.messages.policies.v0.Resource.ID
}
var file_qsfera_messages_policies_v0_policies_proto_depIdxs = []int32{
5, // 0: qsfera.messages.policies.v0.User.id:type_name -> qsfera.messages.policies.v0.User.ID
6, // 1: qsfera.messages.policies.v0.Resource.id:type_name -> qsfera.messages.policies.v0.Resource.ID
0, // 2: qsfera.messages.policies.v0.Environment.stage:type_name -> qsfera.messages.policies.v0.Stage
1, // 3: qsfera.messages.policies.v0.Environment.user:type_name -> qsfera.messages.policies.v0.User
3, // 4: qsfera.messages.policies.v0.Environment.request:type_name -> qsfera.messages.policies.v0.Request
2, // 5: qsfera.messages.policies.v0.Environment.resource:type_name -> qsfera.messages.policies.v0.Resource
6, // [6:6] is the sub-list for method output_type
6, // [6:6] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
6, // [6:6] is the sub-list for extension extendee
0, // [0:6] is the sub-list for field type_name
}
func init() { file_qsfera_messages_policies_v0_policies_proto_init() }
func file_qsfera_messages_policies_v0_policies_proto_init() {
if File_qsfera_messages_policies_v0_policies_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_qsfera_messages_policies_v0_policies_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*User); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_qsfera_messages_policies_v0_policies_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Resource); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_qsfera_messages_policies_v0_policies_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Request); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_qsfera_messages_policies_v0_policies_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Environment); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_qsfera_messages_policies_v0_policies_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*User_ID); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_qsfera_messages_policies_v0_policies_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Resource_ID); 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{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_qsfera_messages_policies_v0_policies_proto_rawDesc,
NumEnums: 1,
NumMessages: 6,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_qsfera_messages_policies_v0_policies_proto_goTypes,
DependencyIndexes: file_qsfera_messages_policies_v0_policies_proto_depIdxs,
EnumInfos: file_qsfera_messages_policies_v0_policies_proto_enumTypes,
MessageInfos: file_qsfera_messages_policies_v0_policies_proto_msgTypes,
}.Build()
File_qsfera_messages_policies_v0_policies_proto = out.File
file_qsfera_messages_policies_v0_policies_proto_rawDesc = nil
file_qsfera_messages_policies_v0_policies_proto_goTypes = nil
file_qsfera_messages_policies_v0_policies_proto_depIdxs = nil
}
@@ -0,0 +1,15 @@
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: qsfera/messages/policies/v0/policies.proto
package v0
import (
fmt "fmt"
proto "google.golang.org/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
@@ -0,0 +1,43 @@
{
"swagger": "2.0",
"info": {
"title": "qsfera/messages/policies/v0/policies.proto",
"version": "version not set"
},
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {},
"definitions": {
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"rpcStatus": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"$ref": "#/definitions/protobufAny"
}
}
}
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,16 @@
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: qsfera/messages/search/v0/search.proto
package v0
import (
fmt "fmt"
proto "google.golang.org/protobuf/proto"
_ "google.golang.org/protobuf/types/known/timestamppb"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
@@ -0,0 +1,299 @@
// Code generated by protoc-gen-microweb. DO NOT EDIT.
// source: v0.proto
package v0
import (
"bytes"
"encoding/json"
"github.com/golang/protobuf/jsonpb"
)
// ResourceIDJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of ResourceID. This struct is safe to replace or modify but
// should not be done so concurrently.
var ResourceIDJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *ResourceID) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := ResourceIDJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*ResourceID)(nil)
// ResourceIDJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of ResourceID. This struct is safe to replace or modify but
// should not be done so concurrently.
var ResourceIDJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *ResourceID) UnmarshalJSON(b []byte) error {
return ResourceIDJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*ResourceID)(nil)
// ReferenceJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of Reference. This struct is safe to replace or modify but
// should not be done so concurrently.
var ReferenceJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *Reference) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := ReferenceJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*Reference)(nil)
// ReferenceJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of Reference. This struct is safe to replace or modify but
// should not be done so concurrently.
var ReferenceJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *Reference) UnmarshalJSON(b []byte) error {
return ReferenceJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*Reference)(nil)
// AudioJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of Audio. This struct is safe to replace or modify but
// should not be done so concurrently.
var AudioJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *Audio) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := AudioJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*Audio)(nil)
// AudioJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of Audio. This struct is safe to replace or modify but
// should not be done so concurrently.
var AudioJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *Audio) UnmarshalJSON(b []byte) error {
return AudioJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*Audio)(nil)
// ImageJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of Image. This struct is safe to replace or modify but
// should not be done so concurrently.
var ImageJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *Image) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := ImageJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*Image)(nil)
// ImageJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of Image. This struct is safe to replace or modify but
// should not be done so concurrently.
var ImageJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *Image) UnmarshalJSON(b []byte) error {
return ImageJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*Image)(nil)
// GeoCoordinatesJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of GeoCoordinates. This struct is safe to replace or modify but
// should not be done so concurrently.
var GeoCoordinatesJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *GeoCoordinates) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := GeoCoordinatesJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*GeoCoordinates)(nil)
// GeoCoordinatesJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of GeoCoordinates. This struct is safe to replace or modify but
// should not be done so concurrently.
var GeoCoordinatesJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *GeoCoordinates) UnmarshalJSON(b []byte) error {
return GeoCoordinatesJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*GeoCoordinates)(nil)
// PhotoJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of Photo. This struct is safe to replace or modify but
// should not be done so concurrently.
var PhotoJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *Photo) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := PhotoJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*Photo)(nil)
// PhotoJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of Photo. This struct is safe to replace or modify but
// should not be done so concurrently.
var PhotoJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *Photo) UnmarshalJSON(b []byte) error {
return PhotoJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*Photo)(nil)
// EntityJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of Entity. This struct is safe to replace or modify but
// should not be done so concurrently.
var EntityJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *Entity) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := EntityJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*Entity)(nil)
// EntityJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of Entity. This struct is safe to replace or modify but
// should not be done so concurrently.
var EntityJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *Entity) UnmarshalJSON(b []byte) error {
return EntityJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*Entity)(nil)
// MatchJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of Match. This struct is safe to replace or modify but
// should not be done so concurrently.
var MatchJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *Match) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := MatchJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*Match)(nil)
// MatchJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of Match. This struct is safe to replace or modify but
// should not be done so concurrently.
var MatchJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *Match) UnmarshalJSON(b []byte) error {
return MatchJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*Match)(nil)
@@ -0,0 +1,43 @@
{
"swagger": "2.0",
"info": {
"title": "qsfera/messages/search/v0/search.proto",
"version": "version not set"
},
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {},
"definitions": {
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"rpcStatus": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"$ref": "#/definitions/protobufAny"
}
}
}
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,15 @@
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: qsfera/messages/settings/v0/settings.proto
package v0
import (
fmt "fmt"
proto "google.golang.org/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
@@ -0,0 +1,803 @@
// Code generated by protoc-gen-microweb. DO NOT EDIT.
// source: v0.proto
package v0
import (
"bytes"
"encoding/json"
"github.com/golang/protobuf/jsonpb"
)
// ValueWithIdentifierJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of ValueWithIdentifier. This struct is safe to replace or modify but
// should not be done so concurrently.
var ValueWithIdentifierJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *ValueWithIdentifier) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := ValueWithIdentifierJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*ValueWithIdentifier)(nil)
// ValueWithIdentifierJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of ValueWithIdentifier. This struct is safe to replace or modify but
// should not be done so concurrently.
var ValueWithIdentifierJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *ValueWithIdentifier) UnmarshalJSON(b []byte) error {
return ValueWithIdentifierJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*ValueWithIdentifier)(nil)
// IdentifierJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of Identifier. This struct is safe to replace or modify but
// should not be done so concurrently.
var IdentifierJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *Identifier) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := IdentifierJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*Identifier)(nil)
// IdentifierJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of Identifier. This struct is safe to replace or modify but
// should not be done so concurrently.
var IdentifierJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *Identifier) UnmarshalJSON(b []byte) error {
return IdentifierJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*Identifier)(nil)
// UserRoleAssignmentJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of UserRoleAssignment. This struct is safe to replace or modify but
// should not be done so concurrently.
var UserRoleAssignmentJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *UserRoleAssignment) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := UserRoleAssignmentJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*UserRoleAssignment)(nil)
// UserRoleAssignmentJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of UserRoleAssignment. This struct is safe to replace or modify but
// should not be done so concurrently.
var UserRoleAssignmentJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *UserRoleAssignment) UnmarshalJSON(b []byte) error {
return UserRoleAssignmentJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*UserRoleAssignment)(nil)
// UserRoleAssignmentFilterJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of UserRoleAssignmentFilter. This struct is safe to replace or modify but
// should not be done so concurrently.
var UserRoleAssignmentFilterJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *UserRoleAssignmentFilter) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := UserRoleAssignmentFilterJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*UserRoleAssignmentFilter)(nil)
// UserRoleAssignmentFilterJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of UserRoleAssignmentFilter. This struct is safe to replace or modify but
// should not be done so concurrently.
var UserRoleAssignmentFilterJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *UserRoleAssignmentFilter) UnmarshalJSON(b []byte) error {
return UserRoleAssignmentFilterJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*UserRoleAssignmentFilter)(nil)
// ResourceJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of Resource. This struct is safe to replace or modify but
// should not be done so concurrently.
var ResourceJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *Resource) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := ResourceJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*Resource)(nil)
// ResourceJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of Resource. This struct is safe to replace or modify but
// should not be done so concurrently.
var ResourceJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *Resource) UnmarshalJSON(b []byte) error {
return ResourceJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*Resource)(nil)
// BundleJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of Bundle. This struct is safe to replace or modify but
// should not be done so concurrently.
var BundleJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *Bundle) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := BundleJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*Bundle)(nil)
// BundleJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of Bundle. This struct is safe to replace or modify but
// should not be done so concurrently.
var BundleJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *Bundle) UnmarshalJSON(b []byte) error {
return BundleJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*Bundle)(nil)
// SettingJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of Setting. This struct is safe to replace or modify but
// should not be done so concurrently.
var SettingJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *Setting) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := SettingJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*Setting)(nil)
// SettingJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of Setting. This struct is safe to replace or modify but
// should not be done so concurrently.
var SettingJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *Setting) UnmarshalJSON(b []byte) error {
return SettingJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*Setting)(nil)
// IntJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of Int. This struct is safe to replace or modify but
// should not be done so concurrently.
var IntJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *Int) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := IntJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*Int)(nil)
// IntJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of Int. This struct is safe to replace or modify but
// should not be done so concurrently.
var IntJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *Int) UnmarshalJSON(b []byte) error {
return IntJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*Int)(nil)
// StringJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of String. This struct is safe to replace or modify but
// should not be done so concurrently.
var StringJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *String) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := StringJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*String)(nil)
// StringJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of String. This struct is safe to replace or modify but
// should not be done so concurrently.
var StringJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *String) UnmarshalJSON(b []byte) error {
return StringJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*String)(nil)
// BoolJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of Bool. This struct is safe to replace or modify but
// should not be done so concurrently.
var BoolJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *Bool) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := BoolJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*Bool)(nil)
// BoolJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of Bool. This struct is safe to replace or modify but
// should not be done so concurrently.
var BoolJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *Bool) UnmarshalJSON(b []byte) error {
return BoolJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*Bool)(nil)
// SingleChoiceListJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of SingleChoiceList. This struct is safe to replace or modify but
// should not be done so concurrently.
var SingleChoiceListJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *SingleChoiceList) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := SingleChoiceListJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*SingleChoiceList)(nil)
// SingleChoiceListJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of SingleChoiceList. This struct is safe to replace or modify but
// should not be done so concurrently.
var SingleChoiceListJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *SingleChoiceList) UnmarshalJSON(b []byte) error {
return SingleChoiceListJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*SingleChoiceList)(nil)
// MultiChoiceListJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of MultiChoiceList. This struct is safe to replace or modify but
// should not be done so concurrently.
var MultiChoiceListJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *MultiChoiceList) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := MultiChoiceListJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*MultiChoiceList)(nil)
// MultiChoiceListJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of MultiChoiceList. This struct is safe to replace or modify but
// should not be done so concurrently.
var MultiChoiceListJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *MultiChoiceList) UnmarshalJSON(b []byte) error {
return MultiChoiceListJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*MultiChoiceList)(nil)
// ListOptionJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of ListOption. This struct is safe to replace or modify but
// should not be done so concurrently.
var ListOptionJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *ListOption) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := ListOptionJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*ListOption)(nil)
// ListOptionJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of ListOption. This struct is safe to replace or modify but
// should not be done so concurrently.
var ListOptionJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *ListOption) UnmarshalJSON(b []byte) error {
return ListOptionJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*ListOption)(nil)
// MultiChoiceCollectionJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of MultiChoiceCollection. This struct is safe to replace or modify but
// should not be done so concurrently.
var MultiChoiceCollectionJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *MultiChoiceCollection) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := MultiChoiceCollectionJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*MultiChoiceCollection)(nil)
// MultiChoiceCollectionJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of MultiChoiceCollection. This struct is safe to replace or modify but
// should not be done so concurrently.
var MultiChoiceCollectionJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *MultiChoiceCollection) UnmarshalJSON(b []byte) error {
return MultiChoiceCollectionJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*MultiChoiceCollection)(nil)
// MultiChoiceCollectionOptionJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of MultiChoiceCollectionOption. This struct is safe to replace or modify but
// should not be done so concurrently.
var MultiChoiceCollectionOptionJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *MultiChoiceCollectionOption) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := MultiChoiceCollectionOptionJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*MultiChoiceCollectionOption)(nil)
// MultiChoiceCollectionOptionJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of MultiChoiceCollectionOption. This struct is safe to replace or modify but
// should not be done so concurrently.
var MultiChoiceCollectionOptionJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *MultiChoiceCollectionOption) UnmarshalJSON(b []byte) error {
return MultiChoiceCollectionOptionJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*MultiChoiceCollectionOption)(nil)
// MultiChoiceCollectionOptionValueJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of MultiChoiceCollectionOptionValue. This struct is safe to replace or modify but
// should not be done so concurrently.
var MultiChoiceCollectionOptionValueJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *MultiChoiceCollectionOptionValue) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := MultiChoiceCollectionOptionValueJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*MultiChoiceCollectionOptionValue)(nil)
// MultiChoiceCollectionOptionValueJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of MultiChoiceCollectionOptionValue. This struct is safe to replace or modify but
// should not be done so concurrently.
var MultiChoiceCollectionOptionValueJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *MultiChoiceCollectionOptionValue) UnmarshalJSON(b []byte) error {
return MultiChoiceCollectionOptionValueJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*MultiChoiceCollectionOptionValue)(nil)
// PermissionJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of Permission. This struct is safe to replace or modify but
// should not be done so concurrently.
var PermissionJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *Permission) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := PermissionJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*Permission)(nil)
// PermissionJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of Permission. This struct is safe to replace or modify but
// should not be done so concurrently.
var PermissionJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *Permission) UnmarshalJSON(b []byte) error {
return PermissionJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*Permission)(nil)
// ValueJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of Value. This struct is safe to replace or modify but
// should not be done so concurrently.
var ValueJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *Value) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := ValueJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*Value)(nil)
// ValueJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of Value. This struct is safe to replace or modify but
// should not be done so concurrently.
var ValueJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *Value) UnmarshalJSON(b []byte) error {
return ValueJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*Value)(nil)
// ListValueJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of ListValue. This struct is safe to replace or modify but
// should not be done so concurrently.
var ListValueJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *ListValue) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := ListValueJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*ListValue)(nil)
// ListValueJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of ListValue. This struct is safe to replace or modify but
// should not be done so concurrently.
var ListValueJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *ListValue) UnmarshalJSON(b []byte) error {
return ListValueJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*ListValue)(nil)
// ListOptionValueJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of ListOptionValue. This struct is safe to replace or modify but
// should not be done so concurrently.
var ListOptionValueJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *ListOptionValue) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := ListOptionValueJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*ListOptionValue)(nil)
// ListOptionValueJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of ListOptionValue. This struct is safe to replace or modify but
// should not be done so concurrently.
var ListOptionValueJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *ListOptionValue) UnmarshalJSON(b []byte) error {
return ListOptionValueJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*ListOptionValue)(nil)
// CollectionValueJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of CollectionValue. This struct is safe to replace or modify but
// should not be done so concurrently.
var CollectionValueJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *CollectionValue) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := CollectionValueJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*CollectionValue)(nil)
// CollectionValueJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of CollectionValue. This struct is safe to replace or modify but
// should not be done so concurrently.
var CollectionValueJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *CollectionValue) UnmarshalJSON(b []byte) error {
return CollectionValueJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*CollectionValue)(nil)
// CollectionOptionJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of CollectionOption. This struct is safe to replace or modify but
// should not be done so concurrently.
var CollectionOptionJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *CollectionOption) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := CollectionOptionJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*CollectionOption)(nil)
// CollectionOptionJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of CollectionOption. This struct is safe to replace or modify but
// should not be done so concurrently.
var CollectionOptionJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *CollectionOption) UnmarshalJSON(b []byte) error {
return CollectionOptionJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*CollectionOption)(nil)
@@ -0,0 +1,43 @@
{
"swagger": "2.0",
"info": {
"title": "qsfera/messages/settings/v0/settings.proto",
"version": "version not set"
},
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {},
"definitions": {
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"rpcStatus": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"$ref": "#/definitions/protobufAny"
}
}
}
}
}
}
@@ -0,0 +1,326 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc (unknown)
// source: qsfera/messages/thumbnails/v0/thumbnails.proto
package v0
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// The file types to which the thumbnail can be encoded to.
type ThumbnailType int32
const (
ThumbnailType_PNG ThumbnailType = 0 // Represents PNG type
ThumbnailType_JPG ThumbnailType = 1 // Represents JPG type
ThumbnailType_GIF ThumbnailType = 2 // Represents GIF type
)
// Enum value maps for ThumbnailType.
var (
ThumbnailType_name = map[int32]string{
0: "PNG",
1: "JPG",
2: "GIF",
}
ThumbnailType_value = map[string]int32{
"PNG": 0,
"JPG": 1,
"GIF": 2,
}
)
func (x ThumbnailType) Enum() *ThumbnailType {
p := new(ThumbnailType)
*p = x
return p
}
func (x ThumbnailType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (ThumbnailType) Descriptor() protoreflect.EnumDescriptor {
return file_qsfera_messages_thumbnails_v0_thumbnails_proto_enumTypes[0].Descriptor()
}
func (ThumbnailType) Type() protoreflect.EnumType {
return &file_qsfera_messages_thumbnails_v0_thumbnails_proto_enumTypes[0]
}
func (x ThumbnailType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use ThumbnailType.Descriptor instead.
func (ThumbnailType) EnumDescriptor() ([]byte, []int) {
return file_qsfera_messages_thumbnails_v0_thumbnails_proto_rawDescGZIP(), []int{0}
}
type WebdavSource struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// REQUIRED.
Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
// REQUIRED.
IsPublicLink bool `protobuf:"varint,2,opt,name=is_public_link,json=isPublicLink,proto3" json:"is_public_link,omitempty"`
// OPTIONAL.
WebdavAuthorization string `protobuf:"bytes,3,opt,name=webdav_authorization,json=webdavAuthorization,proto3" json:"webdav_authorization,omitempty"`
// OPTIONAL.
RevaAuthorization string `protobuf:"bytes,4,opt,name=reva_authorization,json=revaAuthorization,proto3" json:"reva_authorization,omitempty"`
// OPTIONAL.
PublicLinkToken string `protobuf:"bytes,5,opt,name=public_link_token,json=publicLinkToken,proto3" json:"public_link_token,omitempty"`
}
func (x *WebdavSource) Reset() {
*x = WebdavSource{}
if protoimpl.UnsafeEnabled {
mi := &file_qsfera_messages_thumbnails_v0_thumbnails_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *WebdavSource) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*WebdavSource) ProtoMessage() {}
func (x *WebdavSource) ProtoReflect() protoreflect.Message {
mi := &file_qsfera_messages_thumbnails_v0_thumbnails_proto_msgTypes[0]
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 WebdavSource.ProtoReflect.Descriptor instead.
func (*WebdavSource) Descriptor() ([]byte, []int) {
return file_qsfera_messages_thumbnails_v0_thumbnails_proto_rawDescGZIP(), []int{0}
}
func (x *WebdavSource) GetUrl() string {
if x != nil {
return x.Url
}
return ""
}
func (x *WebdavSource) GetIsPublicLink() bool {
if x != nil {
return x.IsPublicLink
}
return false
}
func (x *WebdavSource) GetWebdavAuthorization() string {
if x != nil {
return x.WebdavAuthorization
}
return ""
}
func (x *WebdavSource) GetRevaAuthorization() string {
if x != nil {
return x.RevaAuthorization
}
return ""
}
func (x *WebdavSource) GetPublicLinkToken() string {
if x != nil {
return x.PublicLinkToken
}
return ""
}
type CS3Source struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
Authorization string `protobuf:"bytes,2,opt,name=authorization,proto3" json:"authorization,omitempty"`
}
func (x *CS3Source) Reset() {
*x = CS3Source{}
if protoimpl.UnsafeEnabled {
mi := &file_qsfera_messages_thumbnails_v0_thumbnails_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CS3Source) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CS3Source) ProtoMessage() {}
func (x *CS3Source) ProtoReflect() protoreflect.Message {
mi := &file_qsfera_messages_thumbnails_v0_thumbnails_proto_msgTypes[1]
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 CS3Source.ProtoReflect.Descriptor instead.
func (*CS3Source) Descriptor() ([]byte, []int) {
return file_qsfera_messages_thumbnails_v0_thumbnails_proto_rawDescGZIP(), []int{1}
}
func (x *CS3Source) GetPath() string {
if x != nil {
return x.Path
}
return ""
}
func (x *CS3Source) GetAuthorization() string {
if x != nil {
return x.Authorization
}
return ""
}
var File_qsfera_messages_thumbnails_v0_thumbnails_proto protoreflect.FileDescriptor
var file_qsfera_messages_thumbnails_v0_thumbnails_proto_rawDesc = []byte{
0x0a, 0x31, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x73, 0x2f, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x73, 0x2f,
0x76, 0x30, 0x2f, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x20, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69,
0x6c, 0x73, 0x2e, 0x76, 0x30, 0x22, 0xd4, 0x01, 0x0a, 0x0c, 0x57, 0x65, 0x62, 0x64, 0x61, 0x76,
0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x73, 0x5f, 0x70,
0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08,
0x52, 0x0c, 0x69, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x31,
0x0a, 0x14, 0x77, 0x65, 0x62, 0x64, 0x61, 0x76, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x77, 0x65,
0x62, 0x64, 0x61, 0x76, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x12, 0x2d, 0x0a, 0x12, 0x72, 0x65, 0x76, 0x61, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72,
0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x72,
0x65, 0x76, 0x61, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x12, 0x2a, 0x0a, 0x11, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f,
0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x75, 0x62,
0x6c, 0x69, 0x63, 0x4c, 0x69, 0x6e, 0x6b, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x45, 0x0a, 0x09,
0x43, 0x53, 0x33, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74,
0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x24, 0x0a,
0x0d, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x2a, 0x2a, 0x0a, 0x0d, 0x54, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c,
0x54, 0x79, 0x70, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x4e, 0x47, 0x10, 0x00, 0x12, 0x07, 0x0a,
0x03, 0x4a, 0x50, 0x47, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x47, 0x49, 0x46, 0x10, 0x02, 0x42,
0x51, 0x5a, 0x4f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70,
0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x65, 0x75, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63,
0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x65,
0x6e, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x73, 0x2f, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x73, 0x2f,
0x76, 0x30, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_qsfera_messages_thumbnails_v0_thumbnails_proto_rawDescOnce sync.Once
file_qsfera_messages_thumbnails_v0_thumbnails_proto_rawDescData = file_qsfera_messages_thumbnails_v0_thumbnails_proto_rawDesc
)
func file_qsfera_messages_thumbnails_v0_thumbnails_proto_rawDescGZIP() []byte {
file_qsfera_messages_thumbnails_v0_thumbnails_proto_rawDescOnce.Do(func() {
file_qsfera_messages_thumbnails_v0_thumbnails_proto_rawDescData = protoimpl.X.CompressGZIP(file_qsfera_messages_thumbnails_v0_thumbnails_proto_rawDescData)
})
return file_qsfera_messages_thumbnails_v0_thumbnails_proto_rawDescData
}
var file_qsfera_messages_thumbnails_v0_thumbnails_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_qsfera_messages_thumbnails_v0_thumbnails_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_qsfera_messages_thumbnails_v0_thumbnails_proto_goTypes = []interface{}{
(ThumbnailType)(0), // 0: qsfera.messages.thumbnails.v0.ThumbnailType
(*WebdavSource)(nil), // 1: qsfera.messages.thumbnails.v0.WebdavSource
(*CS3Source)(nil), // 2: qsfera.messages.thumbnails.v0.CS3Source
}
var file_qsfera_messages_thumbnails_v0_thumbnails_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_qsfera_messages_thumbnails_v0_thumbnails_proto_init() }
func file_qsfera_messages_thumbnails_v0_thumbnails_proto_init() {
if File_qsfera_messages_thumbnails_v0_thumbnails_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_qsfera_messages_thumbnails_v0_thumbnails_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*WebdavSource); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_qsfera_messages_thumbnails_v0_thumbnails_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CS3Source); 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{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_qsfera_messages_thumbnails_v0_thumbnails_proto_rawDesc,
NumEnums: 1,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_qsfera_messages_thumbnails_v0_thumbnails_proto_goTypes,
DependencyIndexes: file_qsfera_messages_thumbnails_v0_thumbnails_proto_depIdxs,
EnumInfos: file_qsfera_messages_thumbnails_v0_thumbnails_proto_enumTypes,
MessageInfos: file_qsfera_messages_thumbnails_v0_thumbnails_proto_msgTypes,
}.Build()
File_qsfera_messages_thumbnails_v0_thumbnails_proto = out.File
file_qsfera_messages_thumbnails_v0_thumbnails_proto_rawDesc = nil
file_qsfera_messages_thumbnails_v0_thumbnails_proto_goTypes = nil
file_qsfera_messages_thumbnails_v0_thumbnails_proto_depIdxs = nil
}
@@ -0,0 +1,15 @@
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: qsfera/messages/thumbnails/v0/thumbnails.proto
package v0
import (
fmt "fmt"
proto "google.golang.org/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
@@ -0,0 +1,43 @@
{
"swagger": "2.0",
"info": {
"title": "qsfera/messages/thumbnails/v0/thumbnails.proto",
"version": "version not set"
},
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {},
"definitions": {
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"rpcStatus": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"$ref": "#/definitions/protobufAny"
}
}
}
}
}
}
@@ -0,0 +1,335 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc (unknown)
// source: qsfera/services/eventhistory/v0/eventhistory.proto
package v0
import (
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
v0 "github.com/qsfera/server/protogen/gen/qsfera/messages/eventhistory/v0"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// A request to retrieve events
type GetEventsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// the ids of the events we want to get
Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"`
}
func (x *GetEventsRequest) Reset() {
*x = GetEventsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_qsfera_services_eventhistory_v0_eventhistory_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetEventsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetEventsRequest) ProtoMessage() {}
func (x *GetEventsRequest) ProtoReflect() protoreflect.Message {
mi := &file_qsfera_services_eventhistory_v0_eventhistory_proto_msgTypes[0]
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 GetEventsRequest.ProtoReflect.Descriptor instead.
func (*GetEventsRequest) Descriptor() ([]byte, []int) {
return file_qsfera_services_eventhistory_v0_eventhistory_proto_rawDescGZIP(), []int{0}
}
func (x *GetEventsRequest) GetIds() []string {
if x != nil {
return x.Ids
}
return nil
}
// A request to retrieve events belonging to a userID
type GetEventsForUserRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// the userID of the events we want to get
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty"`
}
func (x *GetEventsForUserRequest) Reset() {
*x = GetEventsForUserRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_qsfera_services_eventhistory_v0_eventhistory_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetEventsForUserRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetEventsForUserRequest) ProtoMessage() {}
func (x *GetEventsForUserRequest) ProtoReflect() protoreflect.Message {
mi := &file_qsfera_services_eventhistory_v0_eventhistory_proto_msgTypes[1]
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 GetEventsForUserRequest.ProtoReflect.Descriptor instead.
func (*GetEventsForUserRequest) Descriptor() ([]byte, []int) {
return file_qsfera_services_eventhistory_v0_eventhistory_proto_rawDescGZIP(), []int{1}
}
func (x *GetEventsForUserRequest) GetUserID() string {
if x != nil {
return x.UserID
}
return ""
}
// The service response
type GetEventsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Events []*v0.Event `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"`
}
func (x *GetEventsResponse) Reset() {
*x = GetEventsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_qsfera_services_eventhistory_v0_eventhistory_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetEventsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetEventsResponse) ProtoMessage() {}
func (x *GetEventsResponse) ProtoReflect() protoreflect.Message {
mi := &file_qsfera_services_eventhistory_v0_eventhistory_proto_msgTypes[2]
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 GetEventsResponse.ProtoReflect.Descriptor instead.
func (*GetEventsResponse) Descriptor() ([]byte, []int) {
return file_qsfera_services_eventhistory_v0_eventhistory_proto_rawDescGZIP(), []int{2}
}
func (x *GetEventsResponse) GetEvents() []*v0.Event {
if x != nil {
return x.Events
}
return nil
}
var File_qsfera_services_eventhistory_v0_eventhistory_proto protoreflect.FileDescriptor
var file_qsfera_services_eventhistory_v0_eventhistory_proto_rawDesc = []byte{
0x0a, 0x35, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x73, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x73, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72,
0x79, 0x2f, 0x76, 0x30, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72,
0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x22, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f,
0x75, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e,
0x74, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x76, 0x30, 0x1a, 0x35, 0x6f, 0x70, 0x65,
0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2f,
0x65, 0x76, 0x65, 0x6e, 0x74, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x76, 0x30, 0x2f,
0x65, 0x76, 0x65, 0x6e, 0x74, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f,
0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x22, 0x24, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20,
0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0x31, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x45,
0x76, 0x65, 0x6e, 0x74, 0x73, 0x46, 0x6f, 0x72, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, 0x56, 0x0a, 0x11, 0x47,
0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x41, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x29, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6d, 0x65, 0x73,
0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x68, 0x69, 0x73, 0x74, 0x6f,
0x72, 0x79, 0x2e, 0x76, 0x30, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x65, 0x76, 0x65,
0x6e, 0x74, 0x73, 0x32, 0x98, 0x02, 0x0a, 0x13, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x69, 0x73,
0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x78, 0x0a, 0x09, 0x47,
0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x34, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63,
0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x65, 0x76,
0x65, 0x6e, 0x74, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x76, 0x30, 0x2e, 0x47, 0x65,
0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35,
0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79,
0x2e, 0x76, 0x30, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x86, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65,
0x6e, 0x74, 0x73, 0x46, 0x6f, 0x72, 0x55, 0x73, 0x65, 0x72, 0x12, 0x3b, 0x2e, 0x6f, 0x70, 0x65,
0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e,
0x65, 0x76, 0x65, 0x6e, 0x74, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x76, 0x30, 0x2e,
0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x46, 0x6f, 0x72, 0x55, 0x73, 0x65, 0x72,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65,
0x6e, 0x74, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x76, 0x30, 0x2e, 0x47, 0x65, 0x74,
0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x85,
0x03, 0x5a, 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70,
0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x65, 0x75, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63,
0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x65,
0x6e, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x73, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x73, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72,
0x79, 0x2f, 0x76, 0x30, 0x92, 0x41, 0xae, 0x02, 0x12, 0xbd, 0x01, 0x0a, 0x16, 0x4f, 0x70, 0x65,
0x6e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x68, 0x69, 0x73, 0x74,
0x6f, 0x72, 0x79, 0x22, 0x51, 0x0a, 0x0e, 0x4f, 0x70, 0x65, 0x6e, 0x43, 0x6c, 0x6f, 0x75, 0x64,
0x20, 0x47, 0x6d, 0x62, 0x48, 0x12, 0x29, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2d, 0x65, 0x75, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
0x1a, 0x14, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x40, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2e, 0x65, 0x75, 0x2a, 0x49, 0x0a, 0x0a, 0x41, 0x70, 0x61, 0x63, 0x68, 0x65,
0x2d, 0x32, 0x2e, 0x30, 0x12, 0x3b, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69,
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f,
0x75, 0x64, 0x2d, 0x65, 0x75, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f,
0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, 0x69, 0x6e, 0x2f, 0x4c, 0x49, 0x43, 0x45, 0x4e, 0x53,
0x45, 0x32, 0x05, 0x31, 0x2e, 0x30, 0x2e, 0x30, 0x2a, 0x02, 0x01, 0x02, 0x32, 0x10, 0x61, 0x70,
0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10,
0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e,
0x72, 0x44, 0x0a, 0x10, 0x44, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x20, 0x4d, 0x61,
0x6e, 0x75, 0x61, 0x6c, 0x12, 0x30, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64, 0x6f,
0x63, 0x73, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x65, 0x75, 0x2f,
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x68, 0x69,
0x73, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_qsfera_services_eventhistory_v0_eventhistory_proto_rawDescOnce sync.Once
file_qsfera_services_eventhistory_v0_eventhistory_proto_rawDescData = file_qsfera_services_eventhistory_v0_eventhistory_proto_rawDesc
)
func file_qsfera_services_eventhistory_v0_eventhistory_proto_rawDescGZIP() []byte {
file_qsfera_services_eventhistory_v0_eventhistory_proto_rawDescOnce.Do(func() {
file_qsfera_services_eventhistory_v0_eventhistory_proto_rawDescData = protoimpl.X.CompressGZIP(file_qsfera_services_eventhistory_v0_eventhistory_proto_rawDescData)
})
return file_qsfera_services_eventhistory_v0_eventhistory_proto_rawDescData
}
var file_qsfera_services_eventhistory_v0_eventhistory_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_qsfera_services_eventhistory_v0_eventhistory_proto_goTypes = []interface{}{
(*GetEventsRequest)(nil), // 0: qsfera.services.eventhistory.v0.GetEventsRequest
(*GetEventsForUserRequest)(nil), // 1: qsfera.services.eventhistory.v0.GetEventsForUserRequest
(*GetEventsResponse)(nil), // 2: qsfera.services.eventhistory.v0.GetEventsResponse
(*v0.Event)(nil), // 3: qsfera.messages.eventhistory.v0.Event
}
var file_qsfera_services_eventhistory_v0_eventhistory_proto_depIdxs = []int32{
3, // 0: qsfera.services.eventhistory.v0.GetEventsResponse.events:type_name -> qsfera.messages.eventhistory.v0.Event
0, // 1: qsfera.services.eventhistory.v0.EventHistoryService.GetEvents:input_type -> qsfera.services.eventhistory.v0.GetEventsRequest
1, // 2: qsfera.services.eventhistory.v0.EventHistoryService.GetEventsForUser:input_type -> qsfera.services.eventhistory.v0.GetEventsForUserRequest
2, // 3: qsfera.services.eventhistory.v0.EventHistoryService.GetEvents:output_type -> qsfera.services.eventhistory.v0.GetEventsResponse
2, // 4: qsfera.services.eventhistory.v0.EventHistoryService.GetEventsForUser:output_type -> qsfera.services.eventhistory.v0.GetEventsResponse
3, // [3:5] is the sub-list for method output_type
1, // [1:3] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_qsfera_services_eventhistory_v0_eventhistory_proto_init() }
func file_qsfera_services_eventhistory_v0_eventhistory_proto_init() {
if File_qsfera_services_eventhistory_v0_eventhistory_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_qsfera_services_eventhistory_v0_eventhistory_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetEventsRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_qsfera_services_eventhistory_v0_eventhistory_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetEventsForUserRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_qsfera_services_eventhistory_v0_eventhistory_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetEventsResponse); 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{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_qsfera_services_eventhistory_v0_eventhistory_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_qsfera_services_eventhistory_v0_eventhistory_proto_goTypes,
DependencyIndexes: file_qsfera_services_eventhistory_v0_eventhistory_proto_depIdxs,
MessageInfos: file_qsfera_services_eventhistory_v0_eventhistory_proto_msgTypes,
}.Build()
File_qsfera_services_eventhistory_v0_eventhistory_proto = out.File
file_qsfera_services_eventhistory_v0_eventhistory_proto_rawDesc = nil
file_qsfera_services_eventhistory_v0_eventhistory_proto_goTypes = nil
file_qsfera_services_eventhistory_v0_eventhistory_proto_depIdxs = nil
}
@@ -0,0 +1,110 @@
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: qsfera/services/eventhistory/v0/eventhistory.proto
package v0
import (
fmt "fmt"
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
_ "github.com/qsfera/server/protogen/gen/qsfera/messages/eventhistory/v0"
proto "google.golang.org/protobuf/proto"
math "math"
)
import (
context "context"
api "go-micro.dev/v4/api"
client "go-micro.dev/v4/client"
server "go-micro.dev/v4/server"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// Reference imports to suppress errors if they are not otherwise used.
var _ api.Endpoint
var _ context.Context
var _ client.Option
var _ server.Option
// Api Endpoints for EventHistoryService service
func NewEventHistoryServiceEndpoints() []*api.Endpoint {
return []*api.Endpoint{}
}
// Client API for EventHistoryService service
type EventHistoryService interface {
// returns the specified events
GetEvents(ctx context.Context, in *GetEventsRequest, opts ...client.CallOption) (*GetEventsResponse, error)
// returns all events for the specified userID
GetEventsForUser(ctx context.Context, in *GetEventsForUserRequest, opts ...client.CallOption) (*GetEventsResponse, error)
}
type eventHistoryService struct {
c client.Client
name string
}
func NewEventHistoryService(name string, c client.Client) EventHistoryService {
return &eventHistoryService{
c: c,
name: name,
}
}
func (c *eventHistoryService) GetEvents(ctx context.Context, in *GetEventsRequest, opts ...client.CallOption) (*GetEventsResponse, error) {
req := c.c.NewRequest(c.name, "EventHistoryService.GetEvents", in)
out := new(GetEventsResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *eventHistoryService) GetEventsForUser(ctx context.Context, in *GetEventsForUserRequest, opts ...client.CallOption) (*GetEventsResponse, error) {
req := c.c.NewRequest(c.name, "EventHistoryService.GetEventsForUser", in)
out := new(GetEventsResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for EventHistoryService service
type EventHistoryServiceHandler interface {
// returns the specified events
GetEvents(context.Context, *GetEventsRequest, *GetEventsResponse) error
// returns all events for the specified userID
GetEventsForUser(context.Context, *GetEventsForUserRequest, *GetEventsResponse) error
}
func RegisterEventHistoryServiceHandler(s server.Server, hdlr EventHistoryServiceHandler, opts ...server.HandlerOption) error {
type eventHistoryService interface {
GetEvents(ctx context.Context, in *GetEventsRequest, out *GetEventsResponse) error
GetEventsForUser(ctx context.Context, in *GetEventsForUserRequest, out *GetEventsResponse) error
}
type EventHistoryService struct {
eventHistoryService
}
h := &eventHistoryServiceHandler{hdlr}
return s.Handle(s.NewHandler(&EventHistoryService{h}, opts...))
}
type eventHistoryServiceHandler struct {
EventHistoryServiceHandler
}
func (h *eventHistoryServiceHandler) GetEvents(ctx context.Context, in *GetEventsRequest, out *GetEventsResponse) error {
return h.EventHistoryServiceHandler.GetEvents(ctx, in, out)
}
func (h *eventHistoryServiceHandler) GetEventsForUser(ctx context.Context, in *GetEventsForUserRequest, out *GetEventsResponse) error {
return h.EventHistoryServiceHandler.GetEventsForUser(ctx, in, out)
}
@@ -0,0 +1,95 @@
{
"swagger": "2.0",
"info": {
"title": "КуСфера eventhistory",
"version": "1.0.0",
"contact": {
"name": "КуСфера",
"url": "",
"email": ""
},
"license": {
"name": "Apache-2.0",
"url": ""
}
},
"tags": [
{
"name": "EventHistoryService"
}
],
"schemes": [
"http",
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {},
"definitions": {
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"rpcStatus": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"$ref": "#/definitions/protobufAny"
}
}
}
},
"v0Event": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "REQUIRED."
},
"id": {
"type": "string",
"description": "REQUIRED."
},
"event": {
"type": "string",
"format": "byte",
"title": "REQUIRED"
}
}
},
"v0GetEventsResponse": {
"type": "object",
"properties": {
"events": {
"type": "array",
"items": {
"$ref": "#/definitions/v0Event"
}
}
},
"title": "The service response"
}
},
"externalDocs": {
"description": "Developer Manual",
"url": ""
}
}
@@ -0,0 +1,167 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc (unknown)
// source: qsfera/services/eventhistory/v0/eventhistory.proto
package v0
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
EventHistoryService_GetEvents_FullMethodName = "/qsfera.services.eventhistory.v0.EventHistoryService/GetEvents"
EventHistoryService_GetEventsForUser_FullMethodName = "/qsfera.services.eventhistory.v0.EventHistoryService/GetEventsForUser"
)
// EventHistoryServiceClient is the client API for EventHistoryService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// A Service for storing events
type EventHistoryServiceClient interface {
// returns the specified events
GetEvents(ctx context.Context, in *GetEventsRequest, opts ...grpc.CallOption) (*GetEventsResponse, error)
// returns all events for the specified userID
GetEventsForUser(ctx context.Context, in *GetEventsForUserRequest, opts ...grpc.CallOption) (*GetEventsResponse, error)
}
type eventHistoryServiceClient struct {
cc grpc.ClientConnInterface
}
func NewEventHistoryServiceClient(cc grpc.ClientConnInterface) EventHistoryServiceClient {
return &eventHistoryServiceClient{cc}
}
func (c *eventHistoryServiceClient) GetEvents(ctx context.Context, in *GetEventsRequest, opts ...grpc.CallOption) (*GetEventsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetEventsResponse)
err := c.cc.Invoke(ctx, EventHistoryService_GetEvents_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *eventHistoryServiceClient) GetEventsForUser(ctx context.Context, in *GetEventsForUserRequest, opts ...grpc.CallOption) (*GetEventsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetEventsResponse)
err := c.cc.Invoke(ctx, EventHistoryService_GetEventsForUser_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// EventHistoryServiceServer is the server API for EventHistoryService service.
// All implementations must embed UnimplementedEventHistoryServiceServer
// for forward compatibility.
//
// A Service for storing events
type EventHistoryServiceServer interface {
// returns the specified events
GetEvents(context.Context, *GetEventsRequest) (*GetEventsResponse, error)
// returns all events for the specified userID
GetEventsForUser(context.Context, *GetEventsForUserRequest) (*GetEventsResponse, error)
mustEmbedUnimplementedEventHistoryServiceServer()
}
// UnimplementedEventHistoryServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedEventHistoryServiceServer struct{}
func (UnimplementedEventHistoryServiceServer) GetEvents(context.Context, *GetEventsRequest) (*GetEventsResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetEvents not implemented")
}
func (UnimplementedEventHistoryServiceServer) GetEventsForUser(context.Context, *GetEventsForUserRequest) (*GetEventsResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetEventsForUser not implemented")
}
func (UnimplementedEventHistoryServiceServer) mustEmbedUnimplementedEventHistoryServiceServer() {}
func (UnimplementedEventHistoryServiceServer) testEmbeddedByValue() {}
// UnsafeEventHistoryServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to EventHistoryServiceServer will
// result in compilation errors.
type UnsafeEventHistoryServiceServer interface {
mustEmbedUnimplementedEventHistoryServiceServer()
}
func RegisterEventHistoryServiceServer(s grpc.ServiceRegistrar, srv EventHistoryServiceServer) {
// If the following call panics, it indicates UnimplementedEventHistoryServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&EventHistoryService_ServiceDesc, srv)
}
func _EventHistoryService_GetEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetEventsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EventHistoryServiceServer).GetEvents(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: EventHistoryService_GetEvents_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EventHistoryServiceServer).GetEvents(ctx, req.(*GetEventsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _EventHistoryService_GetEventsForUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetEventsForUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EventHistoryServiceServer).GetEventsForUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: EventHistoryService_GetEventsForUser_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EventHistoryServiceServer).GetEventsForUser(ctx, req.(*GetEventsForUserRequest))
}
return interceptor(ctx, in, info, handler)
}
// EventHistoryService_ServiceDesc is the grpc.ServiceDesc for EventHistoryService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var EventHistoryService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "qsfera.services.eventhistory.v0.EventHistoryService",
HandlerType: (*EventHistoryServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetEvents",
Handler: _EventHistoryService_GetEvents_Handler,
},
{
MethodName: "GetEventsForUser",
Handler: _EventHistoryService_GetEventsForUser_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "qsfera/services/eventhistory/v0/eventhistory.proto",
}
@@ -0,0 +1,206 @@
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"context"
"github.com/qsfera/server/protogen/gen/qsfera/services/eventhistory/v0"
mock "github.com/stretchr/testify/mock"
"go-micro.dev/v4/client"
)
// NewEventHistoryService creates a new instance of EventHistoryService. 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 NewEventHistoryService(t interface {
mock.TestingT
Cleanup(func())
}) *EventHistoryService {
mock := &EventHistoryService{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// EventHistoryService is an autogenerated mock type for the EventHistoryService type
type EventHistoryService struct {
mock.Mock
}
type EventHistoryService_Expecter struct {
mock *mock.Mock
}
func (_m *EventHistoryService) EXPECT() *EventHistoryService_Expecter {
return &EventHistoryService_Expecter{mock: &_m.Mock}
}
// GetEvents provides a mock function for the type EventHistoryService
func (_mock *EventHistoryService) GetEvents(ctx context.Context, in *v0.GetEventsRequest, opts ...client.CallOption) (*v0.GetEventsResponse, error) {
var tmpRet mock.Arguments
if len(opts) > 0 {
tmpRet = _mock.Called(ctx, in, opts)
} else {
tmpRet = _mock.Called(ctx, in)
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for GetEvents")
}
var r0 *v0.GetEventsResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetEventsRequest, ...client.CallOption) (*v0.GetEventsResponse, error)); ok {
return returnFunc(ctx, in, opts...)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetEventsRequest, ...client.CallOption) *v0.GetEventsResponse); ok {
r0 = returnFunc(ctx, in, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v0.GetEventsResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.GetEventsRequest, ...client.CallOption) error); ok {
r1 = returnFunc(ctx, in, opts...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// EventHistoryService_GetEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEvents'
type EventHistoryService_GetEvents_Call struct {
*mock.Call
}
// GetEvents is a helper method to define mock.On call
// - ctx context.Context
// - in *v0.GetEventsRequest
// - opts ...client.CallOption
func (_e *EventHistoryService_Expecter) GetEvents(ctx interface{}, in interface{}, opts ...interface{}) *EventHistoryService_GetEvents_Call {
return &EventHistoryService_GetEvents_Call{Call: _e.mock.On("GetEvents",
append([]interface{}{ctx, in}, opts...)...)}
}
func (_c *EventHistoryService_GetEvents_Call) Run(run func(ctx context.Context, in *v0.GetEventsRequest, opts ...client.CallOption)) *EventHistoryService_GetEvents_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *v0.GetEventsRequest
if args[1] != nil {
arg1 = args[1].(*v0.GetEventsRequest)
}
var arg2 []client.CallOption
var variadicArgs []client.CallOption
if len(args) > 2 {
variadicArgs = args[2].([]client.CallOption)
}
arg2 = variadicArgs
run(
arg0,
arg1,
arg2...,
)
})
return _c
}
func (_c *EventHistoryService_GetEvents_Call) Return(getEventsResponse *v0.GetEventsResponse, err error) *EventHistoryService_GetEvents_Call {
_c.Call.Return(getEventsResponse, err)
return _c
}
func (_c *EventHistoryService_GetEvents_Call) RunAndReturn(run func(ctx context.Context, in *v0.GetEventsRequest, opts ...client.CallOption) (*v0.GetEventsResponse, error)) *EventHistoryService_GetEvents_Call {
_c.Call.Return(run)
return _c
}
// GetEventsForUser provides a mock function for the type EventHistoryService
func (_mock *EventHistoryService) GetEventsForUser(ctx context.Context, in *v0.GetEventsForUserRequest, opts ...client.CallOption) (*v0.GetEventsResponse, error) {
var tmpRet mock.Arguments
if len(opts) > 0 {
tmpRet = _mock.Called(ctx, in, opts)
} else {
tmpRet = _mock.Called(ctx, in)
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for GetEventsForUser")
}
var r0 *v0.GetEventsResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetEventsForUserRequest, ...client.CallOption) (*v0.GetEventsResponse, error)); ok {
return returnFunc(ctx, in, opts...)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetEventsForUserRequest, ...client.CallOption) *v0.GetEventsResponse); ok {
r0 = returnFunc(ctx, in, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v0.GetEventsResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.GetEventsForUserRequest, ...client.CallOption) error); ok {
r1 = returnFunc(ctx, in, opts...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// EventHistoryService_GetEventsForUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEventsForUser'
type EventHistoryService_GetEventsForUser_Call struct {
*mock.Call
}
// GetEventsForUser is a helper method to define mock.On call
// - ctx context.Context
// - in *v0.GetEventsForUserRequest
// - opts ...client.CallOption
func (_e *EventHistoryService_Expecter) GetEventsForUser(ctx interface{}, in interface{}, opts ...interface{}) *EventHistoryService_GetEventsForUser_Call {
return &EventHistoryService_GetEventsForUser_Call{Call: _e.mock.On("GetEventsForUser",
append([]interface{}{ctx, in}, opts...)...)}
}
func (_c *EventHistoryService_GetEventsForUser_Call) Run(run func(ctx context.Context, in *v0.GetEventsForUserRequest, opts ...client.CallOption)) *EventHistoryService_GetEventsForUser_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *v0.GetEventsForUserRequest
if args[1] != nil {
arg1 = args[1].(*v0.GetEventsForUserRequest)
}
var arg2 []client.CallOption
var variadicArgs []client.CallOption
if len(args) > 2 {
variadicArgs = args[2].([]client.CallOption)
}
arg2 = variadicArgs
run(
arg0,
arg1,
arg2...,
)
})
return _c
}
func (_c *EventHistoryService_GetEventsForUser_Call) Return(getEventsResponse *v0.GetEventsResponse, err error) *EventHistoryService_GetEventsForUser_Call {
_c.Call.Return(getEventsResponse, err)
return _c
}
func (_c *EventHistoryService_GetEventsForUser_Call) RunAndReturn(run func(ctx context.Context, in *v0.GetEventsForUserRequest, opts ...client.CallOption) (*v0.GetEventsResponse, error)) *EventHistoryService_GetEventsForUser_Call {
_c.Call.Return(run)
return _c
}
@@ -0,0 +1,123 @@
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"context"
"github.com/qsfera/server/protogen/gen/qsfera/services/policies/v0"
mock "github.com/stretchr/testify/mock"
"go-micro.dev/v4/client"
)
// NewPoliciesProviderService creates a new instance of PoliciesProviderService. 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 NewPoliciesProviderService(t interface {
mock.TestingT
Cleanup(func())
}) *PoliciesProviderService {
mock := &PoliciesProviderService{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// PoliciesProviderService is an autogenerated mock type for the PoliciesProviderService type
type PoliciesProviderService struct {
mock.Mock
}
type PoliciesProviderService_Expecter struct {
mock *mock.Mock
}
func (_m *PoliciesProviderService) EXPECT() *PoliciesProviderService_Expecter {
return &PoliciesProviderService_Expecter{mock: &_m.Mock}
}
// Evaluate provides a mock function for the type PoliciesProviderService
func (_mock *PoliciesProviderService) Evaluate(ctx context.Context, in *v0.EvaluateRequest, opts ...client.CallOption) (*v0.EvaluateResponse, error) {
var tmpRet mock.Arguments
if len(opts) > 0 {
tmpRet = _mock.Called(ctx, in, opts)
} else {
tmpRet = _mock.Called(ctx, in)
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for Evaluate")
}
var r0 *v0.EvaluateResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.EvaluateRequest, ...client.CallOption) (*v0.EvaluateResponse, error)); ok {
return returnFunc(ctx, in, opts...)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.EvaluateRequest, ...client.CallOption) *v0.EvaluateResponse); ok {
r0 = returnFunc(ctx, in, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v0.EvaluateResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.EvaluateRequest, ...client.CallOption) error); ok {
r1 = returnFunc(ctx, in, opts...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// PoliciesProviderService_Evaluate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Evaluate'
type PoliciesProviderService_Evaluate_Call struct {
*mock.Call
}
// Evaluate is a helper method to define mock.On call
// - ctx context.Context
// - in *v0.EvaluateRequest
// - opts ...client.CallOption
func (_e *PoliciesProviderService_Expecter) Evaluate(ctx interface{}, in interface{}, opts ...interface{}) *PoliciesProviderService_Evaluate_Call {
return &PoliciesProviderService_Evaluate_Call{Call: _e.mock.On("Evaluate",
append([]interface{}{ctx, in}, opts...)...)}
}
func (_c *PoliciesProviderService_Evaluate_Call) Run(run func(ctx context.Context, in *v0.EvaluateRequest, opts ...client.CallOption)) *PoliciesProviderService_Evaluate_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *v0.EvaluateRequest
if args[1] != nil {
arg1 = args[1].(*v0.EvaluateRequest)
}
var arg2 []client.CallOption
var variadicArgs []client.CallOption
if len(args) > 2 {
variadicArgs = args[2].([]client.CallOption)
}
arg2 = variadicArgs
run(
arg0,
arg1,
arg2...,
)
})
return _c
}
func (_c *PoliciesProviderService_Evaluate_Call) Return(evaluateResponse *v0.EvaluateResponse, err error) *PoliciesProviderService_Evaluate_Call {
_c.Call.Return(evaluateResponse, err)
return _c
}
func (_c *PoliciesProviderService_Evaluate_Call) RunAndReturn(run func(ctx context.Context, in *v0.EvaluateRequest, opts ...client.CallOption) (*v0.EvaluateResponse, error)) *PoliciesProviderService_Evaluate_Call {
_c.Call.Return(run)
return _c
}
@@ -0,0 +1,269 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc (unknown)
// source: qsfera/services/policies/v0/policies.proto
package v0
import (
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
v0 "github.com/qsfera/server/protogen/gen/qsfera/messages/policies/v0"
_ "google.golang.org/genproto/googleapis/api/annotations"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type EvaluateRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
Environment *v0.Environment `protobuf:"bytes,2,opt,name=environment,proto3" json:"environment,omitempty"`
}
func (x *EvaluateRequest) Reset() {
*x = EvaluateRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_qsfera_services_policies_v0_policies_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *EvaluateRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*EvaluateRequest) ProtoMessage() {}
func (x *EvaluateRequest) ProtoReflect() protoreflect.Message {
mi := &file_qsfera_services_policies_v0_policies_proto_msgTypes[0]
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 EvaluateRequest.ProtoReflect.Descriptor instead.
func (*EvaluateRequest) Descriptor() ([]byte, []int) {
return file_qsfera_services_policies_v0_policies_proto_rawDescGZIP(), []int{0}
}
func (x *EvaluateRequest) GetQuery() string {
if x != nil {
return x.Query
}
return ""
}
func (x *EvaluateRequest) GetEnvironment() *v0.Environment {
if x != nil {
return x.Environment
}
return nil
}
type EvaluateResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Result bool `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"`
}
func (x *EvaluateResponse) Reset() {
*x = EvaluateResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_qsfera_services_policies_v0_policies_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *EvaluateResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*EvaluateResponse) ProtoMessage() {}
func (x *EvaluateResponse) ProtoReflect() protoreflect.Message {
mi := &file_qsfera_services_policies_v0_policies_proto_msgTypes[1]
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 EvaluateResponse.ProtoReflect.Descriptor instead.
func (*EvaluateResponse) Descriptor() ([]byte, []int) {
return file_qsfera_services_policies_v0_policies_proto_rawDescGZIP(), []int{1}
}
func (x *EvaluateResponse) GetResult() bool {
if x != nil {
return x.Result
}
return false
}
var File_qsfera_services_policies_v0_policies_proto protoreflect.FileDescriptor
var file_qsfera_services_policies_v0_policies_proto_rawDesc = []byte{
0x0a, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x73, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x76, 0x30,
0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x1e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2e, 0x76, 0x30, 0x1a,
0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x76, 0x30, 0x2f,
0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61,
0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e,
0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x76, 0x0a, 0x0f,
0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x4d, 0x0a, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e,
0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6f, 0x70, 0x65,
0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e,
0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x45, 0x6e, 0x76, 0x69,
0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e,
0x6d, 0x65, 0x6e, 0x74, 0x22, 0x2a, 0x0a, 0x10, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x65,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75,
0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74,
0x32, 0xa8, 0x01, 0x0a, 0x10, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x50, 0x72, 0x6f,
0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x93, 0x01, 0x0a, 0x08, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61,
0x74, 0x65, 0x12, 0x2f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73,
0x2e, 0x76, 0x30, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e,
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65,
0x73, 0x2e, 0x76, 0x30, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a,
0x22, 0x19, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x30, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69,
0x65, 0x73, 0x2f, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x42, 0xf8, 0x02, 0x5a, 0x4c,
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63,
0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x65, 0x75, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75,
0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x6f,
0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x76, 0x30, 0x92, 0x41, 0xa6, 0x02,
0x12, 0xb9, 0x01, 0x0a, 0x12, 0x4f, 0x70, 0x65, 0x6e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x20, 0x70,
0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x22, 0x51, 0x0a, 0x0e, 0x4f, 0x70, 0x65, 0x6e, 0x43,
0x6c, 0x6f, 0x75, 0x64, 0x20, 0x47, 0x6d, 0x62, 0x48, 0x12, 0x29, 0x68, 0x74, 0x74, 0x70, 0x73,
0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70,
0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x65, 0x75, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63,
0x6c, 0x6f, 0x75, 0x64, 0x1a, 0x14, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x40, 0x6f, 0x70,
0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x65, 0x75, 0x2a, 0x49, 0x0a, 0x0a, 0x41, 0x70,
0x61, 0x63, 0x68, 0x65, 0x2d, 0x32, 0x2e, 0x30, 0x12, 0x3b, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a,
0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65,
0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x65, 0x75, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, 0x69, 0x6e, 0x2f, 0x4c, 0x49,
0x43, 0x45, 0x4e, 0x53, 0x45, 0x32, 0x05, 0x31, 0x2e, 0x30, 0x2e, 0x30, 0x2a, 0x02, 0x01, 0x02,
0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73,
0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
0x6a, 0x73, 0x6f, 0x6e, 0x72, 0x40, 0x0a, 0x10, 0x44, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65,
0x72, 0x20, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x12, 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a,
0x2f, 0x2f, 0x64, 0x6f, 0x63, 0x73, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
0x2e, 0x65, 0x75, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x6c,
0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_qsfera_services_policies_v0_policies_proto_rawDescOnce sync.Once
file_qsfera_services_policies_v0_policies_proto_rawDescData = file_qsfera_services_policies_v0_policies_proto_rawDesc
)
func file_qsfera_services_policies_v0_policies_proto_rawDescGZIP() []byte {
file_qsfera_services_policies_v0_policies_proto_rawDescOnce.Do(func() {
file_qsfera_services_policies_v0_policies_proto_rawDescData = protoimpl.X.CompressGZIP(file_qsfera_services_policies_v0_policies_proto_rawDescData)
})
return file_qsfera_services_policies_v0_policies_proto_rawDescData
}
var file_qsfera_services_policies_v0_policies_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_qsfera_services_policies_v0_policies_proto_goTypes = []interface{}{
(*EvaluateRequest)(nil), // 0: qsfera.services.policies.v0.EvaluateRequest
(*EvaluateResponse)(nil), // 1: qsfera.services.policies.v0.EvaluateResponse
(*v0.Environment)(nil), // 2: qsfera.messages.policies.v0.Environment
}
var file_qsfera_services_policies_v0_policies_proto_depIdxs = []int32{
2, // 0: qsfera.services.policies.v0.EvaluateRequest.environment:type_name -> qsfera.messages.policies.v0.Environment
0, // 1: qsfera.services.policies.v0.policiesProvider.Evaluate:input_type -> qsfera.services.policies.v0.EvaluateRequest
1, // 2: qsfera.services.policies.v0.policiesProvider.Evaluate:output_type -> qsfera.services.policies.v0.EvaluateResponse
2, // [2:3] is the sub-list for method output_type
1, // [1:2] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_qsfera_services_policies_v0_policies_proto_init() }
func file_qsfera_services_policies_v0_policies_proto_init() {
if File_qsfera_services_policies_v0_policies_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_qsfera_services_policies_v0_policies_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*EvaluateRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_qsfera_services_policies_v0_policies_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*EvaluateResponse); 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{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_qsfera_services_policies_v0_policies_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_qsfera_services_policies_v0_policies_proto_goTypes,
DependencyIndexes: file_qsfera_services_policies_v0_policies_proto_depIdxs,
MessageInfos: file_qsfera_services_policies_v0_policies_proto_msgTypes,
}.Build()
File_qsfera_services_policies_v0_policies_proto = out.File
file_qsfera_services_policies_v0_policies_proto_rawDesc = nil
file_qsfera_services_policies_v0_policies_proto_goTypes = nil
file_qsfera_services_policies_v0_policies_proto_depIdxs = nil
}
@@ -0,0 +1,103 @@
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: qsfera/services/policies/v0/policies.proto
package v0
import (
fmt "fmt"
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
_ "github.com/qsfera/server/protogen/gen/qsfera/messages/policies/v0"
_ "google.golang.org/genproto/googleapis/api/annotations"
proto "google.golang.org/protobuf/proto"
math "math"
)
import (
context "context"
api "go-micro.dev/v4/api"
client "go-micro.dev/v4/client"
server "go-micro.dev/v4/server"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// Reference imports to suppress errors if they are not otherwise used.
var _ api.Endpoint
var _ context.Context
var _ client.Option
var _ server.Option
// Api Endpoints for PoliciesProvider service
func NewPoliciesProviderEndpoints() []*api.Endpoint {
return []*api.Endpoint{
{
Name: "PoliciesProvider.Evaluate",
Path: []string{"/api/v0/policies/evaluate"},
Method: []string{"POST"},
Handler: "rpc",
},
}
}
// Client API for PoliciesProvider service
type PoliciesProviderService interface {
Evaluate(ctx context.Context, in *EvaluateRequest, opts ...client.CallOption) (*EvaluateResponse, error)
}
type policiesProviderService struct {
c client.Client
name string
}
func NewPoliciesProviderService(name string, c client.Client) PoliciesProviderService {
return &policiesProviderService{
c: c,
name: name,
}
}
func (c *policiesProviderService) Evaluate(ctx context.Context, in *EvaluateRequest, opts ...client.CallOption) (*EvaluateResponse, error) {
req := c.c.NewRequest(c.name, "PoliciesProvider.Evaluate", in)
out := new(EvaluateResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for PoliciesProvider service
type PoliciesProviderHandler interface {
Evaluate(context.Context, *EvaluateRequest, *EvaluateResponse) error
}
func RegisterPoliciesProviderHandler(s server.Server, hdlr PoliciesProviderHandler, opts ...server.HandlerOption) error {
type policiesProvider interface {
Evaluate(ctx context.Context, in *EvaluateRequest, out *EvaluateResponse) error
}
type PoliciesProvider struct {
policiesProvider
}
h := &policiesProviderHandler{hdlr}
opts = append(opts, api.WithEndpoint(&api.Endpoint{
Name: "PoliciesProvider.Evaluate",
Path: []string{"/api/v0/policies/evaluate"},
Method: []string{"POST"},
Handler: "rpc",
}))
return s.Handle(s.NewHandler(&PoliciesProvider{h}, opts...))
}
type policiesProviderHandler struct {
PoliciesProviderHandler
}
func (h *policiesProviderHandler) Evaluate(ctx context.Context, in *EvaluateRequest, out *EvaluateResponse) error {
return h.PoliciesProviderHandler.Evaluate(ctx, in, out)
}
@@ -0,0 +1,216 @@
{
"swagger": "2.0",
"info": {
"title": "КуСфера policies",
"version": "1.0.0",
"contact": {
"name": "КуСфера",
"url": "",
"email": ""
},
"license": {
"name": "Apache-2.0",
"url": ""
}
},
"tags": [
{
"name": "policiesProvider"
}
],
"schemes": [
"http",
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/api/v0/policies/evaluate": {
"post": {
"operationId": "policiesProvider_Evaluate",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v0EvaluateResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v0EvaluateRequest"
}
}
],
"tags": [
"policiesProvider"
]
}
}
},
"definitions": {
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"rpcStatus": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"$ref": "#/definitions/protobufAny"
}
}
}
},
"v0Environment": {
"type": "object",
"properties": {
"stage": {
"$ref": "#/definitions/v0Stage"
},
"user": {
"$ref": "#/definitions/v0User"
},
"request": {
"$ref": "#/definitions/v0Request"
},
"resource": {
"$ref": "#/definitions/v0Resource"
}
}
},
"v0EvaluateRequest": {
"type": "object",
"properties": {
"query": {
"type": "string"
},
"environment": {
"$ref": "#/definitions/v0Environment"
}
}
},
"v0EvaluateResponse": {
"type": "object",
"properties": {
"result": {
"type": "boolean"
}
}
},
"v0Request": {
"type": "object",
"properties": {
"method": {
"type": "string"
},
"path": {
"type": "string"
}
}
},
"v0Resource": {
"type": "object",
"properties": {
"id": {
"$ref": "#/definitions/v0ResourceID"
},
"name": {
"type": "string"
},
"size": {
"type": "string",
"format": "uint64"
},
"url": {
"type": "string"
}
}
},
"v0ResourceID": {
"type": "object",
"properties": {
"storageId": {
"type": "string"
},
"opaqueId": {
"type": "string"
},
"spaceId": {
"type": "string"
}
}
},
"v0Stage": {
"type": "string",
"enum": [
"STAGE_PP",
"STAGE_HTTP"
],
"default": "STAGE_PP"
},
"v0User": {
"type": "object",
"properties": {
"id": {
"$ref": "#/definitions/v0UserID"
},
"username": {
"type": "string"
},
"mail": {
"type": "string"
},
"displayName": {
"type": "string"
},
"groups": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"v0UserID": {
"type": "object",
"properties": {
"opaqueId": {
"type": "string"
}
}
}
},
"externalDocs": {
"description": "Developer Manual",
"url": ""
}
}
@@ -0,0 +1,121 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc (unknown)
// source: qsfera/services/policies/v0/policies.proto
package v0
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
PoliciesProvider_Evaluate_FullMethodName = "/qsfera.services.policies.v0.policiesProvider/Evaluate"
)
// PoliciesProviderClient is the client API for PoliciesProvider service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type PoliciesProviderClient interface {
Evaluate(ctx context.Context, in *EvaluateRequest, opts ...grpc.CallOption) (*EvaluateResponse, error)
}
type policiesProviderClient struct {
cc grpc.ClientConnInterface
}
func NewPoliciesProviderClient(cc grpc.ClientConnInterface) PoliciesProviderClient {
return &policiesProviderClient{cc}
}
func (c *policiesProviderClient) Evaluate(ctx context.Context, in *EvaluateRequest, opts ...grpc.CallOption) (*EvaluateResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(EvaluateResponse)
err := c.cc.Invoke(ctx, PoliciesProvider_Evaluate_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// PoliciesProviderServer is the server API for PoliciesProvider service.
// All implementations must embed UnimplementedPoliciesProviderServer
// for forward compatibility.
type PoliciesProviderServer interface {
Evaluate(context.Context, *EvaluateRequest) (*EvaluateResponse, error)
mustEmbedUnimplementedPoliciesProviderServer()
}
// UnimplementedPoliciesProviderServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedPoliciesProviderServer struct{}
func (UnimplementedPoliciesProviderServer) Evaluate(context.Context, *EvaluateRequest) (*EvaluateResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Evaluate not implemented")
}
func (UnimplementedPoliciesProviderServer) mustEmbedUnimplementedPoliciesProviderServer() {}
func (UnimplementedPoliciesProviderServer) testEmbeddedByValue() {}
// UnsafePoliciesProviderServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to PoliciesProviderServer will
// result in compilation errors.
type UnsafePoliciesProviderServer interface {
mustEmbedUnimplementedPoliciesProviderServer()
}
func RegisterPoliciesProviderServer(s grpc.ServiceRegistrar, srv PoliciesProviderServer) {
// If the following call panics, it indicates UnimplementedPoliciesProviderServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&PoliciesProvider_ServiceDesc, srv)
}
func _PoliciesProvider_Evaluate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EvaluateRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PoliciesProviderServer).Evaluate(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: PoliciesProvider_Evaluate_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PoliciesProviderServer).Evaluate(ctx, req.(*EvaluateRequest))
}
return interceptor(ctx, in, info, handler)
}
// PoliciesProvider_ServiceDesc is the grpc.ServiceDesc for PoliciesProvider service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var PoliciesProvider_ServiceDesc = grpc.ServiceDesc{
ServiceName: "qsfera.services.policies.v0.policiesProvider",
HandlerType: (*PoliciesProviderServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Evaluate",
Handler: _PoliciesProvider_Evaluate_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "qsfera/services/policies/v0/policies.proto",
}
@@ -0,0 +1,206 @@
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"context"
"github.com/qsfera/server/protogen/gen/qsfera/services/search/v0"
mock "github.com/stretchr/testify/mock"
"go-micro.dev/v4/client"
)
// NewSearchProviderService creates a new instance of SearchProviderService. 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 NewSearchProviderService(t interface {
mock.TestingT
Cleanup(func())
}) *SearchProviderService {
mock := &SearchProviderService{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// SearchProviderService is an autogenerated mock type for the SearchProviderService type
type SearchProviderService struct {
mock.Mock
}
type SearchProviderService_Expecter struct {
mock *mock.Mock
}
func (_m *SearchProviderService) EXPECT() *SearchProviderService_Expecter {
return &SearchProviderService_Expecter{mock: &_m.Mock}
}
// IndexSpace provides a mock function for the type SearchProviderService
func (_mock *SearchProviderService) IndexSpace(ctx context.Context, in *v0.IndexSpaceRequest, opts ...client.CallOption) (*v0.IndexSpaceResponse, error) {
var tmpRet mock.Arguments
if len(opts) > 0 {
tmpRet = _mock.Called(ctx, in, opts)
} else {
tmpRet = _mock.Called(ctx, in)
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for IndexSpace")
}
var r0 *v0.IndexSpaceResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.IndexSpaceRequest, ...client.CallOption) (*v0.IndexSpaceResponse, error)); ok {
return returnFunc(ctx, in, opts...)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.IndexSpaceRequest, ...client.CallOption) *v0.IndexSpaceResponse); ok {
r0 = returnFunc(ctx, in, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v0.IndexSpaceResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.IndexSpaceRequest, ...client.CallOption) error); ok {
r1 = returnFunc(ctx, in, opts...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// SearchProviderService_IndexSpace_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IndexSpace'
type SearchProviderService_IndexSpace_Call struct {
*mock.Call
}
// IndexSpace is a helper method to define mock.On call
// - ctx context.Context
// - in *v0.IndexSpaceRequest
// - opts ...client.CallOption
func (_e *SearchProviderService_Expecter) IndexSpace(ctx interface{}, in interface{}, opts ...interface{}) *SearchProviderService_IndexSpace_Call {
return &SearchProviderService_IndexSpace_Call{Call: _e.mock.On("IndexSpace",
append([]interface{}{ctx, in}, opts...)...)}
}
func (_c *SearchProviderService_IndexSpace_Call) Run(run func(ctx context.Context, in *v0.IndexSpaceRequest, opts ...client.CallOption)) *SearchProviderService_IndexSpace_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *v0.IndexSpaceRequest
if args[1] != nil {
arg1 = args[1].(*v0.IndexSpaceRequest)
}
var arg2 []client.CallOption
var variadicArgs []client.CallOption
if len(args) > 2 {
variadicArgs = args[2].([]client.CallOption)
}
arg2 = variadicArgs
run(
arg0,
arg1,
arg2...,
)
})
return _c
}
func (_c *SearchProviderService_IndexSpace_Call) Return(indexSpaceResponse *v0.IndexSpaceResponse, err error) *SearchProviderService_IndexSpace_Call {
_c.Call.Return(indexSpaceResponse, err)
return _c
}
func (_c *SearchProviderService_IndexSpace_Call) RunAndReturn(run func(ctx context.Context, in *v0.IndexSpaceRequest, opts ...client.CallOption) (*v0.IndexSpaceResponse, error)) *SearchProviderService_IndexSpace_Call {
_c.Call.Return(run)
return _c
}
// Search provides a mock function for the type SearchProviderService
func (_mock *SearchProviderService) Search(ctx context.Context, in *v0.SearchRequest, opts ...client.CallOption) (*v0.SearchResponse, error) {
var tmpRet mock.Arguments
if len(opts) > 0 {
tmpRet = _mock.Called(ctx, in, opts)
} else {
tmpRet = _mock.Called(ctx, in)
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for Search")
}
var r0 *v0.SearchResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SearchRequest, ...client.CallOption) (*v0.SearchResponse, error)); ok {
return returnFunc(ctx, in, opts...)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SearchRequest, ...client.CallOption) *v0.SearchResponse); ok {
r0 = returnFunc(ctx, in, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v0.SearchResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.SearchRequest, ...client.CallOption) error); ok {
r1 = returnFunc(ctx, in, opts...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// SearchProviderService_Search_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Search'
type SearchProviderService_Search_Call struct {
*mock.Call
}
// Search is a helper method to define mock.On call
// - ctx context.Context
// - in *v0.SearchRequest
// - opts ...client.CallOption
func (_e *SearchProviderService_Expecter) Search(ctx interface{}, in interface{}, opts ...interface{}) *SearchProviderService_Search_Call {
return &SearchProviderService_Search_Call{Call: _e.mock.On("Search",
append([]interface{}{ctx, in}, opts...)...)}
}
func (_c *SearchProviderService_Search_Call) Run(run func(ctx context.Context, in *v0.SearchRequest, opts ...client.CallOption)) *SearchProviderService_Search_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *v0.SearchRequest
if args[1] != nil {
arg1 = args[1].(*v0.SearchRequest)
}
var arg2 []client.CallOption
var variadicArgs []client.CallOption
if len(args) > 2 {
variadicArgs = args[2].([]client.CallOption)
}
arg2 = variadicArgs
run(
arg0,
arg1,
arg2...,
)
})
return _c
}
func (_c *SearchProviderService_Search_Call) Return(searchResponse *v0.SearchResponse, err error) *SearchProviderService_Search_Call {
_c.Call.Return(searchResponse, err)
return _c
}
func (_c *SearchProviderService_Search_Call) RunAndReturn(run func(ctx context.Context, in *v0.SearchRequest, opts ...client.CallOption) (*v0.SearchResponse, error)) *SearchProviderService_Search_Call {
_c.Call.Return(run)
return _c
}
@@ -0,0 +1,670 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc (unknown)
// source: qsfera/services/search/v0/search.proto
package v0
import (
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
v0 "github.com/qsfera/server/protogen/gen/qsfera/messages/search/v0"
_ "google.golang.org/genproto/googleapis/api/annotations"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
_ "google.golang.org/protobuf/types/known/fieldmaskpb"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type SearchRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Optional. The maximum number of entries to return in the response
PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
// Optional. A pagination token returned from a previous call to `Get`
// that indicates from where search should continue
PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"`
Ref *v0.Reference `protobuf:"bytes,4,opt,name=ref,proto3" json:"ref,omitempty"`
}
func (x *SearchRequest) Reset() {
*x = SearchRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_qsfera_services_search_v0_search_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SearchRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SearchRequest) ProtoMessage() {}
func (x *SearchRequest) ProtoReflect() protoreflect.Message {
mi := &file_qsfera_services_search_v0_search_proto_msgTypes[0]
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 SearchRequest.ProtoReflect.Descriptor instead.
func (*SearchRequest) Descriptor() ([]byte, []int) {
return file_qsfera_services_search_v0_search_proto_rawDescGZIP(), []int{0}
}
func (x *SearchRequest) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
func (x *SearchRequest) GetPageToken() string {
if x != nil {
return x.PageToken
}
return ""
}
func (x *SearchRequest) GetQuery() string {
if x != nil {
return x.Query
}
return ""
}
func (x *SearchRequest) GetRef() *v0.Reference {
if x != nil {
return x.Ref
}
return nil
}
type SearchResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Matches []*v0.Match `protobuf:"bytes,1,rep,name=matches,proto3" json:"matches,omitempty"`
// Token to retrieve the next page of results, or empty if there are no
// more results in the list
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
TotalMatches int32 `protobuf:"varint,3,opt,name=total_matches,json=totalMatches,proto3" json:"total_matches,omitempty"`
}
func (x *SearchResponse) Reset() {
*x = SearchResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_qsfera_services_search_v0_search_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SearchResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SearchResponse) ProtoMessage() {}
func (x *SearchResponse) ProtoReflect() protoreflect.Message {
mi := &file_qsfera_services_search_v0_search_proto_msgTypes[1]
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 SearchResponse.ProtoReflect.Descriptor instead.
func (*SearchResponse) Descriptor() ([]byte, []int) {
return file_qsfera_services_search_v0_search_proto_rawDescGZIP(), []int{1}
}
func (x *SearchResponse) GetMatches() []*v0.Match {
if x != nil {
return x.Matches
}
return nil
}
func (x *SearchResponse) GetNextPageToken() string {
if x != nil {
return x.NextPageToken
}
return ""
}
func (x *SearchResponse) GetTotalMatches() int32 {
if x != nil {
return x.TotalMatches
}
return 0
}
type SearchIndexRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Optional. The maximum number of entries to return in the response
PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
// Optional. A pagination token returned from a previous call to `Get`
// that indicates from where search should continue
PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"`
Ref *v0.Reference `protobuf:"bytes,4,opt,name=ref,proto3" json:"ref,omitempty"`
}
func (x *SearchIndexRequest) Reset() {
*x = SearchIndexRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_qsfera_services_search_v0_search_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SearchIndexRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SearchIndexRequest) ProtoMessage() {}
func (x *SearchIndexRequest) ProtoReflect() protoreflect.Message {
mi := &file_qsfera_services_search_v0_search_proto_msgTypes[2]
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 SearchIndexRequest.ProtoReflect.Descriptor instead.
func (*SearchIndexRequest) Descriptor() ([]byte, []int) {
return file_qsfera_services_search_v0_search_proto_rawDescGZIP(), []int{2}
}
func (x *SearchIndexRequest) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
func (x *SearchIndexRequest) GetPageToken() string {
if x != nil {
return x.PageToken
}
return ""
}
func (x *SearchIndexRequest) GetQuery() string {
if x != nil {
return x.Query
}
return ""
}
func (x *SearchIndexRequest) GetRef() *v0.Reference {
if x != nil {
return x.Ref
}
return nil
}
type SearchIndexResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Matches []*v0.Match `protobuf:"bytes,1,rep,name=matches,proto3" json:"matches,omitempty"`
// Token to retrieve the next page of results, or empty if there are no
// more results in the list
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
TotalMatches int32 `protobuf:"varint,3,opt,name=total_matches,json=totalMatches,proto3" json:"total_matches,omitempty"`
}
func (x *SearchIndexResponse) Reset() {
*x = SearchIndexResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_qsfera_services_search_v0_search_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SearchIndexResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SearchIndexResponse) ProtoMessage() {}
func (x *SearchIndexResponse) ProtoReflect() protoreflect.Message {
mi := &file_qsfera_services_search_v0_search_proto_msgTypes[3]
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 SearchIndexResponse.ProtoReflect.Descriptor instead.
func (*SearchIndexResponse) Descriptor() ([]byte, []int) {
return file_qsfera_services_search_v0_search_proto_rawDescGZIP(), []int{3}
}
func (x *SearchIndexResponse) GetMatches() []*v0.Match {
if x != nil {
return x.Matches
}
return nil
}
func (x *SearchIndexResponse) GetNextPageToken() string {
if x != nil {
return x.NextPageToken
}
return ""
}
func (x *SearchIndexResponse) GetTotalMatches() int32 {
if x != nil {
return x.TotalMatches
}
return 0
}
type IndexSpaceRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
SpaceId string `protobuf:"bytes,1,opt,name=space_id,json=spaceId,proto3" json:"space_id,omitempty"`
UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
ForceReindex bool `protobuf:"varint,3,opt,name=force_reindex,json=forceReindex,proto3" json:"force_reindex,omitempty"`
}
func (x *IndexSpaceRequest) Reset() {
*x = IndexSpaceRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_qsfera_services_search_v0_search_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *IndexSpaceRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IndexSpaceRequest) ProtoMessage() {}
func (x *IndexSpaceRequest) ProtoReflect() protoreflect.Message {
mi := &file_qsfera_services_search_v0_search_proto_msgTypes[4]
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 IndexSpaceRequest.ProtoReflect.Descriptor instead.
func (*IndexSpaceRequest) Descriptor() ([]byte, []int) {
return file_qsfera_services_search_v0_search_proto_rawDescGZIP(), []int{4}
}
func (x *IndexSpaceRequest) GetSpaceId() string {
if x != nil {
return x.SpaceId
}
return ""
}
func (x *IndexSpaceRequest) GetUserId() string {
if x != nil {
return x.UserId
}
return ""
}
func (x *IndexSpaceRequest) GetForceReindex() bool {
if x != nil {
return x.ForceReindex
}
return false
}
type IndexSpaceResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *IndexSpaceResponse) Reset() {
*x = IndexSpaceResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_qsfera_services_search_v0_search_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *IndexSpaceResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IndexSpaceResponse) ProtoMessage() {}
func (x *IndexSpaceResponse) ProtoReflect() protoreflect.Message {
mi := &file_qsfera_services_search_v0_search_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 IndexSpaceResponse.ProtoReflect.Descriptor instead.
func (*IndexSpaceResponse) Descriptor() ([]byte, []int) {
return file_qsfera_services_search_v0_search_proto_rawDescGZIP(), []int{5}
}
var File_qsfera_services_search_v0_search_proto protoreflect.FileDescriptor
var file_qsfera_services_search_v0_search_proto_rawDesc = []byte{
0x0a, 0x29, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x73, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x73, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2f, 0x76, 0x30, 0x2f, 0x73,
0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1c, 0x6f, 0x70, 0x65,
0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e,
0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, 0x30, 0x1a, 0x29, 0x6f, 0x70, 0x65, 0x6e, 0x63,
0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2f, 0x73, 0x65,
0x61, 0x72, 0x63, 0x68, 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e,
0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69,
0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xae, 0x01, 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f,
0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x01,
0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x23, 0x0a, 0x0a, 0x70, 0x61,
0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04,
0xe2, 0x41, 0x01, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12,
0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x3f, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x04, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76,
0x30, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x04, 0xe2, 0x41, 0x01,
0x01, 0x52, 0x03, 0x72, 0x65, 0x66, 0x22, 0x9c, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63,
0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x07, 0x6d, 0x61, 0x74,
0x63, 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6f, 0x70, 0x65,
0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e,
0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, 0x30, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52,
0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74,
0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
0x12, 0x23, 0x0a, 0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65,
0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4d, 0x61,
0x74, 0x63, 0x68, 0x65, 0x73, 0x22, 0xb3, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68,
0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x09,
0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42,
0x04, 0xe2, 0x41, 0x01, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12,
0x23, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54,
0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x3f, 0x0a, 0x03, 0x72, 0x65,
0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61,
0x72, 0x63, 0x68, 0x2e, 0x76, 0x30, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65,
0x42, 0x04, 0xe2, 0x41, 0x01, 0x01, 0x52, 0x03, 0x72, 0x65, 0x66, 0x22, 0xa1, 0x01, 0x0a, 0x13,
0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x18, 0x01,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68,
0x2e, 0x76, 0x30, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68,
0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f,
0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78,
0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x6f,
0x74, 0x61, 0x6c, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28,
0x05, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x22,
0x6c, 0x0a, 0x11, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x70, 0x61, 0x63, 0x65, 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,
0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x6f, 0x72, 0x63,
0x65, 0x5f, 0x72, 0x65, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52,
0x0c, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x52, 0x65, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x14, 0x0a,
0x12, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x32, 0xb1, 0x02, 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x72,
0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x85, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63,
0x68, 0x12, 0x2b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, 0x30,
0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c,
0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, 0x30, 0x2e, 0x53, 0x65,
0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3,
0xe4, 0x93, 0x02, 0x1a, 0x3a, 0x01, 0x2a, 0x22, 0x15, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x30,
0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x96,
0x01, 0x0a, 0x0a, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, 0x2f, 0x2e,
0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, 0x30, 0x2e, 0x49, 0x6e, 0x64,
0x65, 0x78, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30,
0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, 0x30, 0x2e, 0x49, 0x6e,
0x64, 0x65, 0x78, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2f, 0x69, 0x6e, 0x64, 0x65,
0x78, 0x2d, 0x73, 0x70, 0x61, 0x63, 0x65, 0x32, 0xa7, 0x01, 0x0a, 0x0d, 0x49, 0x6e, 0x64, 0x65,
0x78, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x95, 0x01, 0x0a, 0x06, 0x53, 0x65,
0x61, 0x72, 0x63, 0x68, 0x12, 0x30, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68,
0x2e, 0x76, 0x30, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f,
0x75, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72,
0x63, 0x68, 0x2e, 0x76, 0x30, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x65,
0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02,
0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x65,
0x61, 0x72, 0x63, 0x68, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63,
0x68, 0x42, 0xf2, 0x02, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x65, 0x75, 0x2f, 0x6f, 0x70,
0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e,
0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x73,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2f, 0x76, 0x30,
0x92, 0x41, 0xa2, 0x02, 0x12, 0xb7, 0x01, 0x0a, 0x10, 0x4f, 0x70, 0x65, 0x6e, 0x43, 0x6c, 0x6f,
0x75, 0x64, 0x20, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x22, 0x51, 0x0a, 0x0e, 0x4f, 0x70, 0x65,
0x6e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x20, 0x47, 0x6d, 0x62, 0x48, 0x12, 0x29, 0x68, 0x74, 0x74,
0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x65, 0x75, 0x2f, 0x6f, 0x70, 0x65,
0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x1a, 0x14, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x40,
0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x65, 0x75, 0x2a, 0x49, 0x0a, 0x0a,
0x41, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2d, 0x32, 0x2e, 0x30, 0x12, 0x3b, 0x68, 0x74, 0x74, 0x70,
0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f,
0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x65, 0x75, 0x2f, 0x6f, 0x70, 0x65, 0x6e,
0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, 0x69, 0x6e, 0x2f,
0x4c, 0x49, 0x43, 0x45, 0x4e, 0x53, 0x45, 0x32, 0x05, 0x31, 0x2e, 0x30, 0x2e, 0x30, 0x2a, 0x02,
0x01, 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x72, 0x3e, 0x0a, 0x10, 0x44, 0x65, 0x76, 0x65, 0x6c, 0x6f,
0x70, 0x65, 0x72, 0x20, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x12, 0x2a, 0x68, 0x74, 0x74, 0x70,
0x73, 0x3a, 0x2f, 0x2f, 0x64, 0x6f, 0x63, 0x73, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f,
0x75, 0x64, 0x2e, 0x65, 0x75, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x73,
0x65, 0x61, 0x72, 0x63, 0x68, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_qsfera_services_search_v0_search_proto_rawDescOnce sync.Once
file_qsfera_services_search_v0_search_proto_rawDescData = file_qsfera_services_search_v0_search_proto_rawDesc
)
func file_qsfera_services_search_v0_search_proto_rawDescGZIP() []byte {
file_qsfera_services_search_v0_search_proto_rawDescOnce.Do(func() {
file_qsfera_services_search_v0_search_proto_rawDescData = protoimpl.X.CompressGZIP(file_qsfera_services_search_v0_search_proto_rawDescData)
})
return file_qsfera_services_search_v0_search_proto_rawDescData
}
var file_qsfera_services_search_v0_search_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_qsfera_services_search_v0_search_proto_goTypes = []interface{}{
(*SearchRequest)(nil), // 0: qsfera.services.search.v0.SearchRequest
(*SearchResponse)(nil), // 1: qsfera.services.search.v0.SearchResponse
(*SearchIndexRequest)(nil), // 2: qsfera.services.search.v0.SearchIndexRequest
(*SearchIndexResponse)(nil), // 3: qsfera.services.search.v0.SearchIndexResponse
(*IndexSpaceRequest)(nil), // 4: qsfera.services.search.v0.IndexSpaceRequest
(*IndexSpaceResponse)(nil), // 5: qsfera.services.search.v0.IndexSpaceResponse
(*v0.Reference)(nil), // 6: qsfera.messages.search.v0.Reference
(*v0.Match)(nil), // 7: qsfera.messages.search.v0.Match
}
var file_qsfera_services_search_v0_search_proto_depIdxs = []int32{
6, // 0: qsfera.services.search.v0.SearchRequest.ref:type_name -> qsfera.messages.search.v0.Reference
7, // 1: qsfera.services.search.v0.SearchResponse.matches:type_name -> qsfera.messages.search.v0.Match
6, // 2: qsfera.services.search.v0.SearchIndexRequest.ref:type_name -> qsfera.messages.search.v0.Reference
7, // 3: qsfera.services.search.v0.SearchIndexResponse.matches:type_name -> qsfera.messages.search.v0.Match
0, // 4: qsfera.services.search.v0.SearchProvider.Search:input_type -> qsfera.services.search.v0.SearchRequest
4, // 5: qsfera.services.search.v0.SearchProvider.IndexSpace:input_type -> qsfera.services.search.v0.IndexSpaceRequest
2, // 6: qsfera.services.search.v0.IndexProvider.Search:input_type -> qsfera.services.search.v0.SearchIndexRequest
1, // 7: qsfera.services.search.v0.SearchProvider.Search:output_type -> qsfera.services.search.v0.SearchResponse
5, // 8: qsfera.services.search.v0.SearchProvider.IndexSpace:output_type -> qsfera.services.search.v0.IndexSpaceResponse
3, // 9: qsfera.services.search.v0.IndexProvider.Search:output_type -> qsfera.services.search.v0.SearchIndexResponse
7, // [7:10] is the sub-list for method output_type
4, // [4:7] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
}
func init() { file_qsfera_services_search_v0_search_proto_init() }
func file_qsfera_services_search_v0_search_proto_init() {
if File_qsfera_services_search_v0_search_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_qsfera_services_search_v0_search_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SearchRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_qsfera_services_search_v0_search_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SearchResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_qsfera_services_search_v0_search_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SearchIndexRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_qsfera_services_search_v0_search_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SearchIndexResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_qsfera_services_search_v0_search_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*IndexSpaceRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_qsfera_services_search_v0_search_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*IndexSpaceResponse); 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{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_qsfera_services_search_v0_search_proto_rawDesc,
NumEnums: 0,
NumMessages: 6,
NumExtensions: 0,
NumServices: 2,
},
GoTypes: file_qsfera_services_search_v0_search_proto_goTypes,
DependencyIndexes: file_qsfera_services_search_v0_search_proto_depIdxs,
MessageInfos: file_qsfera_services_search_v0_search_proto_msgTypes,
}.Build()
File_qsfera_services_search_v0_search_proto = out.File
file_qsfera_services_search_v0_search_proto_rawDesc = nil
file_qsfera_services_search_v0_search_proto_goTypes = nil
file_qsfera_services_search_v0_search_proto_depIdxs = nil
}
@@ -0,0 +1,205 @@
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: qsfera/services/search/v0/search.proto
package v0
import (
fmt "fmt"
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
_ "github.com/qsfera/server/protogen/gen/qsfera/messages/search/v0"
_ "google.golang.org/genproto/googleapis/api/annotations"
proto "google.golang.org/protobuf/proto"
_ "google.golang.org/protobuf/types/known/fieldmaskpb"
math "math"
)
import (
context "context"
api "go-micro.dev/v4/api"
client "go-micro.dev/v4/client"
server "go-micro.dev/v4/server"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// Reference imports to suppress errors if they are not otherwise used.
var _ api.Endpoint
var _ context.Context
var _ client.Option
var _ server.Option
// Api Endpoints for SearchProvider service
func NewSearchProviderEndpoints() []*api.Endpoint {
return []*api.Endpoint{
{
Name: "SearchProvider.Search",
Path: []string{"/api/v0/search/search"},
Method: []string{"POST"},
Handler: "rpc",
},
{
Name: "SearchProvider.IndexSpace",
Path: []string{"/api/v0/search/index-space"},
Method: []string{"POST"},
Handler: "rpc",
},
}
}
// Client API for SearchProvider service
type SearchProviderService interface {
Search(ctx context.Context, in *SearchRequest, opts ...client.CallOption) (*SearchResponse, error)
IndexSpace(ctx context.Context, in *IndexSpaceRequest, opts ...client.CallOption) (*IndexSpaceResponse, error)
}
type searchProviderService struct {
c client.Client
name string
}
func NewSearchProviderService(name string, c client.Client) SearchProviderService {
return &searchProviderService{
c: c,
name: name,
}
}
func (c *searchProviderService) Search(ctx context.Context, in *SearchRequest, opts ...client.CallOption) (*SearchResponse, error) {
req := c.c.NewRequest(c.name, "SearchProvider.Search", in)
out := new(SearchResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *searchProviderService) IndexSpace(ctx context.Context, in *IndexSpaceRequest, opts ...client.CallOption) (*IndexSpaceResponse, error) {
req := c.c.NewRequest(c.name, "SearchProvider.IndexSpace", in)
out := new(IndexSpaceResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for SearchProvider service
type SearchProviderHandler interface {
Search(context.Context, *SearchRequest, *SearchResponse) error
IndexSpace(context.Context, *IndexSpaceRequest, *IndexSpaceResponse) error
}
func RegisterSearchProviderHandler(s server.Server, hdlr SearchProviderHandler, opts ...server.HandlerOption) error {
type searchProvider interface {
Search(ctx context.Context, in *SearchRequest, out *SearchResponse) error
IndexSpace(ctx context.Context, in *IndexSpaceRequest, out *IndexSpaceResponse) error
}
type SearchProvider struct {
searchProvider
}
h := &searchProviderHandler{hdlr}
opts = append(opts, api.WithEndpoint(&api.Endpoint{
Name: "SearchProvider.Search",
Path: []string{"/api/v0/search/search"},
Method: []string{"POST"},
Handler: "rpc",
}))
opts = append(opts, api.WithEndpoint(&api.Endpoint{
Name: "SearchProvider.IndexSpace",
Path: []string{"/api/v0/search/index-space"},
Method: []string{"POST"},
Handler: "rpc",
}))
return s.Handle(s.NewHandler(&SearchProvider{h}, opts...))
}
type searchProviderHandler struct {
SearchProviderHandler
}
func (h *searchProviderHandler) Search(ctx context.Context, in *SearchRequest, out *SearchResponse) error {
return h.SearchProviderHandler.Search(ctx, in, out)
}
func (h *searchProviderHandler) IndexSpace(ctx context.Context, in *IndexSpaceRequest, out *IndexSpaceResponse) error {
return h.SearchProviderHandler.IndexSpace(ctx, in, out)
}
// Api Endpoints for IndexProvider service
func NewIndexProviderEndpoints() []*api.Endpoint {
return []*api.Endpoint{
{
Name: "IndexProvider.Search",
Path: []string{"/api/v0/search/index/search"},
Method: []string{"POST"},
Handler: "rpc",
},
}
}
// Client API for IndexProvider service
type IndexProviderService interface {
Search(ctx context.Context, in *SearchIndexRequest, opts ...client.CallOption) (*SearchIndexResponse, error)
}
type indexProviderService struct {
c client.Client
name string
}
func NewIndexProviderService(name string, c client.Client) IndexProviderService {
return &indexProviderService{
c: c,
name: name,
}
}
func (c *indexProviderService) Search(ctx context.Context, in *SearchIndexRequest, opts ...client.CallOption) (*SearchIndexResponse, error) {
req := c.c.NewRequest(c.name, "IndexProvider.Search", in)
out := new(SearchIndexResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for IndexProvider service
type IndexProviderHandler interface {
Search(context.Context, *SearchIndexRequest, *SearchIndexResponse) error
}
func RegisterIndexProviderHandler(s server.Server, hdlr IndexProviderHandler, opts ...server.HandlerOption) error {
type indexProvider interface {
Search(ctx context.Context, in *SearchIndexRequest, out *SearchIndexResponse) error
}
type IndexProvider struct {
indexProvider
}
h := &indexProviderHandler{hdlr}
opts = append(opts, api.WithEndpoint(&api.Endpoint{
Name: "IndexProvider.Search",
Path: []string{"/api/v0/search/index/search"},
Method: []string{"POST"},
Handler: "rpc",
}))
return s.Handle(s.NewHandler(&IndexProvider{h}, opts...))
}
type indexProviderHandler struct {
IndexProviderHandler
}
func (h *indexProviderHandler) Search(ctx context.Context, in *SearchIndexRequest, out *SearchIndexResponse) error {
return h.IndexProviderHandler.Search(ctx, in, out)
}
@@ -0,0 +1,346 @@
// Code generated by protoc-gen-microweb. DO NOT EDIT.
// source: v0.proto
package v0
import (
"bytes"
"encoding/json"
"net/http"
"github.com/go-chi/chi/v5"
"github.com/go-chi/render"
"github.com/golang/protobuf/jsonpb"
merrors "go-micro.dev/v4/errors"
)
type webSearchProviderHandler struct {
r chi.Router
h SearchProviderHandler
}
func (h *webSearchProviderHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
h.r.ServeHTTP(w, r)
}
func (h *webSearchProviderHandler) Search(w http.ResponseWriter, r *http.Request) {
req := &SearchRequest{}
resp := &SearchResponse{}
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
http.Error(w, err.Error(), http.StatusPreconditionFailed)
return
}
if err := h.h.Search(
r.Context(),
req,
resp,
); err != nil {
if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound {
http.Error(w, err.Error(), http.StatusNotFound)
} else {
http.Error(w, err.Error(), http.StatusBadRequest)
}
return
}
render.Status(r, http.StatusCreated)
render.JSON(w, r, resp)
}
func (h *webSearchProviderHandler) IndexSpace(w http.ResponseWriter, r *http.Request) {
req := &IndexSpaceRequest{}
resp := &IndexSpaceResponse{}
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
http.Error(w, err.Error(), http.StatusPreconditionFailed)
return
}
if err := h.h.IndexSpace(
r.Context(),
req,
resp,
); err != nil {
if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound {
http.Error(w, err.Error(), http.StatusNotFound)
} else {
http.Error(w, err.Error(), http.StatusBadRequest)
}
return
}
render.Status(r, http.StatusCreated)
render.JSON(w, r, resp)
}
func RegisterSearchProviderWeb(r chi.Router, i SearchProviderHandler, middlewares ...func(http.Handler) http.Handler) {
handler := &webSearchProviderHandler{
r: r,
h: i,
}
r.MethodFunc("POST", "/api/v0/search/search", handler.Search)
r.MethodFunc("POST", "/api/v0/search/index-space", handler.IndexSpace)
}
type webIndexProviderHandler struct {
r chi.Router
h IndexProviderHandler
}
func (h *webIndexProviderHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
h.r.ServeHTTP(w, r)
}
func (h *webIndexProviderHandler) Search(w http.ResponseWriter, r *http.Request) {
req := &SearchIndexRequest{}
resp := &SearchIndexResponse{}
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
http.Error(w, err.Error(), http.StatusPreconditionFailed)
return
}
if err := h.h.Search(
r.Context(),
req,
resp,
); err != nil {
if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound {
http.Error(w, err.Error(), http.StatusNotFound)
} else {
http.Error(w, err.Error(), http.StatusBadRequest)
}
return
}
render.Status(r, http.StatusCreated)
render.JSON(w, r, resp)
}
func RegisterIndexProviderWeb(r chi.Router, i IndexProviderHandler, middlewares ...func(http.Handler) http.Handler) {
handler := &webIndexProviderHandler{
r: r,
h: i,
}
r.MethodFunc("POST", "/api/v0/search/index/search", handler.Search)
}
// SearchRequestJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of SearchRequest. This struct is safe to replace or modify but
// should not be done so concurrently.
var SearchRequestJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *SearchRequest) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := SearchRequestJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*SearchRequest)(nil)
// SearchRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of SearchRequest. This struct is safe to replace or modify but
// should not be done so concurrently.
var SearchRequestJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *SearchRequest) UnmarshalJSON(b []byte) error {
return SearchRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*SearchRequest)(nil)
// SearchResponseJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of SearchResponse. This struct is safe to replace or modify but
// should not be done so concurrently.
var SearchResponseJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *SearchResponse) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := SearchResponseJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*SearchResponse)(nil)
// SearchResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of SearchResponse. This struct is safe to replace or modify but
// should not be done so concurrently.
var SearchResponseJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *SearchResponse) UnmarshalJSON(b []byte) error {
return SearchResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*SearchResponse)(nil)
// SearchIndexRequestJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of SearchIndexRequest. This struct is safe to replace or modify but
// should not be done so concurrently.
var SearchIndexRequestJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *SearchIndexRequest) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := SearchIndexRequestJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*SearchIndexRequest)(nil)
// SearchIndexRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of SearchIndexRequest. This struct is safe to replace or modify but
// should not be done so concurrently.
var SearchIndexRequestJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *SearchIndexRequest) UnmarshalJSON(b []byte) error {
return SearchIndexRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*SearchIndexRequest)(nil)
// SearchIndexResponseJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of SearchIndexResponse. This struct is safe to replace or modify but
// should not be done so concurrently.
var SearchIndexResponseJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *SearchIndexResponse) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := SearchIndexResponseJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*SearchIndexResponse)(nil)
// SearchIndexResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of SearchIndexResponse. This struct is safe to replace or modify but
// should not be done so concurrently.
var SearchIndexResponseJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *SearchIndexResponse) UnmarshalJSON(b []byte) error {
return SearchIndexResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*SearchIndexResponse)(nil)
// IndexSpaceRequestJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of IndexSpaceRequest. This struct is safe to replace or modify but
// should not be done so concurrently.
var IndexSpaceRequestJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *IndexSpaceRequest) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := IndexSpaceRequestJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*IndexSpaceRequest)(nil)
// IndexSpaceRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of IndexSpaceRequest. This struct is safe to replace or modify but
// should not be done so concurrently.
var IndexSpaceRequestJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *IndexSpaceRequest) UnmarshalJSON(b []byte) error {
return IndexSpaceRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*IndexSpaceRequest)(nil)
// IndexSpaceResponseJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of IndexSpaceResponse. This struct is safe to replace or modify but
// should not be done so concurrently.
var IndexSpaceResponseJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *IndexSpaceResponse) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := IndexSpaceResponseJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*IndexSpaceResponse)(nil)
// IndexSpaceResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of IndexSpaceResponse. This struct is safe to replace or modify but
// should not be done so concurrently.
var IndexSpaceResponseJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *IndexSpaceResponse) UnmarshalJSON(b []byte) error {
return IndexSpaceResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*IndexSpaceResponse)(nil)
@@ -0,0 +1,502 @@
{
"swagger": "2.0",
"info": {
"title": "КуСфера search",
"version": "1.0.0",
"contact": {
"name": "КуСфера",
"url": "",
"email": ""
},
"license": {
"name": "Apache-2.0",
"url": ""
}
},
"tags": [
{
"name": "SearchProvider"
},
{
"name": "IndexProvider"
}
],
"schemes": [
"http",
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/api/v0/search/index-space": {
"post": {
"operationId": "SearchProvider_IndexSpace",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v0IndexSpaceResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v0IndexSpaceRequest"
}
}
],
"tags": [
"SearchProvider"
]
}
},
"/api/v0/search/index/search": {
"post": {
"operationId": "IndexProvider_Search",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v0SearchIndexResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v0SearchIndexRequest"
}
}
],
"tags": [
"IndexProvider"
]
}
},
"/api/v0/search/search": {
"post": {
"operationId": "SearchProvider_Search",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v0SearchResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v0SearchRequest"
}
}
],
"tags": [
"SearchProvider"
]
}
}
},
"definitions": {
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"rpcStatus": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"$ref": "#/definitions/protobufAny"
}
}
}
},
"v0Audio": {
"type": "object",
"properties": {
"album": {
"type": "string"
},
"albumArtist": {
"type": "string"
},
"artist": {
"type": "string"
},
"bitrate": {
"type": "string",
"format": "int64"
},
"composers": {
"type": "string"
},
"copyright": {
"type": "string"
},
"disc": {
"type": "integer",
"format": "int32"
},
"discCount": {
"type": "integer",
"format": "int32"
},
"duration": {
"type": "string",
"format": "int64"
},
"genre": {
"type": "string"
},
"hasDrm": {
"type": "boolean"
},
"isVariableBitrate": {
"type": "boolean"
},
"title": {
"type": "string"
},
"track": {
"type": "integer",
"format": "int32"
},
"trackCount": {
"type": "integer",
"format": "int32"
},
"year": {
"type": "integer",
"format": "int32"
}
}
},
"v0Entity": {
"type": "object",
"properties": {
"ref": {
"$ref": "#/definitions/v0Reference"
},
"id": {
"$ref": "#/definitions/v0ResourceID"
},
"name": {
"type": "string"
},
"etag": {
"type": "string"
},
"size": {
"type": "string",
"format": "uint64"
},
"lastModifiedTime": {
"type": "string",
"format": "date-time"
},
"mimeType": {
"type": "string"
},
"permissions": {
"type": "string"
},
"type": {
"type": "string",
"format": "uint64"
},
"deleted": {
"type": "boolean"
},
"shareRootName": {
"type": "string"
},
"parentId": {
"$ref": "#/definitions/v0ResourceID"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"highlights": {
"type": "string"
},
"audio": {
"$ref": "#/definitions/v0Audio"
},
"location": {
"$ref": "#/definitions/v0GeoCoordinates"
},
"remoteItemId": {
"$ref": "#/definitions/v0ResourceID"
},
"image": {
"$ref": "#/definitions/v0Image"
},
"photo": {
"$ref": "#/definitions/v0Photo"
},
"favorites": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"v0GeoCoordinates": {
"type": "object",
"properties": {
"altitude": {
"type": "number",
"format": "double"
},
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
}
}
},
"v0Image": {
"type": "object",
"properties": {
"width": {
"type": "integer",
"format": "int32"
},
"height": {
"type": "integer",
"format": "int32"
}
}
},
"v0IndexSpaceRequest": {
"type": "object",
"properties": {
"spaceId": {
"type": "string"
},
"userId": {
"type": "string"
},
"forceReindex": {
"type": "boolean"
}
}
},
"v0IndexSpaceResponse": {
"type": "object"
},
"v0Match": {
"type": "object",
"properties": {
"entity": {
"$ref": "#/definitions/v0Entity",
"title": "the matched entity"
},
"score": {
"type": "number",
"format": "float",
"title": "the match score"
}
}
},
"v0Photo": {
"type": "object",
"properties": {
"cameraMake": {
"type": "string"
},
"cameraModel": {
"type": "string"
},
"exposureDenominator": {
"type": "number",
"format": "float"
},
"exposureNumerator": {
"type": "number",
"format": "float"
},
"fNumber": {
"type": "number",
"format": "float"
},
"focalLength": {
"type": "number",
"format": "float"
},
"iso": {
"type": "integer",
"format": "int32"
},
"orientation": {
"type": "integer",
"format": "int32"
},
"takenDateTime": {
"type": "string",
"format": "date-time"
}
}
},
"v0Reference": {
"type": "object",
"properties": {
"resourceId": {
"$ref": "#/definitions/v0ResourceID"
},
"path": {
"type": "string"
}
}
},
"v0ResourceID": {
"type": "object",
"properties": {
"storageId": {
"type": "string"
},
"opaqueId": {
"type": "string"
},
"spaceId": {
"type": "string"
}
}
},
"v0SearchIndexRequest": {
"type": "object",
"properties": {
"pageSize": {
"type": "integer",
"format": "int32",
"title": "Optional. The maximum number of entries to return in the response"
},
"pageToken": {
"type": "string",
"title": "Optional. A pagination token returned from a previous call to `Get`\nthat indicates from where search should continue"
},
"query": {
"type": "string"
},
"ref": {
"$ref": "#/definitions/v0Reference"
}
}
},
"v0SearchIndexResponse": {
"type": "object",
"properties": {
"matches": {
"type": "array",
"items": {
"$ref": "#/definitions/v0Match"
}
},
"nextPageToken": {
"type": "string",
"title": "Token to retrieve the next page of results, or empty if there are no\nmore results in the list"
},
"totalMatches": {
"type": "integer",
"format": "int32"
}
}
},
"v0SearchRequest": {
"type": "object",
"properties": {
"pageSize": {
"type": "integer",
"format": "int32",
"title": "Optional. The maximum number of entries to return in the response"
},
"pageToken": {
"type": "string",
"title": "Optional. A pagination token returned from a previous call to `Get`\nthat indicates from where search should continue"
},
"query": {
"type": "string"
},
"ref": {
"$ref": "#/definitions/v0Reference"
}
}
},
"v0SearchResponse": {
"type": "object",
"properties": {
"matches": {
"type": "array",
"items": {
"$ref": "#/definitions/v0Match"
}
},
"nextPageToken": {
"type": "string",
"title": "Token to retrieve the next page of results, or empty if there are no\nmore results in the list"
},
"totalMatches": {
"type": "integer",
"format": "int32"
}
}
}
},
"externalDocs": {
"description": "Developer Manual",
"url": ""
}
}
@@ -0,0 +1,261 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc (unknown)
// source: qsfera/services/search/v0/search.proto
package v0
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
SearchProvider_Search_FullMethodName = "/qsfera.services.search.v0.SearchProvider/Search"
SearchProvider_IndexSpace_FullMethodName = "/qsfera.services.search.v0.SearchProvider/IndexSpace"
)
// SearchProviderClient is the client API for SearchProvider service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type SearchProviderClient interface {
Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error)
IndexSpace(ctx context.Context, in *IndexSpaceRequest, opts ...grpc.CallOption) (*IndexSpaceResponse, error)
}
type searchProviderClient struct {
cc grpc.ClientConnInterface
}
func NewSearchProviderClient(cc grpc.ClientConnInterface) SearchProviderClient {
return &searchProviderClient{cc}
}
func (c *searchProviderClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SearchResponse)
err := c.cc.Invoke(ctx, SearchProvider_Search_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *searchProviderClient) IndexSpace(ctx context.Context, in *IndexSpaceRequest, opts ...grpc.CallOption) (*IndexSpaceResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(IndexSpaceResponse)
err := c.cc.Invoke(ctx, SearchProvider_IndexSpace_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// SearchProviderServer is the server API for SearchProvider service.
// All implementations must embed UnimplementedSearchProviderServer
// for forward compatibility.
type SearchProviderServer interface {
Search(context.Context, *SearchRequest) (*SearchResponse, error)
IndexSpace(context.Context, *IndexSpaceRequest) (*IndexSpaceResponse, error)
mustEmbedUnimplementedSearchProviderServer()
}
// UnimplementedSearchProviderServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedSearchProviderServer struct{}
func (UnimplementedSearchProviderServer) Search(context.Context, *SearchRequest) (*SearchResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Search not implemented")
}
func (UnimplementedSearchProviderServer) IndexSpace(context.Context, *IndexSpaceRequest) (*IndexSpaceResponse, error) {
return nil, status.Error(codes.Unimplemented, "method IndexSpace not implemented")
}
func (UnimplementedSearchProviderServer) mustEmbedUnimplementedSearchProviderServer() {}
func (UnimplementedSearchProviderServer) testEmbeddedByValue() {}
// UnsafeSearchProviderServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SearchProviderServer will
// result in compilation errors.
type UnsafeSearchProviderServer interface {
mustEmbedUnimplementedSearchProviderServer()
}
func RegisterSearchProviderServer(s grpc.ServiceRegistrar, srv SearchProviderServer) {
// If the following call panics, it indicates UnimplementedSearchProviderServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&SearchProvider_ServiceDesc, srv)
}
func _SearchProvider_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SearchRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SearchProviderServer).Search(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: SearchProvider_Search_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SearchProviderServer).Search(ctx, req.(*SearchRequest))
}
return interceptor(ctx, in, info, handler)
}
func _SearchProvider_IndexSpace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IndexSpaceRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SearchProviderServer).IndexSpace(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: SearchProvider_IndexSpace_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SearchProviderServer).IndexSpace(ctx, req.(*IndexSpaceRequest))
}
return interceptor(ctx, in, info, handler)
}
// SearchProvider_ServiceDesc is the grpc.ServiceDesc for SearchProvider service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var SearchProvider_ServiceDesc = grpc.ServiceDesc{
ServiceName: "qsfera.services.search.v0.SearchProvider",
HandlerType: (*SearchProviderServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Search",
Handler: _SearchProvider_Search_Handler,
},
{
MethodName: "IndexSpace",
Handler: _SearchProvider_IndexSpace_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "qsfera/services/search/v0/search.proto",
}
const (
IndexProvider_Search_FullMethodName = "/qsfera.services.search.v0.IndexProvider/Search"
)
// IndexProviderClient is the client API for IndexProvider service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type IndexProviderClient interface {
Search(ctx context.Context, in *SearchIndexRequest, opts ...grpc.CallOption) (*SearchIndexResponse, error)
}
type indexProviderClient struct {
cc grpc.ClientConnInterface
}
func NewIndexProviderClient(cc grpc.ClientConnInterface) IndexProviderClient {
return &indexProviderClient{cc}
}
func (c *indexProviderClient) Search(ctx context.Context, in *SearchIndexRequest, opts ...grpc.CallOption) (*SearchIndexResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SearchIndexResponse)
err := c.cc.Invoke(ctx, IndexProvider_Search_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// IndexProviderServer is the server API for IndexProvider service.
// All implementations must embed UnimplementedIndexProviderServer
// for forward compatibility.
type IndexProviderServer interface {
Search(context.Context, *SearchIndexRequest) (*SearchIndexResponse, error)
mustEmbedUnimplementedIndexProviderServer()
}
// UnimplementedIndexProviderServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedIndexProviderServer struct{}
func (UnimplementedIndexProviderServer) Search(context.Context, *SearchIndexRequest) (*SearchIndexResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Search not implemented")
}
func (UnimplementedIndexProviderServer) mustEmbedUnimplementedIndexProviderServer() {}
func (UnimplementedIndexProviderServer) testEmbeddedByValue() {}
// UnsafeIndexProviderServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to IndexProviderServer will
// result in compilation errors.
type UnsafeIndexProviderServer interface {
mustEmbedUnimplementedIndexProviderServer()
}
func RegisterIndexProviderServer(s grpc.ServiceRegistrar, srv IndexProviderServer) {
// If the following call panics, it indicates UnimplementedIndexProviderServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&IndexProvider_ServiceDesc, srv)
}
func _IndexProvider_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SearchIndexRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IndexProviderServer).Search(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: IndexProvider_Search_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IndexProviderServer).Search(ctx, req.(*SearchIndexRequest))
}
return interceptor(ctx, in, info, handler)
}
// IndexProvider_ServiceDesc is the grpc.ServiceDesc for IndexProvider service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var IndexProvider_ServiceDesc = grpc.ServiceDesc{
ServiceName: "qsfera.services.search.v0.IndexProvider",
HandlerType: (*IndexProviderServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Search",
Handler: _IndexProvider_Search_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "qsfera/services/search/v0/search.proto",
}
@@ -0,0 +1,372 @@
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"context"
"github.com/qsfera/server/protogen/gen/qsfera/services/settings/v0"
mock "github.com/stretchr/testify/mock"
"go-micro.dev/v4/client"
)
// NewValueService creates a new instance of ValueService. 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 NewValueService(t interface {
mock.TestingT
Cleanup(func())
}) *ValueService {
mock := &ValueService{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// ValueService is an autogenerated mock type for the ValueService type
type ValueService struct {
mock.Mock
}
type ValueService_Expecter struct {
mock *mock.Mock
}
func (_m *ValueService) EXPECT() *ValueService_Expecter {
return &ValueService_Expecter{mock: &_m.Mock}
}
// GetValue provides a mock function for the type ValueService
func (_mock *ValueService) GetValue(ctx context.Context, in *v0.GetValueRequest, opts ...client.CallOption) (*v0.GetValueResponse, error) {
var tmpRet mock.Arguments
if len(opts) > 0 {
tmpRet = _mock.Called(ctx, in, opts)
} else {
tmpRet = _mock.Called(ctx, in)
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for GetValue")
}
var r0 *v0.GetValueResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetValueRequest, ...client.CallOption) (*v0.GetValueResponse, error)); ok {
return returnFunc(ctx, in, opts...)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetValueRequest, ...client.CallOption) *v0.GetValueResponse); ok {
r0 = returnFunc(ctx, in, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v0.GetValueResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.GetValueRequest, ...client.CallOption) error); ok {
r1 = returnFunc(ctx, in, opts...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ValueService_GetValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValue'
type ValueService_GetValue_Call struct {
*mock.Call
}
// GetValue is a helper method to define mock.On call
// - ctx context.Context
// - in *v0.GetValueRequest
// - opts ...client.CallOption
func (_e *ValueService_Expecter) GetValue(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_GetValue_Call {
return &ValueService_GetValue_Call{Call: _e.mock.On("GetValue",
append([]interface{}{ctx, in}, opts...)...)}
}
func (_c *ValueService_GetValue_Call) Run(run func(ctx context.Context, in *v0.GetValueRequest, opts ...client.CallOption)) *ValueService_GetValue_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *v0.GetValueRequest
if args[1] != nil {
arg1 = args[1].(*v0.GetValueRequest)
}
var arg2 []client.CallOption
var variadicArgs []client.CallOption
if len(args) > 2 {
variadicArgs = args[2].([]client.CallOption)
}
arg2 = variadicArgs
run(
arg0,
arg1,
arg2...,
)
})
return _c
}
func (_c *ValueService_GetValue_Call) Return(getValueResponse *v0.GetValueResponse, err error) *ValueService_GetValue_Call {
_c.Call.Return(getValueResponse, err)
return _c
}
func (_c *ValueService_GetValue_Call) RunAndReturn(run func(ctx context.Context, in *v0.GetValueRequest, opts ...client.CallOption) (*v0.GetValueResponse, error)) *ValueService_GetValue_Call {
_c.Call.Return(run)
return _c
}
// GetValueByUniqueIdentifiers provides a mock function for the type ValueService
func (_mock *ValueService) GetValueByUniqueIdentifiers(ctx context.Context, in *v0.GetValueByUniqueIdentifiersRequest, opts ...client.CallOption) (*v0.GetValueResponse, error) {
var tmpRet mock.Arguments
if len(opts) > 0 {
tmpRet = _mock.Called(ctx, in, opts)
} else {
tmpRet = _mock.Called(ctx, in)
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for GetValueByUniqueIdentifiers")
}
var r0 *v0.GetValueResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetValueByUniqueIdentifiersRequest, ...client.CallOption) (*v0.GetValueResponse, error)); ok {
return returnFunc(ctx, in, opts...)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetValueByUniqueIdentifiersRequest, ...client.CallOption) *v0.GetValueResponse); ok {
r0 = returnFunc(ctx, in, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v0.GetValueResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.GetValueByUniqueIdentifiersRequest, ...client.CallOption) error); ok {
r1 = returnFunc(ctx, in, opts...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ValueService_GetValueByUniqueIdentifiers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValueByUniqueIdentifiers'
type ValueService_GetValueByUniqueIdentifiers_Call struct {
*mock.Call
}
// GetValueByUniqueIdentifiers is a helper method to define mock.On call
// - ctx context.Context
// - in *v0.GetValueByUniqueIdentifiersRequest
// - opts ...client.CallOption
func (_e *ValueService_Expecter) GetValueByUniqueIdentifiers(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_GetValueByUniqueIdentifiers_Call {
return &ValueService_GetValueByUniqueIdentifiers_Call{Call: _e.mock.On("GetValueByUniqueIdentifiers",
append([]interface{}{ctx, in}, opts...)...)}
}
func (_c *ValueService_GetValueByUniqueIdentifiers_Call) Run(run func(ctx context.Context, in *v0.GetValueByUniqueIdentifiersRequest, opts ...client.CallOption)) *ValueService_GetValueByUniqueIdentifiers_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *v0.GetValueByUniqueIdentifiersRequest
if args[1] != nil {
arg1 = args[1].(*v0.GetValueByUniqueIdentifiersRequest)
}
var arg2 []client.CallOption
var variadicArgs []client.CallOption
if len(args) > 2 {
variadicArgs = args[2].([]client.CallOption)
}
arg2 = variadicArgs
run(
arg0,
arg1,
arg2...,
)
})
return _c
}
func (_c *ValueService_GetValueByUniqueIdentifiers_Call) Return(getValueResponse *v0.GetValueResponse, err error) *ValueService_GetValueByUniqueIdentifiers_Call {
_c.Call.Return(getValueResponse, err)
return _c
}
func (_c *ValueService_GetValueByUniqueIdentifiers_Call) RunAndReturn(run func(ctx context.Context, in *v0.GetValueByUniqueIdentifiersRequest, opts ...client.CallOption) (*v0.GetValueResponse, error)) *ValueService_GetValueByUniqueIdentifiers_Call {
_c.Call.Return(run)
return _c
}
// ListValues provides a mock function for the type ValueService
func (_mock *ValueService) ListValues(ctx context.Context, in *v0.ListValuesRequest, opts ...client.CallOption) (*v0.ListValuesResponse, error) {
var tmpRet mock.Arguments
if len(opts) > 0 {
tmpRet = _mock.Called(ctx, in, opts)
} else {
tmpRet = _mock.Called(ctx, in)
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for ListValues")
}
var r0 *v0.ListValuesResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListValuesRequest, ...client.CallOption) (*v0.ListValuesResponse, error)); ok {
return returnFunc(ctx, in, opts...)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListValuesRequest, ...client.CallOption) *v0.ListValuesResponse); ok {
r0 = returnFunc(ctx, in, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v0.ListValuesResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.ListValuesRequest, ...client.CallOption) error); ok {
r1 = returnFunc(ctx, in, opts...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ValueService_ListValues_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListValues'
type ValueService_ListValues_Call struct {
*mock.Call
}
// ListValues is a helper method to define mock.On call
// - ctx context.Context
// - in *v0.ListValuesRequest
// - opts ...client.CallOption
func (_e *ValueService_Expecter) ListValues(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_ListValues_Call {
return &ValueService_ListValues_Call{Call: _e.mock.On("ListValues",
append([]interface{}{ctx, in}, opts...)...)}
}
func (_c *ValueService_ListValues_Call) Run(run func(ctx context.Context, in *v0.ListValuesRequest, opts ...client.CallOption)) *ValueService_ListValues_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *v0.ListValuesRequest
if args[1] != nil {
arg1 = args[1].(*v0.ListValuesRequest)
}
var arg2 []client.CallOption
var variadicArgs []client.CallOption
if len(args) > 2 {
variadicArgs = args[2].([]client.CallOption)
}
arg2 = variadicArgs
run(
arg0,
arg1,
arg2...,
)
})
return _c
}
func (_c *ValueService_ListValues_Call) Return(listValuesResponse *v0.ListValuesResponse, err error) *ValueService_ListValues_Call {
_c.Call.Return(listValuesResponse, err)
return _c
}
func (_c *ValueService_ListValues_Call) RunAndReturn(run func(ctx context.Context, in *v0.ListValuesRequest, opts ...client.CallOption) (*v0.ListValuesResponse, error)) *ValueService_ListValues_Call {
_c.Call.Return(run)
return _c
}
// SaveValue provides a mock function for the type ValueService
func (_mock *ValueService) SaveValue(ctx context.Context, in *v0.SaveValueRequest, opts ...client.CallOption) (*v0.SaveValueResponse, error) {
var tmpRet mock.Arguments
if len(opts) > 0 {
tmpRet = _mock.Called(ctx, in, opts)
} else {
tmpRet = _mock.Called(ctx, in)
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for SaveValue")
}
var r0 *v0.SaveValueResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SaveValueRequest, ...client.CallOption) (*v0.SaveValueResponse, error)); ok {
return returnFunc(ctx, in, opts...)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SaveValueRequest, ...client.CallOption) *v0.SaveValueResponse); ok {
r0 = returnFunc(ctx, in, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v0.SaveValueResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.SaveValueRequest, ...client.CallOption) error); ok {
r1 = returnFunc(ctx, in, opts...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ValueService_SaveValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveValue'
type ValueService_SaveValue_Call struct {
*mock.Call
}
// SaveValue is a helper method to define mock.On call
// - ctx context.Context
// - in *v0.SaveValueRequest
// - opts ...client.CallOption
func (_e *ValueService_Expecter) SaveValue(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_SaveValue_Call {
return &ValueService_SaveValue_Call{Call: _e.mock.On("SaveValue",
append([]interface{}{ctx, in}, opts...)...)}
}
func (_c *ValueService_SaveValue_Call) Run(run func(ctx context.Context, in *v0.SaveValueRequest, opts ...client.CallOption)) *ValueService_SaveValue_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *v0.SaveValueRequest
if args[1] != nil {
arg1 = args[1].(*v0.SaveValueRequest)
}
var arg2 []client.CallOption
var variadicArgs []client.CallOption
if len(args) > 2 {
variadicArgs = args[2].([]client.CallOption)
}
arg2 = variadicArgs
run(
arg0,
arg1,
arg2...,
)
})
return _c
}
func (_c *ValueService_SaveValue_Call) Return(saveValueResponse *v0.SaveValueResponse, err error) *ValueService_SaveValue_Call {
_c.Call.Return(saveValueResponse, err)
return _c
}
func (_c *ValueService_SaveValue_Call) RunAndReturn(run func(ctx context.Context, in *v0.SaveValueRequest, opts ...client.CallOption) (*v0.SaveValueResponse, error)) *ValueService_SaveValue_Call {
_c.Call.Return(run)
return _c
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,697 @@
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: qsfera/services/settings/v0/settings.proto
package v0
import (
fmt "fmt"
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
_ "github.com/qsfera/server/protogen/gen/qsfera/messages/settings/v0"
_ "google.golang.org/genproto/googleapis/api/annotations"
proto "google.golang.org/protobuf/proto"
emptypb "google.golang.org/protobuf/types/known/emptypb"
math "math"
)
import (
context "context"
api "go-micro.dev/v4/api"
client "go-micro.dev/v4/client"
server "go-micro.dev/v4/server"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// Reference imports to suppress errors if they are not otherwise used.
var _ api.Endpoint
var _ context.Context
var _ client.Option
var _ server.Option
// Api Endpoints for BundleService service
func NewBundleServiceEndpoints() []*api.Endpoint {
return []*api.Endpoint{
{
Name: "BundleService.SaveBundle",
Path: []string{"/api/v0/settings/bundle-save"},
Method: []string{"POST"},
Handler: "rpc",
},
{
Name: "BundleService.GetBundle",
Path: []string{"/api/v0/settings/bundle-get"},
Method: []string{"POST"},
Handler: "rpc",
},
{
Name: "BundleService.ListBundles",
Path: []string{"/api/v0/settings/bundles-list"},
Method: []string{"POST"},
Handler: "rpc",
},
{
Name: "BundleService.AddSettingToBundle",
Path: []string{"/api/v0/settings/bundles-add-setting"},
Method: []string{"POST"},
Handler: "rpc",
},
{
Name: "BundleService.RemoveSettingFromBundle",
Path: []string{"/api/v0/settings/bundles-remove-setting"},
Method: []string{"POST"},
Handler: "rpc",
},
}
}
// Client API for BundleService service
type BundleService interface {
SaveBundle(ctx context.Context, in *SaveBundleRequest, opts ...client.CallOption) (*SaveBundleResponse, error)
GetBundle(ctx context.Context, in *GetBundleRequest, opts ...client.CallOption) (*GetBundleResponse, error)
ListBundles(ctx context.Context, in *ListBundlesRequest, opts ...client.CallOption) (*ListBundlesResponse, error)
AddSettingToBundle(ctx context.Context, in *AddSettingToBundleRequest, opts ...client.CallOption) (*AddSettingToBundleResponse, error)
RemoveSettingFromBundle(ctx context.Context, in *RemoveSettingFromBundleRequest, opts ...client.CallOption) (*emptypb.Empty, error)
}
type bundleService struct {
c client.Client
name string
}
func NewBundleService(name string, c client.Client) BundleService {
return &bundleService{
c: c,
name: name,
}
}
func (c *bundleService) SaveBundle(ctx context.Context, in *SaveBundleRequest, opts ...client.CallOption) (*SaveBundleResponse, error) {
req := c.c.NewRequest(c.name, "BundleService.SaveBundle", in)
out := new(SaveBundleResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bundleService) GetBundle(ctx context.Context, in *GetBundleRequest, opts ...client.CallOption) (*GetBundleResponse, error) {
req := c.c.NewRequest(c.name, "BundleService.GetBundle", in)
out := new(GetBundleResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bundleService) ListBundles(ctx context.Context, in *ListBundlesRequest, opts ...client.CallOption) (*ListBundlesResponse, error) {
req := c.c.NewRequest(c.name, "BundleService.ListBundles", in)
out := new(ListBundlesResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bundleService) AddSettingToBundle(ctx context.Context, in *AddSettingToBundleRequest, opts ...client.CallOption) (*AddSettingToBundleResponse, error) {
req := c.c.NewRequest(c.name, "BundleService.AddSettingToBundle", in)
out := new(AddSettingToBundleResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bundleService) RemoveSettingFromBundle(ctx context.Context, in *RemoveSettingFromBundleRequest, opts ...client.CallOption) (*emptypb.Empty, error) {
req := c.c.NewRequest(c.name, "BundleService.RemoveSettingFromBundle", in)
out := new(emptypb.Empty)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for BundleService service
type BundleServiceHandler interface {
SaveBundle(context.Context, *SaveBundleRequest, *SaveBundleResponse) error
GetBundle(context.Context, *GetBundleRequest, *GetBundleResponse) error
ListBundles(context.Context, *ListBundlesRequest, *ListBundlesResponse) error
AddSettingToBundle(context.Context, *AddSettingToBundleRequest, *AddSettingToBundleResponse) error
RemoveSettingFromBundle(context.Context, *RemoveSettingFromBundleRequest, *emptypb.Empty) error
}
func RegisterBundleServiceHandler(s server.Server, hdlr BundleServiceHandler, opts ...server.HandlerOption) error {
type bundleService interface {
SaveBundle(ctx context.Context, in *SaveBundleRequest, out *SaveBundleResponse) error
GetBundle(ctx context.Context, in *GetBundleRequest, out *GetBundleResponse) error
ListBundles(ctx context.Context, in *ListBundlesRequest, out *ListBundlesResponse) error
AddSettingToBundle(ctx context.Context, in *AddSettingToBundleRequest, out *AddSettingToBundleResponse) error
RemoveSettingFromBundle(ctx context.Context, in *RemoveSettingFromBundleRequest, out *emptypb.Empty) error
}
type BundleService struct {
bundleService
}
h := &bundleServiceHandler{hdlr}
opts = append(opts, api.WithEndpoint(&api.Endpoint{
Name: "BundleService.SaveBundle",
Path: []string{"/api/v0/settings/bundle-save"},
Method: []string{"POST"},
Handler: "rpc",
}))
opts = append(opts, api.WithEndpoint(&api.Endpoint{
Name: "BundleService.GetBundle",
Path: []string{"/api/v0/settings/bundle-get"},
Method: []string{"POST"},
Handler: "rpc",
}))
opts = append(opts, api.WithEndpoint(&api.Endpoint{
Name: "BundleService.ListBundles",
Path: []string{"/api/v0/settings/bundles-list"},
Method: []string{"POST"},
Handler: "rpc",
}))
opts = append(opts, api.WithEndpoint(&api.Endpoint{
Name: "BundleService.AddSettingToBundle",
Path: []string{"/api/v0/settings/bundles-add-setting"},
Method: []string{"POST"},
Handler: "rpc",
}))
opts = append(opts, api.WithEndpoint(&api.Endpoint{
Name: "BundleService.RemoveSettingFromBundle",
Path: []string{"/api/v0/settings/bundles-remove-setting"},
Method: []string{"POST"},
Handler: "rpc",
}))
return s.Handle(s.NewHandler(&BundleService{h}, opts...))
}
type bundleServiceHandler struct {
BundleServiceHandler
}
func (h *bundleServiceHandler) SaveBundle(ctx context.Context, in *SaveBundleRequest, out *SaveBundleResponse) error {
return h.BundleServiceHandler.SaveBundle(ctx, in, out)
}
func (h *bundleServiceHandler) GetBundle(ctx context.Context, in *GetBundleRequest, out *GetBundleResponse) error {
return h.BundleServiceHandler.GetBundle(ctx, in, out)
}
func (h *bundleServiceHandler) ListBundles(ctx context.Context, in *ListBundlesRequest, out *ListBundlesResponse) error {
return h.BundleServiceHandler.ListBundles(ctx, in, out)
}
func (h *bundleServiceHandler) AddSettingToBundle(ctx context.Context, in *AddSettingToBundleRequest, out *AddSettingToBundleResponse) error {
return h.BundleServiceHandler.AddSettingToBundle(ctx, in, out)
}
func (h *bundleServiceHandler) RemoveSettingFromBundle(ctx context.Context, in *RemoveSettingFromBundleRequest, out *emptypb.Empty) error {
return h.BundleServiceHandler.RemoveSettingFromBundle(ctx, in, out)
}
// Api Endpoints for ValueService service
func NewValueServiceEndpoints() []*api.Endpoint {
return []*api.Endpoint{
{
Name: "ValueService.SaveValue",
Path: []string{"/api/v0/settings/values-save"},
Method: []string{"POST"},
Handler: "rpc",
},
{
Name: "ValueService.GetValue",
Path: []string{"/api/v0/settings/values-get"},
Method: []string{"POST"},
Handler: "rpc",
},
{
Name: "ValueService.ListValues",
Path: []string{"/api/v0/settings/values-list"},
Method: []string{"POST"},
Handler: "rpc",
},
{
Name: "ValueService.GetValueByUniqueIdentifiers",
Path: []string{"/api/v0/settings/values-get-by-unique-identifiers"},
Method: []string{"POST"},
Handler: "rpc",
},
}
}
// Client API for ValueService service
type ValueService interface {
SaveValue(ctx context.Context, in *SaveValueRequest, opts ...client.CallOption) (*SaveValueResponse, error)
GetValue(ctx context.Context, in *GetValueRequest, opts ...client.CallOption) (*GetValueResponse, error)
ListValues(ctx context.Context, in *ListValuesRequest, opts ...client.CallOption) (*ListValuesResponse, error)
GetValueByUniqueIdentifiers(ctx context.Context, in *GetValueByUniqueIdentifiersRequest, opts ...client.CallOption) (*GetValueResponse, error)
}
type valueService struct {
c client.Client
name string
}
func NewValueService(name string, c client.Client) ValueService {
return &valueService{
c: c,
name: name,
}
}
func (c *valueService) SaveValue(ctx context.Context, in *SaveValueRequest, opts ...client.CallOption) (*SaveValueResponse, error) {
req := c.c.NewRequest(c.name, "ValueService.SaveValue", in)
out := new(SaveValueResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *valueService) GetValue(ctx context.Context, in *GetValueRequest, opts ...client.CallOption) (*GetValueResponse, error) {
req := c.c.NewRequest(c.name, "ValueService.GetValue", in)
out := new(GetValueResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *valueService) ListValues(ctx context.Context, in *ListValuesRequest, opts ...client.CallOption) (*ListValuesResponse, error) {
req := c.c.NewRequest(c.name, "ValueService.ListValues", in)
out := new(ListValuesResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *valueService) GetValueByUniqueIdentifiers(ctx context.Context, in *GetValueByUniqueIdentifiersRequest, opts ...client.CallOption) (*GetValueResponse, error) {
req := c.c.NewRequest(c.name, "ValueService.GetValueByUniqueIdentifiers", in)
out := new(GetValueResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for ValueService service
type ValueServiceHandler interface {
SaveValue(context.Context, *SaveValueRequest, *SaveValueResponse) error
GetValue(context.Context, *GetValueRequest, *GetValueResponse) error
ListValues(context.Context, *ListValuesRequest, *ListValuesResponse) error
GetValueByUniqueIdentifiers(context.Context, *GetValueByUniqueIdentifiersRequest, *GetValueResponse) error
}
func RegisterValueServiceHandler(s server.Server, hdlr ValueServiceHandler, opts ...server.HandlerOption) error {
type valueService interface {
SaveValue(ctx context.Context, in *SaveValueRequest, out *SaveValueResponse) error
GetValue(ctx context.Context, in *GetValueRequest, out *GetValueResponse) error
ListValues(ctx context.Context, in *ListValuesRequest, out *ListValuesResponse) error
GetValueByUniqueIdentifiers(ctx context.Context, in *GetValueByUniqueIdentifiersRequest, out *GetValueResponse) error
}
type ValueService struct {
valueService
}
h := &valueServiceHandler{hdlr}
opts = append(opts, api.WithEndpoint(&api.Endpoint{
Name: "ValueService.SaveValue",
Path: []string{"/api/v0/settings/values-save"},
Method: []string{"POST"},
Handler: "rpc",
}))
opts = append(opts, api.WithEndpoint(&api.Endpoint{
Name: "ValueService.GetValue",
Path: []string{"/api/v0/settings/values-get"},
Method: []string{"POST"},
Handler: "rpc",
}))
opts = append(opts, api.WithEndpoint(&api.Endpoint{
Name: "ValueService.ListValues",
Path: []string{"/api/v0/settings/values-list"},
Method: []string{"POST"},
Handler: "rpc",
}))
opts = append(opts, api.WithEndpoint(&api.Endpoint{
Name: "ValueService.GetValueByUniqueIdentifiers",
Path: []string{"/api/v0/settings/values-get-by-unique-identifiers"},
Method: []string{"POST"},
Handler: "rpc",
}))
return s.Handle(s.NewHandler(&ValueService{h}, opts...))
}
type valueServiceHandler struct {
ValueServiceHandler
}
func (h *valueServiceHandler) SaveValue(ctx context.Context, in *SaveValueRequest, out *SaveValueResponse) error {
return h.ValueServiceHandler.SaveValue(ctx, in, out)
}
func (h *valueServiceHandler) GetValue(ctx context.Context, in *GetValueRequest, out *GetValueResponse) error {
return h.ValueServiceHandler.GetValue(ctx, in, out)
}
func (h *valueServiceHandler) ListValues(ctx context.Context, in *ListValuesRequest, out *ListValuesResponse) error {
return h.ValueServiceHandler.ListValues(ctx, in, out)
}
func (h *valueServiceHandler) GetValueByUniqueIdentifiers(ctx context.Context, in *GetValueByUniqueIdentifiersRequest, out *GetValueResponse) error {
return h.ValueServiceHandler.GetValueByUniqueIdentifiers(ctx, in, out)
}
// Api Endpoints for RoleService service
func NewRoleServiceEndpoints() []*api.Endpoint {
return []*api.Endpoint{
{
Name: "RoleService.ListRoles",
Path: []string{"/api/v0/settings/roles-list"},
Method: []string{"POST"},
Handler: "rpc",
},
{
Name: "RoleService.ListRoleAssignments",
Path: []string{"/api/v0/settings/assignments-list"},
Method: []string{"POST"},
Handler: "rpc",
},
{
Name: "RoleService.ListRoleAssignmentsFiltered",
Path: []string{"/api/v0/settings/assignments-list-filtered"},
Method: []string{"POST"},
Handler: "rpc",
},
{
Name: "RoleService.AssignRoleToUser",
Path: []string{"/api/v0/settings/assignments-add"},
Method: []string{"POST"},
Handler: "rpc",
},
{
Name: "RoleService.RemoveRoleFromUser",
Path: []string{"/api/v0/settings/assignments-remove"},
Method: []string{"POST"},
Handler: "rpc",
},
}
}
// Client API for RoleService service
type RoleService interface {
ListRoles(ctx context.Context, in *ListBundlesRequest, opts ...client.CallOption) (*ListBundlesResponse, error)
ListRoleAssignments(ctx context.Context, in *ListRoleAssignmentsRequest, opts ...client.CallOption) (*ListRoleAssignmentsResponse, error)
ListRoleAssignmentsFiltered(ctx context.Context, in *ListRoleAssignmentsFilteredRequest, opts ...client.CallOption) (*ListRoleAssignmentsResponse, error)
AssignRoleToUser(ctx context.Context, in *AssignRoleToUserRequest, opts ...client.CallOption) (*AssignRoleToUserResponse, error)
RemoveRoleFromUser(ctx context.Context, in *RemoveRoleFromUserRequest, opts ...client.CallOption) (*emptypb.Empty, error)
}
type roleService struct {
c client.Client
name string
}
func NewRoleService(name string, c client.Client) RoleService {
return &roleService{
c: c,
name: name,
}
}
func (c *roleService) ListRoles(ctx context.Context, in *ListBundlesRequest, opts ...client.CallOption) (*ListBundlesResponse, error) {
req := c.c.NewRequest(c.name, "RoleService.ListRoles", in)
out := new(ListBundlesResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *roleService) ListRoleAssignments(ctx context.Context, in *ListRoleAssignmentsRequest, opts ...client.CallOption) (*ListRoleAssignmentsResponse, error) {
req := c.c.NewRequest(c.name, "RoleService.ListRoleAssignments", in)
out := new(ListRoleAssignmentsResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *roleService) ListRoleAssignmentsFiltered(ctx context.Context, in *ListRoleAssignmentsFilteredRequest, opts ...client.CallOption) (*ListRoleAssignmentsResponse, error) {
req := c.c.NewRequest(c.name, "RoleService.ListRoleAssignmentsFiltered", in)
out := new(ListRoleAssignmentsResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *roleService) AssignRoleToUser(ctx context.Context, in *AssignRoleToUserRequest, opts ...client.CallOption) (*AssignRoleToUserResponse, error) {
req := c.c.NewRequest(c.name, "RoleService.AssignRoleToUser", in)
out := new(AssignRoleToUserResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *roleService) RemoveRoleFromUser(ctx context.Context, in *RemoveRoleFromUserRequest, opts ...client.CallOption) (*emptypb.Empty, error) {
req := c.c.NewRequest(c.name, "RoleService.RemoveRoleFromUser", in)
out := new(emptypb.Empty)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for RoleService service
type RoleServiceHandler interface {
ListRoles(context.Context, *ListBundlesRequest, *ListBundlesResponse) error
ListRoleAssignments(context.Context, *ListRoleAssignmentsRequest, *ListRoleAssignmentsResponse) error
ListRoleAssignmentsFiltered(context.Context, *ListRoleAssignmentsFilteredRequest, *ListRoleAssignmentsResponse) error
AssignRoleToUser(context.Context, *AssignRoleToUserRequest, *AssignRoleToUserResponse) error
RemoveRoleFromUser(context.Context, *RemoveRoleFromUserRequest, *emptypb.Empty) error
}
func RegisterRoleServiceHandler(s server.Server, hdlr RoleServiceHandler, opts ...server.HandlerOption) error {
type roleService interface {
ListRoles(ctx context.Context, in *ListBundlesRequest, out *ListBundlesResponse) error
ListRoleAssignments(ctx context.Context, in *ListRoleAssignmentsRequest, out *ListRoleAssignmentsResponse) error
ListRoleAssignmentsFiltered(ctx context.Context, in *ListRoleAssignmentsFilteredRequest, out *ListRoleAssignmentsResponse) error
AssignRoleToUser(ctx context.Context, in *AssignRoleToUserRequest, out *AssignRoleToUserResponse) error
RemoveRoleFromUser(ctx context.Context, in *RemoveRoleFromUserRequest, out *emptypb.Empty) error
}
type RoleService struct {
roleService
}
h := &roleServiceHandler{hdlr}
opts = append(opts, api.WithEndpoint(&api.Endpoint{
Name: "RoleService.ListRoles",
Path: []string{"/api/v0/settings/roles-list"},
Method: []string{"POST"},
Handler: "rpc",
}))
opts = append(opts, api.WithEndpoint(&api.Endpoint{
Name: "RoleService.ListRoleAssignments",
Path: []string{"/api/v0/settings/assignments-list"},
Method: []string{"POST"},
Handler: "rpc",
}))
opts = append(opts, api.WithEndpoint(&api.Endpoint{
Name: "RoleService.ListRoleAssignmentsFiltered",
Path: []string{"/api/v0/settings/assignments-list-filtered"},
Method: []string{"POST"},
Handler: "rpc",
}))
opts = append(opts, api.WithEndpoint(&api.Endpoint{
Name: "RoleService.AssignRoleToUser",
Path: []string{"/api/v0/settings/assignments-add"},
Method: []string{"POST"},
Handler: "rpc",
}))
opts = append(opts, api.WithEndpoint(&api.Endpoint{
Name: "RoleService.RemoveRoleFromUser",
Path: []string{"/api/v0/settings/assignments-remove"},
Method: []string{"POST"},
Handler: "rpc",
}))
return s.Handle(s.NewHandler(&RoleService{h}, opts...))
}
type roleServiceHandler struct {
RoleServiceHandler
}
func (h *roleServiceHandler) ListRoles(ctx context.Context, in *ListBundlesRequest, out *ListBundlesResponse) error {
return h.RoleServiceHandler.ListRoles(ctx, in, out)
}
func (h *roleServiceHandler) ListRoleAssignments(ctx context.Context, in *ListRoleAssignmentsRequest, out *ListRoleAssignmentsResponse) error {
return h.RoleServiceHandler.ListRoleAssignments(ctx, in, out)
}
func (h *roleServiceHandler) ListRoleAssignmentsFiltered(ctx context.Context, in *ListRoleAssignmentsFilteredRequest, out *ListRoleAssignmentsResponse) error {
return h.RoleServiceHandler.ListRoleAssignmentsFiltered(ctx, in, out)
}
func (h *roleServiceHandler) AssignRoleToUser(ctx context.Context, in *AssignRoleToUserRequest, out *AssignRoleToUserResponse) error {
return h.RoleServiceHandler.AssignRoleToUser(ctx, in, out)
}
func (h *roleServiceHandler) RemoveRoleFromUser(ctx context.Context, in *RemoveRoleFromUserRequest, out *emptypb.Empty) error {
return h.RoleServiceHandler.RemoveRoleFromUser(ctx, in, out)
}
// Api Endpoints for PermissionService service
func NewPermissionServiceEndpoints() []*api.Endpoint {
return []*api.Endpoint{
{
Name: "PermissionService.ListPermissions",
Path: []string{"/api/v0/settings/permissions-list"},
Method: []string{"POST"},
Handler: "rpc",
},
{
Name: "PermissionService.ListPermissionsByResource",
Path: []string{"/api/v0/settings/permissions-list-by-resource"},
Method: []string{"POST"},
Handler: "rpc",
},
{
Name: "PermissionService.GetPermissionByID",
Path: []string{"/api/v0/settings/permissions-get-by-id"},
Method: []string{"POST"},
Handler: "rpc",
},
}
}
// Client API for PermissionService service
type PermissionService interface {
ListPermissions(ctx context.Context, in *ListPermissionsRequest, opts ...client.CallOption) (*ListPermissionsResponse, error)
ListPermissionsByResource(ctx context.Context, in *ListPermissionsByResourceRequest, opts ...client.CallOption) (*ListPermissionsByResourceResponse, error)
GetPermissionByID(ctx context.Context, in *GetPermissionByIDRequest, opts ...client.CallOption) (*GetPermissionByIDResponse, error)
}
type permissionService struct {
c client.Client
name string
}
func NewPermissionService(name string, c client.Client) PermissionService {
return &permissionService{
c: c,
name: name,
}
}
func (c *permissionService) ListPermissions(ctx context.Context, in *ListPermissionsRequest, opts ...client.CallOption) (*ListPermissionsResponse, error) {
req := c.c.NewRequest(c.name, "PermissionService.ListPermissions", in)
out := new(ListPermissionsResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *permissionService) ListPermissionsByResource(ctx context.Context, in *ListPermissionsByResourceRequest, opts ...client.CallOption) (*ListPermissionsByResourceResponse, error) {
req := c.c.NewRequest(c.name, "PermissionService.ListPermissionsByResource", in)
out := new(ListPermissionsByResourceResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *permissionService) GetPermissionByID(ctx context.Context, in *GetPermissionByIDRequest, opts ...client.CallOption) (*GetPermissionByIDResponse, error) {
req := c.c.NewRequest(c.name, "PermissionService.GetPermissionByID", in)
out := new(GetPermissionByIDResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for PermissionService service
type PermissionServiceHandler interface {
ListPermissions(context.Context, *ListPermissionsRequest, *ListPermissionsResponse) error
ListPermissionsByResource(context.Context, *ListPermissionsByResourceRequest, *ListPermissionsByResourceResponse) error
GetPermissionByID(context.Context, *GetPermissionByIDRequest, *GetPermissionByIDResponse) error
}
func RegisterPermissionServiceHandler(s server.Server, hdlr PermissionServiceHandler, opts ...server.HandlerOption) error {
type permissionService interface {
ListPermissions(ctx context.Context, in *ListPermissionsRequest, out *ListPermissionsResponse) error
ListPermissionsByResource(ctx context.Context, in *ListPermissionsByResourceRequest, out *ListPermissionsByResourceResponse) error
GetPermissionByID(ctx context.Context, in *GetPermissionByIDRequest, out *GetPermissionByIDResponse) error
}
type PermissionService struct {
permissionService
}
h := &permissionServiceHandler{hdlr}
opts = append(opts, api.WithEndpoint(&api.Endpoint{
Name: "PermissionService.ListPermissions",
Path: []string{"/api/v0/settings/permissions-list"},
Method: []string{"POST"},
Handler: "rpc",
}))
opts = append(opts, api.WithEndpoint(&api.Endpoint{
Name: "PermissionService.ListPermissionsByResource",
Path: []string{"/api/v0/settings/permissions-list-by-resource"},
Method: []string{"POST"},
Handler: "rpc",
}))
opts = append(opts, api.WithEndpoint(&api.Endpoint{
Name: "PermissionService.GetPermissionByID",
Path: []string{"/api/v0/settings/permissions-get-by-id"},
Method: []string{"POST"},
Handler: "rpc",
}))
return s.Handle(s.NewHandler(&PermissionService{h}, opts...))
}
type permissionServiceHandler struct {
PermissionServiceHandler
}
func (h *permissionServiceHandler) ListPermissions(ctx context.Context, in *ListPermissionsRequest, out *ListPermissionsResponse) error {
return h.PermissionServiceHandler.ListPermissions(ctx, in, out)
}
func (h *permissionServiceHandler) ListPermissionsByResource(ctx context.Context, in *ListPermissionsByResourceRequest, out *ListPermissionsByResourceResponse) error {
return h.PermissionServiceHandler.ListPermissionsByResource(ctx, in, out)
}
func (h *permissionServiceHandler) GetPermissionByID(ctx context.Context, in *GetPermissionByIDRequest, out *GetPermissionByIDResponse) error {
return h.PermissionServiceHandler.GetPermissionByID(ctx, in, out)
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,922 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc (unknown)
// source: qsfera/services/settings/v0/settings.proto
package v0
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
BundleService_SaveBundle_FullMethodName = "/qsfera.services.settings.v0.BundleService/SaveBundle"
BundleService_GetBundle_FullMethodName = "/qsfera.services.settings.v0.BundleService/GetBundle"
BundleService_ListBundles_FullMethodName = "/qsfera.services.settings.v0.BundleService/ListBundles"
BundleService_AddSettingToBundle_FullMethodName = "/qsfera.services.settings.v0.BundleService/AddSettingToBundle"
BundleService_RemoveSettingFromBundle_FullMethodName = "/qsfera.services.settings.v0.BundleService/RemoveSettingFromBundle"
)
// BundleServiceClient is the client API for BundleService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type BundleServiceClient interface {
SaveBundle(ctx context.Context, in *SaveBundleRequest, opts ...grpc.CallOption) (*SaveBundleResponse, error)
GetBundle(ctx context.Context, in *GetBundleRequest, opts ...grpc.CallOption) (*GetBundleResponse, error)
ListBundles(ctx context.Context, in *ListBundlesRequest, opts ...grpc.CallOption) (*ListBundlesResponse, error)
AddSettingToBundle(ctx context.Context, in *AddSettingToBundleRequest, opts ...grpc.CallOption) (*AddSettingToBundleResponse, error)
RemoveSettingFromBundle(ctx context.Context, in *RemoveSettingFromBundleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
type bundleServiceClient struct {
cc grpc.ClientConnInterface
}
func NewBundleServiceClient(cc grpc.ClientConnInterface) BundleServiceClient {
return &bundleServiceClient{cc}
}
func (c *bundleServiceClient) SaveBundle(ctx context.Context, in *SaveBundleRequest, opts ...grpc.CallOption) (*SaveBundleResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SaveBundleResponse)
err := c.cc.Invoke(ctx, BundleService_SaveBundle_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bundleServiceClient) GetBundle(ctx context.Context, in *GetBundleRequest, opts ...grpc.CallOption) (*GetBundleResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetBundleResponse)
err := c.cc.Invoke(ctx, BundleService_GetBundle_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bundleServiceClient) ListBundles(ctx context.Context, in *ListBundlesRequest, opts ...grpc.CallOption) (*ListBundlesResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListBundlesResponse)
err := c.cc.Invoke(ctx, BundleService_ListBundles_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bundleServiceClient) AddSettingToBundle(ctx context.Context, in *AddSettingToBundleRequest, opts ...grpc.CallOption) (*AddSettingToBundleResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AddSettingToBundleResponse)
err := c.cc.Invoke(ctx, BundleService_AddSettingToBundle_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bundleServiceClient) RemoveSettingFromBundle(ctx context.Context, in *RemoveSettingFromBundleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, BundleService_RemoveSettingFromBundle_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// BundleServiceServer is the server API for BundleService service.
// All implementations must embed UnimplementedBundleServiceServer
// for forward compatibility.
type BundleServiceServer interface {
SaveBundle(context.Context, *SaveBundleRequest) (*SaveBundleResponse, error)
GetBundle(context.Context, *GetBundleRequest) (*GetBundleResponse, error)
ListBundles(context.Context, *ListBundlesRequest) (*ListBundlesResponse, error)
AddSettingToBundle(context.Context, *AddSettingToBundleRequest) (*AddSettingToBundleResponse, error)
RemoveSettingFromBundle(context.Context, *RemoveSettingFromBundleRequest) (*emptypb.Empty, error)
mustEmbedUnimplementedBundleServiceServer()
}
// UnimplementedBundleServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedBundleServiceServer struct{}
func (UnimplementedBundleServiceServer) SaveBundle(context.Context, *SaveBundleRequest) (*SaveBundleResponse, error) {
return nil, status.Error(codes.Unimplemented, "method SaveBundle not implemented")
}
func (UnimplementedBundleServiceServer) GetBundle(context.Context, *GetBundleRequest) (*GetBundleResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetBundle not implemented")
}
func (UnimplementedBundleServiceServer) ListBundles(context.Context, *ListBundlesRequest) (*ListBundlesResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ListBundles not implemented")
}
func (UnimplementedBundleServiceServer) AddSettingToBundle(context.Context, *AddSettingToBundleRequest) (*AddSettingToBundleResponse, error) {
return nil, status.Error(codes.Unimplemented, "method AddSettingToBundle not implemented")
}
func (UnimplementedBundleServiceServer) RemoveSettingFromBundle(context.Context, *RemoveSettingFromBundleRequest) (*emptypb.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method RemoveSettingFromBundle not implemented")
}
func (UnimplementedBundleServiceServer) mustEmbedUnimplementedBundleServiceServer() {}
func (UnimplementedBundleServiceServer) testEmbeddedByValue() {}
// UnsafeBundleServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to BundleServiceServer will
// result in compilation errors.
type UnsafeBundleServiceServer interface {
mustEmbedUnimplementedBundleServiceServer()
}
func RegisterBundleServiceServer(s grpc.ServiceRegistrar, srv BundleServiceServer) {
// If the following call panics, it indicates UnimplementedBundleServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&BundleService_ServiceDesc, srv)
}
func _BundleService_SaveBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SaveBundleRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BundleServiceServer).SaveBundle(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: BundleService_SaveBundle_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BundleServiceServer).SaveBundle(ctx, req.(*SaveBundleRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BundleService_GetBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetBundleRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BundleServiceServer).GetBundle(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: BundleService_GetBundle_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BundleServiceServer).GetBundle(ctx, req.(*GetBundleRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BundleService_ListBundles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListBundlesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BundleServiceServer).ListBundles(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: BundleService_ListBundles_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BundleServiceServer).ListBundles(ctx, req.(*ListBundlesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BundleService_AddSettingToBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AddSettingToBundleRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BundleServiceServer).AddSettingToBundle(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: BundleService_AddSettingToBundle_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BundleServiceServer).AddSettingToBundle(ctx, req.(*AddSettingToBundleRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BundleService_RemoveSettingFromBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RemoveSettingFromBundleRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BundleServiceServer).RemoveSettingFromBundle(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: BundleService_RemoveSettingFromBundle_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BundleServiceServer).RemoveSettingFromBundle(ctx, req.(*RemoveSettingFromBundleRequest))
}
return interceptor(ctx, in, info, handler)
}
// BundleService_ServiceDesc is the grpc.ServiceDesc for BundleService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var BundleService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "qsfera.services.settings.v0.BundleService",
HandlerType: (*BundleServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "SaveBundle",
Handler: _BundleService_SaveBundle_Handler,
},
{
MethodName: "GetBundle",
Handler: _BundleService_GetBundle_Handler,
},
{
MethodName: "ListBundles",
Handler: _BundleService_ListBundles_Handler,
},
{
MethodName: "AddSettingToBundle",
Handler: _BundleService_AddSettingToBundle_Handler,
},
{
MethodName: "RemoveSettingFromBundle",
Handler: _BundleService_RemoveSettingFromBundle_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "qsfera/services/settings/v0/settings.proto",
}
const (
ValueService_SaveValue_FullMethodName = "/qsfera.services.settings.v0.ValueService/SaveValue"
ValueService_GetValue_FullMethodName = "/qsfera.services.settings.v0.ValueService/GetValue"
ValueService_ListValues_FullMethodName = "/qsfera.services.settings.v0.ValueService/ListValues"
ValueService_GetValueByUniqueIdentifiers_FullMethodName = "/qsfera.services.settings.v0.ValueService/GetValueByUniqueIdentifiers"
)
// ValueServiceClient is the client API for ValueService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type ValueServiceClient interface {
SaveValue(ctx context.Context, in *SaveValueRequest, opts ...grpc.CallOption) (*SaveValueResponse, error)
GetValue(ctx context.Context, in *GetValueRequest, opts ...grpc.CallOption) (*GetValueResponse, error)
ListValues(ctx context.Context, in *ListValuesRequest, opts ...grpc.CallOption) (*ListValuesResponse, error)
GetValueByUniqueIdentifiers(ctx context.Context, in *GetValueByUniqueIdentifiersRequest, opts ...grpc.CallOption) (*GetValueResponse, error)
}
type valueServiceClient struct {
cc grpc.ClientConnInterface
}
func NewValueServiceClient(cc grpc.ClientConnInterface) ValueServiceClient {
return &valueServiceClient{cc}
}
func (c *valueServiceClient) SaveValue(ctx context.Context, in *SaveValueRequest, opts ...grpc.CallOption) (*SaveValueResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SaveValueResponse)
err := c.cc.Invoke(ctx, ValueService_SaveValue_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *valueServiceClient) GetValue(ctx context.Context, in *GetValueRequest, opts ...grpc.CallOption) (*GetValueResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetValueResponse)
err := c.cc.Invoke(ctx, ValueService_GetValue_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *valueServiceClient) ListValues(ctx context.Context, in *ListValuesRequest, opts ...grpc.CallOption) (*ListValuesResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListValuesResponse)
err := c.cc.Invoke(ctx, ValueService_ListValues_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *valueServiceClient) GetValueByUniqueIdentifiers(ctx context.Context, in *GetValueByUniqueIdentifiersRequest, opts ...grpc.CallOption) (*GetValueResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetValueResponse)
err := c.cc.Invoke(ctx, ValueService_GetValueByUniqueIdentifiers_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// ValueServiceServer is the server API for ValueService service.
// All implementations must embed UnimplementedValueServiceServer
// for forward compatibility.
type ValueServiceServer interface {
SaveValue(context.Context, *SaveValueRequest) (*SaveValueResponse, error)
GetValue(context.Context, *GetValueRequest) (*GetValueResponse, error)
ListValues(context.Context, *ListValuesRequest) (*ListValuesResponse, error)
GetValueByUniqueIdentifiers(context.Context, *GetValueByUniqueIdentifiersRequest) (*GetValueResponse, error)
mustEmbedUnimplementedValueServiceServer()
}
// UnimplementedValueServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedValueServiceServer struct{}
func (UnimplementedValueServiceServer) SaveValue(context.Context, *SaveValueRequest) (*SaveValueResponse, error) {
return nil, status.Error(codes.Unimplemented, "method SaveValue not implemented")
}
func (UnimplementedValueServiceServer) GetValue(context.Context, *GetValueRequest) (*GetValueResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetValue not implemented")
}
func (UnimplementedValueServiceServer) ListValues(context.Context, *ListValuesRequest) (*ListValuesResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ListValues not implemented")
}
func (UnimplementedValueServiceServer) GetValueByUniqueIdentifiers(context.Context, *GetValueByUniqueIdentifiersRequest) (*GetValueResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetValueByUniqueIdentifiers not implemented")
}
func (UnimplementedValueServiceServer) mustEmbedUnimplementedValueServiceServer() {}
func (UnimplementedValueServiceServer) testEmbeddedByValue() {}
// UnsafeValueServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ValueServiceServer will
// result in compilation errors.
type UnsafeValueServiceServer interface {
mustEmbedUnimplementedValueServiceServer()
}
func RegisterValueServiceServer(s grpc.ServiceRegistrar, srv ValueServiceServer) {
// If the following call panics, it indicates UnimplementedValueServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&ValueService_ServiceDesc, srv)
}
func _ValueService_SaveValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SaveValueRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ValueServiceServer).SaveValue(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ValueService_SaveValue_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ValueServiceServer).SaveValue(ctx, req.(*SaveValueRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ValueService_GetValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetValueRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ValueServiceServer).GetValue(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ValueService_GetValue_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ValueServiceServer).GetValue(ctx, req.(*GetValueRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ValueService_ListValues_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListValuesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ValueServiceServer).ListValues(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ValueService_ListValues_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ValueServiceServer).ListValues(ctx, req.(*ListValuesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ValueService_GetValueByUniqueIdentifiers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetValueByUniqueIdentifiersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ValueServiceServer).GetValueByUniqueIdentifiers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ValueService_GetValueByUniqueIdentifiers_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ValueServiceServer).GetValueByUniqueIdentifiers(ctx, req.(*GetValueByUniqueIdentifiersRequest))
}
return interceptor(ctx, in, info, handler)
}
// ValueService_ServiceDesc is the grpc.ServiceDesc for ValueService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ValueService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "qsfera.services.settings.v0.ValueService",
HandlerType: (*ValueServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "SaveValue",
Handler: _ValueService_SaveValue_Handler,
},
{
MethodName: "GetValue",
Handler: _ValueService_GetValue_Handler,
},
{
MethodName: "ListValues",
Handler: _ValueService_ListValues_Handler,
},
{
MethodName: "GetValueByUniqueIdentifiers",
Handler: _ValueService_GetValueByUniqueIdentifiers_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "qsfera/services/settings/v0/settings.proto",
}
const (
RoleService_ListRoles_FullMethodName = "/qsfera.services.settings.v0.RoleService/ListRoles"
RoleService_ListRoleAssignments_FullMethodName = "/qsfera.services.settings.v0.RoleService/ListRoleAssignments"
RoleService_ListRoleAssignmentsFiltered_FullMethodName = "/qsfera.services.settings.v0.RoleService/ListRoleAssignmentsFiltered"
RoleService_AssignRoleToUser_FullMethodName = "/qsfera.services.settings.v0.RoleService/AssignRoleToUser"
RoleService_RemoveRoleFromUser_FullMethodName = "/qsfera.services.settings.v0.RoleService/RemoveRoleFromUser"
)
// RoleServiceClient is the client API for RoleService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type RoleServiceClient interface {
ListRoles(ctx context.Context, in *ListBundlesRequest, opts ...grpc.CallOption) (*ListBundlesResponse, error)
ListRoleAssignments(ctx context.Context, in *ListRoleAssignmentsRequest, opts ...grpc.CallOption) (*ListRoleAssignmentsResponse, error)
ListRoleAssignmentsFiltered(ctx context.Context, in *ListRoleAssignmentsFilteredRequest, opts ...grpc.CallOption) (*ListRoleAssignmentsResponse, error)
AssignRoleToUser(ctx context.Context, in *AssignRoleToUserRequest, opts ...grpc.CallOption) (*AssignRoleToUserResponse, error)
RemoveRoleFromUser(ctx context.Context, in *RemoveRoleFromUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
type roleServiceClient struct {
cc grpc.ClientConnInterface
}
func NewRoleServiceClient(cc grpc.ClientConnInterface) RoleServiceClient {
return &roleServiceClient{cc}
}
func (c *roleServiceClient) ListRoles(ctx context.Context, in *ListBundlesRequest, opts ...grpc.CallOption) (*ListBundlesResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListBundlesResponse)
err := c.cc.Invoke(ctx, RoleService_ListRoles_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *roleServiceClient) ListRoleAssignments(ctx context.Context, in *ListRoleAssignmentsRequest, opts ...grpc.CallOption) (*ListRoleAssignmentsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListRoleAssignmentsResponse)
err := c.cc.Invoke(ctx, RoleService_ListRoleAssignments_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *roleServiceClient) ListRoleAssignmentsFiltered(ctx context.Context, in *ListRoleAssignmentsFilteredRequest, opts ...grpc.CallOption) (*ListRoleAssignmentsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListRoleAssignmentsResponse)
err := c.cc.Invoke(ctx, RoleService_ListRoleAssignmentsFiltered_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *roleServiceClient) AssignRoleToUser(ctx context.Context, in *AssignRoleToUserRequest, opts ...grpc.CallOption) (*AssignRoleToUserResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AssignRoleToUserResponse)
err := c.cc.Invoke(ctx, RoleService_AssignRoleToUser_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *roleServiceClient) RemoveRoleFromUser(ctx context.Context, in *RemoveRoleFromUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, RoleService_RemoveRoleFromUser_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// RoleServiceServer is the server API for RoleService service.
// All implementations must embed UnimplementedRoleServiceServer
// for forward compatibility.
type RoleServiceServer interface {
ListRoles(context.Context, *ListBundlesRequest) (*ListBundlesResponse, error)
ListRoleAssignments(context.Context, *ListRoleAssignmentsRequest) (*ListRoleAssignmentsResponse, error)
ListRoleAssignmentsFiltered(context.Context, *ListRoleAssignmentsFilteredRequest) (*ListRoleAssignmentsResponse, error)
AssignRoleToUser(context.Context, *AssignRoleToUserRequest) (*AssignRoleToUserResponse, error)
RemoveRoleFromUser(context.Context, *RemoveRoleFromUserRequest) (*emptypb.Empty, error)
mustEmbedUnimplementedRoleServiceServer()
}
// UnimplementedRoleServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedRoleServiceServer struct{}
func (UnimplementedRoleServiceServer) ListRoles(context.Context, *ListBundlesRequest) (*ListBundlesResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ListRoles not implemented")
}
func (UnimplementedRoleServiceServer) ListRoleAssignments(context.Context, *ListRoleAssignmentsRequest) (*ListRoleAssignmentsResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ListRoleAssignments not implemented")
}
func (UnimplementedRoleServiceServer) ListRoleAssignmentsFiltered(context.Context, *ListRoleAssignmentsFilteredRequest) (*ListRoleAssignmentsResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ListRoleAssignmentsFiltered not implemented")
}
func (UnimplementedRoleServiceServer) AssignRoleToUser(context.Context, *AssignRoleToUserRequest) (*AssignRoleToUserResponse, error) {
return nil, status.Error(codes.Unimplemented, "method AssignRoleToUser not implemented")
}
func (UnimplementedRoleServiceServer) RemoveRoleFromUser(context.Context, *RemoveRoleFromUserRequest) (*emptypb.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method RemoveRoleFromUser not implemented")
}
func (UnimplementedRoleServiceServer) mustEmbedUnimplementedRoleServiceServer() {}
func (UnimplementedRoleServiceServer) testEmbeddedByValue() {}
// UnsafeRoleServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to RoleServiceServer will
// result in compilation errors.
type UnsafeRoleServiceServer interface {
mustEmbedUnimplementedRoleServiceServer()
}
func RegisterRoleServiceServer(s grpc.ServiceRegistrar, srv RoleServiceServer) {
// If the following call panics, it indicates UnimplementedRoleServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&RoleService_ServiceDesc, srv)
}
func _RoleService_ListRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListBundlesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RoleServiceServer).ListRoles(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: RoleService_ListRoles_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RoleServiceServer).ListRoles(ctx, req.(*ListBundlesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _RoleService_ListRoleAssignments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListRoleAssignmentsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RoleServiceServer).ListRoleAssignments(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: RoleService_ListRoleAssignments_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RoleServiceServer).ListRoleAssignments(ctx, req.(*ListRoleAssignmentsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _RoleService_ListRoleAssignmentsFiltered_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListRoleAssignmentsFilteredRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RoleServiceServer).ListRoleAssignmentsFiltered(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: RoleService_ListRoleAssignmentsFiltered_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RoleServiceServer).ListRoleAssignmentsFiltered(ctx, req.(*ListRoleAssignmentsFilteredRequest))
}
return interceptor(ctx, in, info, handler)
}
func _RoleService_AssignRoleToUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AssignRoleToUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RoleServiceServer).AssignRoleToUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: RoleService_AssignRoleToUser_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RoleServiceServer).AssignRoleToUser(ctx, req.(*AssignRoleToUserRequest))
}
return interceptor(ctx, in, info, handler)
}
func _RoleService_RemoveRoleFromUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RemoveRoleFromUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RoleServiceServer).RemoveRoleFromUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: RoleService_RemoveRoleFromUser_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RoleServiceServer).RemoveRoleFromUser(ctx, req.(*RemoveRoleFromUserRequest))
}
return interceptor(ctx, in, info, handler)
}
// RoleService_ServiceDesc is the grpc.ServiceDesc for RoleService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var RoleService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "qsfera.services.settings.v0.RoleService",
HandlerType: (*RoleServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ListRoles",
Handler: _RoleService_ListRoles_Handler,
},
{
MethodName: "ListRoleAssignments",
Handler: _RoleService_ListRoleAssignments_Handler,
},
{
MethodName: "ListRoleAssignmentsFiltered",
Handler: _RoleService_ListRoleAssignmentsFiltered_Handler,
},
{
MethodName: "AssignRoleToUser",
Handler: _RoleService_AssignRoleToUser_Handler,
},
{
MethodName: "RemoveRoleFromUser",
Handler: _RoleService_RemoveRoleFromUser_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "qsfera/services/settings/v0/settings.proto",
}
const (
PermissionService_ListPermissions_FullMethodName = "/qsfera.services.settings.v0.PermissionService/ListPermissions"
PermissionService_ListPermissionsByResource_FullMethodName = "/qsfera.services.settings.v0.PermissionService/ListPermissionsByResource"
PermissionService_GetPermissionByID_FullMethodName = "/qsfera.services.settings.v0.PermissionService/GetPermissionByID"
)
// PermissionServiceClient is the client API for PermissionService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type PermissionServiceClient interface {
ListPermissions(ctx context.Context, in *ListPermissionsRequest, opts ...grpc.CallOption) (*ListPermissionsResponse, error)
ListPermissionsByResource(ctx context.Context, in *ListPermissionsByResourceRequest, opts ...grpc.CallOption) (*ListPermissionsByResourceResponse, error)
GetPermissionByID(ctx context.Context, in *GetPermissionByIDRequest, opts ...grpc.CallOption) (*GetPermissionByIDResponse, error)
}
type permissionServiceClient struct {
cc grpc.ClientConnInterface
}
func NewPermissionServiceClient(cc grpc.ClientConnInterface) PermissionServiceClient {
return &permissionServiceClient{cc}
}
func (c *permissionServiceClient) ListPermissions(ctx context.Context, in *ListPermissionsRequest, opts ...grpc.CallOption) (*ListPermissionsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListPermissionsResponse)
err := c.cc.Invoke(ctx, PermissionService_ListPermissions_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *permissionServiceClient) ListPermissionsByResource(ctx context.Context, in *ListPermissionsByResourceRequest, opts ...grpc.CallOption) (*ListPermissionsByResourceResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListPermissionsByResourceResponse)
err := c.cc.Invoke(ctx, PermissionService_ListPermissionsByResource_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *permissionServiceClient) GetPermissionByID(ctx context.Context, in *GetPermissionByIDRequest, opts ...grpc.CallOption) (*GetPermissionByIDResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetPermissionByIDResponse)
err := c.cc.Invoke(ctx, PermissionService_GetPermissionByID_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// PermissionServiceServer is the server API for PermissionService service.
// All implementations must embed UnimplementedPermissionServiceServer
// for forward compatibility.
type PermissionServiceServer interface {
ListPermissions(context.Context, *ListPermissionsRequest) (*ListPermissionsResponse, error)
ListPermissionsByResource(context.Context, *ListPermissionsByResourceRequest) (*ListPermissionsByResourceResponse, error)
GetPermissionByID(context.Context, *GetPermissionByIDRequest) (*GetPermissionByIDResponse, error)
mustEmbedUnimplementedPermissionServiceServer()
}
// UnimplementedPermissionServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedPermissionServiceServer struct{}
func (UnimplementedPermissionServiceServer) ListPermissions(context.Context, *ListPermissionsRequest) (*ListPermissionsResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ListPermissions not implemented")
}
func (UnimplementedPermissionServiceServer) ListPermissionsByResource(context.Context, *ListPermissionsByResourceRequest) (*ListPermissionsByResourceResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ListPermissionsByResource not implemented")
}
func (UnimplementedPermissionServiceServer) GetPermissionByID(context.Context, *GetPermissionByIDRequest) (*GetPermissionByIDResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetPermissionByID not implemented")
}
func (UnimplementedPermissionServiceServer) mustEmbedUnimplementedPermissionServiceServer() {}
func (UnimplementedPermissionServiceServer) testEmbeddedByValue() {}
// UnsafePermissionServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to PermissionServiceServer will
// result in compilation errors.
type UnsafePermissionServiceServer interface {
mustEmbedUnimplementedPermissionServiceServer()
}
func RegisterPermissionServiceServer(s grpc.ServiceRegistrar, srv PermissionServiceServer) {
// If the following call panics, it indicates UnimplementedPermissionServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&PermissionService_ServiceDesc, srv)
}
func _PermissionService_ListPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListPermissionsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PermissionServiceServer).ListPermissions(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: PermissionService_ListPermissions_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PermissionServiceServer).ListPermissions(ctx, req.(*ListPermissionsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _PermissionService_ListPermissionsByResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListPermissionsByResourceRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PermissionServiceServer).ListPermissionsByResource(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: PermissionService_ListPermissionsByResource_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PermissionServiceServer).ListPermissionsByResource(ctx, req.(*ListPermissionsByResourceRequest))
}
return interceptor(ctx, in, info, handler)
}
func _PermissionService_GetPermissionByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetPermissionByIDRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PermissionServiceServer).GetPermissionByID(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: PermissionService_GetPermissionByID_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PermissionServiceServer).GetPermissionByID(ctx, req.(*GetPermissionByIDRequest))
}
return interceptor(ctx, in, info, handler)
}
// PermissionService_ServiceDesc is the grpc.ServiceDesc for PermissionService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var PermissionService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "qsfera.services.settings.v0.PermissionService",
HandlerType: (*PermissionServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ListPermissions",
Handler: _PermissionService_ListPermissions_Handler,
},
{
MethodName: "ListPermissionsByResource",
Handler: _PermissionService_ListPermissionsByResource_Handler,
},
{
MethodName: "GetPermissionByID",
Handler: _PermissionService_GetPermissionByID_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "qsfera/services/settings/v0/settings.proto",
}
@@ -0,0 +1,123 @@
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"context"
"github.com/qsfera/server/protogen/gen/qsfera/services/thumbnails/v0"
mock "github.com/stretchr/testify/mock"
"go-micro.dev/v4/client"
)
// NewThumbnailService creates a new instance of ThumbnailService. 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 NewThumbnailService(t interface {
mock.TestingT
Cleanup(func())
}) *ThumbnailService {
mock := &ThumbnailService{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// ThumbnailService is an autogenerated mock type for the ThumbnailService type
type ThumbnailService struct {
mock.Mock
}
type ThumbnailService_Expecter struct {
mock *mock.Mock
}
func (_m *ThumbnailService) EXPECT() *ThumbnailService_Expecter {
return &ThumbnailService_Expecter{mock: &_m.Mock}
}
// GetThumbnail provides a mock function for the type ThumbnailService
func (_mock *ThumbnailService) GetThumbnail(ctx context.Context, in *v0.GetThumbnailRequest, opts ...client.CallOption) (*v0.GetThumbnailResponse, error) {
var tmpRet mock.Arguments
if len(opts) > 0 {
tmpRet = _mock.Called(ctx, in, opts)
} else {
tmpRet = _mock.Called(ctx, in)
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for GetThumbnail")
}
var r0 *v0.GetThumbnailResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetThumbnailRequest, ...client.CallOption) (*v0.GetThumbnailResponse, error)); ok {
return returnFunc(ctx, in, opts...)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetThumbnailRequest, ...client.CallOption) *v0.GetThumbnailResponse); ok {
r0 = returnFunc(ctx, in, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v0.GetThumbnailResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.GetThumbnailRequest, ...client.CallOption) error); ok {
r1 = returnFunc(ctx, in, opts...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ThumbnailService_GetThumbnail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetThumbnail'
type ThumbnailService_GetThumbnail_Call struct {
*mock.Call
}
// GetThumbnail is a helper method to define mock.On call
// - ctx context.Context
// - in *v0.GetThumbnailRequest
// - opts ...client.CallOption
func (_e *ThumbnailService_Expecter) GetThumbnail(ctx interface{}, in interface{}, opts ...interface{}) *ThumbnailService_GetThumbnail_Call {
return &ThumbnailService_GetThumbnail_Call{Call: _e.mock.On("GetThumbnail",
append([]interface{}{ctx, in}, opts...)...)}
}
func (_c *ThumbnailService_GetThumbnail_Call) Run(run func(ctx context.Context, in *v0.GetThumbnailRequest, opts ...client.CallOption)) *ThumbnailService_GetThumbnail_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *v0.GetThumbnailRequest
if args[1] != nil {
arg1 = args[1].(*v0.GetThumbnailRequest)
}
var arg2 []client.CallOption
var variadicArgs []client.CallOption
if len(args) > 2 {
variadicArgs = args[2].([]client.CallOption)
}
arg2 = variadicArgs
run(
arg0,
arg1,
arg2...,
)
})
return _c
}
func (_c *ThumbnailService_GetThumbnail_Call) Return(getThumbnailResponse *v0.GetThumbnailResponse, err error) *ThumbnailService_GetThumbnail_Call {
_c.Call.Return(getThumbnailResponse, err)
return _c
}
func (_c *ThumbnailService_GetThumbnail_Call) RunAndReturn(run func(ctx context.Context, in *v0.GetThumbnailRequest, opts ...client.CallOption) (*v0.GetThumbnailResponse, error)) *ThumbnailService_GetThumbnail_Call {
_c.Call.Return(run)
return _c
}
@@ -0,0 +1,388 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc (unknown)
// source: qsfera/services/thumbnails/v0/thumbnails.proto
package v0
import (
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
v0 "github.com/qsfera/server/protogen/gen/qsfera/messages/thumbnails/v0"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// A request to retrieve a thumbnail
type GetThumbnailRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The path to the source image
Filepath string `protobuf:"bytes,1,opt,name=filepath,proto3" json:"filepath,omitempty"`
// The type to which the thumbnail should get encoded to.
ThumbnailType v0.ThumbnailType `protobuf:"varint,2,opt,name=thumbnail_type,json=thumbnailType,proto3,enum=qsfera.messages.thumbnails.v0.ThumbnailType" json:"thumbnail_type,omitempty"`
// The width of the thumbnail
Width int32 `protobuf:"varint,3,opt,name=width,proto3" json:"width,omitempty"`
// The height of the thumbnail
Height int32 `protobuf:"varint,4,opt,name=height,proto3" json:"height,omitempty"`
// Indicates which image processor to use
Processor string `protobuf:"bytes,5,opt,name=processor,proto3" json:"processor,omitempty"`
// Types that are assignable to Source:
//
// *GetThumbnailRequest_WebdavSource
// *GetThumbnailRequest_Cs3Source
Source isGetThumbnailRequest_Source `protobuf_oneof:"source"`
}
func (x *GetThumbnailRequest) Reset() {
*x = GetThumbnailRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_qsfera_services_thumbnails_v0_thumbnails_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetThumbnailRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetThumbnailRequest) ProtoMessage() {}
func (x *GetThumbnailRequest) ProtoReflect() protoreflect.Message {
mi := &file_qsfera_services_thumbnails_v0_thumbnails_proto_msgTypes[0]
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 GetThumbnailRequest.ProtoReflect.Descriptor instead.
func (*GetThumbnailRequest) Descriptor() ([]byte, []int) {
return file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDescGZIP(), []int{0}
}
func (x *GetThumbnailRequest) GetFilepath() string {
if x != nil {
return x.Filepath
}
return ""
}
func (x *GetThumbnailRequest) GetThumbnailType() v0.ThumbnailType {
if x != nil {
return x.ThumbnailType
}
return v0.ThumbnailType(0)
}
func (x *GetThumbnailRequest) GetWidth() int32 {
if x != nil {
return x.Width
}
return 0
}
func (x *GetThumbnailRequest) GetHeight() int32 {
if x != nil {
return x.Height
}
return 0
}
func (x *GetThumbnailRequest) GetProcessor() string {
if x != nil {
return x.Processor
}
return ""
}
func (m *GetThumbnailRequest) GetSource() isGetThumbnailRequest_Source {
if m != nil {
return m.Source
}
return nil
}
func (x *GetThumbnailRequest) GetWebdavSource() *v0.WebdavSource {
if x, ok := x.GetSource().(*GetThumbnailRequest_WebdavSource); ok {
return x.WebdavSource
}
return nil
}
func (x *GetThumbnailRequest) GetCs3Source() *v0.CS3Source {
if x, ok := x.GetSource().(*GetThumbnailRequest_Cs3Source); ok {
return x.Cs3Source
}
return nil
}
type isGetThumbnailRequest_Source interface {
isGetThumbnailRequest_Source()
}
type GetThumbnailRequest_WebdavSource struct {
WebdavSource *v0.WebdavSource `protobuf:"bytes,6,opt,name=webdav_source,json=webdavSource,proto3,oneof"`
}
type GetThumbnailRequest_Cs3Source struct {
Cs3Source *v0.CS3Source `protobuf:"bytes,7,opt,name=cs3_source,json=cs3Source,proto3,oneof"`
}
func (*GetThumbnailRequest_WebdavSource) isGetThumbnailRequest_Source() {}
func (*GetThumbnailRequest_Cs3Source) isGetThumbnailRequest_Source() {}
// The service response
type GetThumbnailResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The endpoint where the thumbnail can be downloaded.
DataEndpoint string `protobuf:"bytes,1,opt,name=data_endpoint,json=dataEndpoint,proto3" json:"data_endpoint,omitempty"`
// The transfer token to be able to download the thumbnail.
TransferToken string `protobuf:"bytes,2,opt,name=transfer_token,json=transferToken,proto3" json:"transfer_token,omitempty"`
// The mimetype of the thumbnail
Mimetype string `protobuf:"bytes,3,opt,name=mimetype,proto3" json:"mimetype,omitempty"`
}
func (x *GetThumbnailResponse) Reset() {
*x = GetThumbnailResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_qsfera_services_thumbnails_v0_thumbnails_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetThumbnailResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetThumbnailResponse) ProtoMessage() {}
func (x *GetThumbnailResponse) ProtoReflect() protoreflect.Message {
mi := &file_qsfera_services_thumbnails_v0_thumbnails_proto_msgTypes[1]
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 GetThumbnailResponse.ProtoReflect.Descriptor instead.
func (*GetThumbnailResponse) Descriptor() ([]byte, []int) {
return file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDescGZIP(), []int{1}
}
func (x *GetThumbnailResponse) GetDataEndpoint() string {
if x != nil {
return x.DataEndpoint
}
return ""
}
func (x *GetThumbnailResponse) GetTransferToken() string {
if x != nil {
return x.TransferToken
}
return ""
}
func (x *GetThumbnailResponse) GetMimetype() string {
if x != nil {
return x.Mimetype
}
return ""
}
var File_qsfera_services_thumbnails_v0_thumbnails_proto protoreflect.FileDescriptor
var file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDesc = []byte{
0x0a, 0x31, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x73, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x73, 0x2f, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x73, 0x2f,
0x76, 0x30, 0x2f, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x20, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69,
0x6c, 0x73, 0x2e, 0x76, 0x30, 0x1a, 0x31, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2f, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e,
0x61, 0x69, 0x6c, 0x73, 0x2f, 0x76, 0x30, 0x2f, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69,
0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63,
0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f,
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x84, 0x03, 0x0a, 0x13, 0x47, 0x65, 0x74,
0x54, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x70, 0x61, 0x74, 0x68, 0x12, 0x56, 0x0a, 0x0e,
0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e,
0x61, 0x69, 0x6c, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x54, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69,
0x6c, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0d, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c,
0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, 0x03, 0x20,
0x01, 0x28, 0x05, 0x52, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65,
0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67,
0x68, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x18,
0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72,
0x12, 0x55, 0x0a, 0x0d, 0x77, 0x65, 0x62, 0x64, 0x61, 0x76, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63,
0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x74, 0x68, 0x75,
0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x57, 0x65, 0x62, 0x64, 0x61,
0x76, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x77, 0x65, 0x62, 0x64, 0x61,
0x76, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x4c, 0x0a, 0x0a, 0x63, 0x73, 0x33, 0x5f, 0x73,
0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6f, 0x70,
0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73,
0x2e, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x43,
0x53, 0x33, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x00, 0x52, 0x09, 0x63, 0x73, 0x33, 0x53,
0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22,
0x7e, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x54, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x5f,
0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c,
0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e,
0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x54, 0x6f,
0x6b, 0x65, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x74, 0x79, 0x70, 0x65, 0x18,
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x74, 0x79, 0x70, 0x65, 0x32,
0x91, 0x01, 0x0a, 0x10, 0x54, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x12, 0x7d, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x54, 0x68, 0x75, 0x6d, 0x62,
0x6e, 0x61, 0x69, 0x6c, 0x12, 0x35, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e,
0x61, 0x69, 0x6c, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x68, 0x75, 0x6d, 0x62,
0x6e, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x6f, 0x70,
0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73,
0x2e, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x47,
0x65, 0x74, 0x54, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x42, 0xff, 0x02, 0x5a, 0x4f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x65, 0x75, 0x2f,
0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67,
0x65, 0x6e, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e,
0x61, 0x69, 0x6c, 0x73, 0x2f, 0x76, 0x30, 0x92, 0x41, 0xaa, 0x02, 0x12, 0xbb, 0x01, 0x0a, 0x14,
0x4f, 0x70, 0x65, 0x6e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x20, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e,
0x61, 0x69, 0x6c, 0x73, 0x22, 0x51, 0x0a, 0x0e, 0x4f, 0x70, 0x65, 0x6e, 0x43, 0x6c, 0x6f, 0x75,
0x64, 0x20, 0x47, 0x6d, 0x62, 0x48, 0x12, 0x29, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f,
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63,
0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x65, 0x75, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75,
0x64, 0x1a, 0x14, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x40, 0x6f, 0x70, 0x65, 0x6e, 0x63,
0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x65, 0x75, 0x2a, 0x49, 0x0a, 0x0a, 0x41, 0x70, 0x61, 0x63, 0x68,
0x65, 0x2d, 0x32, 0x2e, 0x30, 0x12, 0x3b, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2d, 0x65, 0x75, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, 0x69, 0x6e, 0x2f, 0x4c, 0x49, 0x43, 0x45, 0x4e,
0x53, 0x45, 0x32, 0x05, 0x31, 0x2e, 0x30, 0x2e, 0x30, 0x2a, 0x02, 0x01, 0x02, 0x32, 0x10, 0x61,
0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a,
0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f,
0x6e, 0x72, 0x42, 0x0a, 0x10, 0x44, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x20, 0x4d,
0x61, 0x6e, 0x75, 0x61, 0x6c, 0x12, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64,
0x6f, 0x63, 0x73, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x65, 0x75,
0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e,
0x61, 0x69, 0x6c, 0x73, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDescOnce sync.Once
file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDescData = file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDesc
)
func file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDescGZIP() []byte {
file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDescOnce.Do(func() {
file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDescData = protoimpl.X.CompressGZIP(file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDescData)
})
return file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDescData
}
var file_qsfera_services_thumbnails_v0_thumbnails_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_qsfera_services_thumbnails_v0_thumbnails_proto_goTypes = []interface{}{
(*GetThumbnailRequest)(nil), // 0: qsfera.services.thumbnails.v0.GetThumbnailRequest
(*GetThumbnailResponse)(nil), // 1: qsfera.services.thumbnails.v0.GetThumbnailResponse
(v0.ThumbnailType)(0), // 2: qsfera.messages.thumbnails.v0.ThumbnailType
(*v0.WebdavSource)(nil), // 3: qsfera.messages.thumbnails.v0.WebdavSource
(*v0.CS3Source)(nil), // 4: qsfera.messages.thumbnails.v0.CS3Source
}
var file_qsfera_services_thumbnails_v0_thumbnails_proto_depIdxs = []int32{
2, // 0: qsfera.services.thumbnails.v0.GetThumbnailRequest.thumbnail_type:type_name -> qsfera.messages.thumbnails.v0.ThumbnailType
3, // 1: qsfera.services.thumbnails.v0.GetThumbnailRequest.webdav_source:type_name -> qsfera.messages.thumbnails.v0.WebdavSource
4, // 2: qsfera.services.thumbnails.v0.GetThumbnailRequest.cs3_source:type_name -> qsfera.messages.thumbnails.v0.CS3Source
0, // 3: qsfera.services.thumbnails.v0.ThumbnailService.GetThumbnail:input_type -> qsfera.services.thumbnails.v0.GetThumbnailRequest
1, // 4: qsfera.services.thumbnails.v0.ThumbnailService.GetThumbnail:output_type -> qsfera.services.thumbnails.v0.GetThumbnailResponse
4, // [4:5] is the sub-list for method output_type
3, // [3:4] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_qsfera_services_thumbnails_v0_thumbnails_proto_init() }
func file_qsfera_services_thumbnails_v0_thumbnails_proto_init() {
if File_qsfera_services_thumbnails_v0_thumbnails_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_qsfera_services_thumbnails_v0_thumbnails_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetThumbnailRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_qsfera_services_thumbnails_v0_thumbnails_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetThumbnailResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_qsfera_services_thumbnails_v0_thumbnails_proto_msgTypes[0].OneofWrappers = []interface{}{
(*GetThumbnailRequest_WebdavSource)(nil),
(*GetThumbnailRequest_Cs3Source)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_qsfera_services_thumbnails_v0_thumbnails_proto_goTypes,
DependencyIndexes: file_qsfera_services_thumbnails_v0_thumbnails_proto_depIdxs,
MessageInfos: file_qsfera_services_thumbnails_v0_thumbnails_proto_msgTypes,
}.Build()
File_qsfera_services_thumbnails_v0_thumbnails_proto = out.File
file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDesc = nil
file_qsfera_services_thumbnails_v0_thumbnails_proto_goTypes = nil
file_qsfera_services_thumbnails_v0_thumbnails_proto_depIdxs = nil
}
@@ -0,0 +1,91 @@
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: qsfera/services/thumbnails/v0/thumbnails.proto
package v0
import (
fmt "fmt"
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
_ "github.com/qsfera/server/protogen/gen/qsfera/messages/thumbnails/v0"
proto "google.golang.org/protobuf/proto"
math "math"
)
import (
context "context"
api "go-micro.dev/v4/api"
client "go-micro.dev/v4/client"
server "go-micro.dev/v4/server"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// Reference imports to suppress errors if they are not otherwise used.
var _ api.Endpoint
var _ context.Context
var _ client.Option
var _ server.Option
// Api Endpoints for ThumbnailService service
func NewThumbnailServiceEndpoints() []*api.Endpoint {
return []*api.Endpoint{}
}
// Client API for ThumbnailService service
type ThumbnailService interface {
// Generates the thumbnail and returns it.
GetThumbnail(ctx context.Context, in *GetThumbnailRequest, opts ...client.CallOption) (*GetThumbnailResponse, error)
}
type thumbnailService struct {
c client.Client
name string
}
func NewThumbnailService(name string, c client.Client) ThumbnailService {
return &thumbnailService{
c: c,
name: name,
}
}
func (c *thumbnailService) GetThumbnail(ctx context.Context, in *GetThumbnailRequest, opts ...client.CallOption) (*GetThumbnailResponse, error) {
req := c.c.NewRequest(c.name, "ThumbnailService.GetThumbnail", in)
out := new(GetThumbnailResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for ThumbnailService service
type ThumbnailServiceHandler interface {
// Generates the thumbnail and returns it.
GetThumbnail(context.Context, *GetThumbnailRequest, *GetThumbnailResponse) error
}
func RegisterThumbnailServiceHandler(s server.Server, hdlr ThumbnailServiceHandler, opts ...server.HandlerOption) error {
type thumbnailService interface {
GetThumbnail(ctx context.Context, in *GetThumbnailRequest, out *GetThumbnailResponse) error
}
type ThumbnailService struct {
thumbnailService
}
h := &thumbnailServiceHandler{hdlr}
return s.Handle(s.NewHandler(&ThumbnailService{h}, opts...))
}
type thumbnailServiceHandler struct {
ThumbnailServiceHandler
}
func (h *thumbnailServiceHandler) GetThumbnail(ctx context.Context, in *GetThumbnailRequest, out *GetThumbnailResponse) error {
return h.ThumbnailServiceHandler.GetThumbnail(ctx, in, out)
}
@@ -0,0 +1,129 @@
{
"swagger": "2.0",
"info": {
"title": "КуСфера thumbnails",
"version": "1.0.0",
"contact": {
"name": "КуСфера",
"url": "",
"email": ""
},
"license": {
"name": "Apache-2.0",
"url": ""
}
},
"tags": [
{
"name": "ThumbnailService"
}
],
"schemes": [
"http",
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {},
"definitions": {
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"rpcStatus": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"$ref": "#/definitions/protobufAny"
}
}
}
},
"v0CS3Source": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"authorization": {
"type": "string"
}
}
},
"v0GetThumbnailResponse": {
"type": "object",
"properties": {
"dataEndpoint": {
"type": "string",
"description": "The endpoint where the thumbnail can be downloaded."
},
"transferToken": {
"type": "string",
"description": "The transfer token to be able to download the thumbnail."
},
"mimetype": {
"type": "string",
"title": "The mimetype of the thumbnail"
}
},
"title": "The service response"
},
"v0ThumbnailType": {
"type": "string",
"enum": [
"PNG",
"JPG",
"GIF"
],
"default": "PNG",
"description": "The file types to which the thumbnail can be encoded to.\n\n - PNG: Represents PNG type\n - JPG: Represents JPG type\n - GIF: Represents GIF type"
},
"v0WebdavSource": {
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "REQUIRED."
},
"isPublicLink": {
"type": "boolean",
"description": "REQUIRED."
},
"webdavAuthorization": {
"type": "string",
"description": "OPTIONAL."
},
"revaAuthorization": {
"type": "string",
"description": "OPTIONAL."
},
"publicLinkToken": {
"type": "string",
"description": "OPTIONAL."
}
}
}
},
"externalDocs": {
"description": "Developer Manual",
"url": ""
}
}
@@ -0,0 +1,127 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc (unknown)
// source: qsfera/services/thumbnails/v0/thumbnails.proto
package v0
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
ThumbnailService_GetThumbnail_FullMethodName = "/qsfera.services.thumbnails.v0.ThumbnailService/GetThumbnail"
)
// ThumbnailServiceClient is the client API for ThumbnailService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// A Service for handling thumbnail generation
type ThumbnailServiceClient interface {
// Generates the thumbnail and returns it.
GetThumbnail(ctx context.Context, in *GetThumbnailRequest, opts ...grpc.CallOption) (*GetThumbnailResponse, error)
}
type thumbnailServiceClient struct {
cc grpc.ClientConnInterface
}
func NewThumbnailServiceClient(cc grpc.ClientConnInterface) ThumbnailServiceClient {
return &thumbnailServiceClient{cc}
}
func (c *thumbnailServiceClient) GetThumbnail(ctx context.Context, in *GetThumbnailRequest, opts ...grpc.CallOption) (*GetThumbnailResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetThumbnailResponse)
err := c.cc.Invoke(ctx, ThumbnailService_GetThumbnail_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// ThumbnailServiceServer is the server API for ThumbnailService service.
// All implementations must embed UnimplementedThumbnailServiceServer
// for forward compatibility.
//
// A Service for handling thumbnail generation
type ThumbnailServiceServer interface {
// Generates the thumbnail and returns it.
GetThumbnail(context.Context, *GetThumbnailRequest) (*GetThumbnailResponse, error)
mustEmbedUnimplementedThumbnailServiceServer()
}
// UnimplementedThumbnailServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedThumbnailServiceServer struct{}
func (UnimplementedThumbnailServiceServer) GetThumbnail(context.Context, *GetThumbnailRequest) (*GetThumbnailResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetThumbnail not implemented")
}
func (UnimplementedThumbnailServiceServer) mustEmbedUnimplementedThumbnailServiceServer() {}
func (UnimplementedThumbnailServiceServer) testEmbeddedByValue() {}
// UnsafeThumbnailServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ThumbnailServiceServer will
// result in compilation errors.
type UnsafeThumbnailServiceServer interface {
mustEmbedUnimplementedThumbnailServiceServer()
}
func RegisterThumbnailServiceServer(s grpc.ServiceRegistrar, srv ThumbnailServiceServer) {
// If the following call panics, it indicates UnimplementedThumbnailServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&ThumbnailService_ServiceDesc, srv)
}
func _ThumbnailService_GetThumbnail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetThumbnailRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ThumbnailServiceServer).GetThumbnail(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ThumbnailService_GetThumbnail_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ThumbnailServiceServer).GetThumbnail(ctx, req.(*GetThumbnailRequest))
}
return interceptor(ctx, in, info, handler)
}
// ThumbnailService_ServiceDesc is the grpc.ServiceDesc for ThumbnailService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ThumbnailService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "qsfera.services.thumbnails.v0.ThumbnailService",
HandlerType: (*ThumbnailServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetThumbnail",
Handler: _ThumbnailService_GetThumbnail_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "qsfera/services/thumbnails/v0/thumbnails.proto",
}
+38
View File
@@ -0,0 +1,38 @@
version: v1
plugins:
- name: go
path: ../../.bingo/protoc-gen-go
out: ../gen/
opt:
- paths=source_relative
- name: go-grpc
path: ../../.bingo/protoc-gen-go-grpc
out: ../gen/
opt:
- paths=source_relative
- name: micro
path: ../../.bingo/protoc-gen-micro
out: ../gen/
opt:
- paths=source_relative
- name: microweb
path: ../../.bingo/protoc-gen-microweb
out: ../gen/
opt:
- paths=source_relative
- "ignore_packages=\
qsfera.services.thumbnails.v0;\
qsfera.messages.thumbnails.v0;\
qsfera.services.store.v0;\
qsfera.messages.store.v0;\
qsfera.services.eventhistory.v0;\
qsfera.messages.eventhistory.v0;\
qsfera.services.policies.v0;\
qsfera.messages.policies.v0"
- name: openapiv2
path: ../../.bingo/protoc-gen-openapiv2
out: ../gen/
+11
View File
@@ -0,0 +1,11 @@
# Generated by buf. DO NOT EDIT.
version: v1
deps:
- remote: buf.build
owner: googleapis
repository: googleapis
commit: 62f35d8aed1149c291d606d958a7ce32
- remote: buf.build
owner: grpc-ecosystem
repository: grpc-gateway
commit: bc28b723cd774c32b6fbc77621518765
+10
View File
@@ -0,0 +1,10 @@
version: v1
lint:
use:
- DEFAULT
deps:
- buf.build/googleapis/googleapis
- buf.build/grpc-ecosystem/grpc-gateway
breaking:
use:
- FILE
@@ -0,0 +1,16 @@
syntax = "proto3";
package qsfera.messages.eventhistory.v0;
option go_package = "github.com/qsfera/server/protogen/gen/qsfera/messages/eventhistory/v0";
message Event {
// REQUIRED.
string type = 1;
// REQUIRED.
string id = 2;
// REQUIRED
bytes event = 3;
}
@@ -0,0 +1,49 @@
syntax = "proto3";
package qsfera.messages.policies.v0;
option go_package = "github.com/qsfera/server/protogen/gen/qsfera/messages/policies/v0";
message User {
message ID {
string opaque_id = 1;
}
ID id = 1;
string username = 2;
string mail = 3;
string display_name = 4;
repeated string groups = 5;
}
message Resource {
message ID {
string storage_id = 1;
string opaque_id = 2;
string space_id = 3;
}
ID id = 1;
string name = 2;
uint64 size = 3;
string url = 4;
}
message Request {
string method = 1;
string path = 2;
}
enum Stage {
STAGE_PP = 0;
STAGE_HTTP = 1;
}
message Environment {
Stage stage = 1;
User user = 2;
Request request = 3;
Resource resource = 4;
}
@@ -0,0 +1,90 @@
syntax = "proto3";
package qsfera.messages.search.v0;
import "google/protobuf/timestamp.proto";
option go_package = "github.com/qsfera/server/protogen/gen/qsfera/messages/search/v0";
message ResourceID {
string storage_id = 1;
string opaque_id = 2;
string space_id = 3;
}
message Reference {
ResourceID resource_id = 1;
string path = 2;
}
message Audio {
optional string album = 1;
optional string albumArtist = 2;
optional string artist = 3;
optional int64 bitrate = 4;
optional string composers = 5;
optional string copyright = 6;
optional int32 disc = 7;
optional int32 discCount = 8;
optional int64 duration = 9;
optional string genre = 10;
optional bool hasDrm = 11;
optional bool isVariableBitrate = 12;
optional string title = 13;
optional int32 track = 14;
optional int32 trackCount = 15;
optional int32 year = 16;
}
message Image {
optional int32 width = 1;
optional int32 height = 2;
}
message GeoCoordinates {
optional double altitude = 1;
optional double latitude = 2;
optional double longitude = 3;
}
message Photo {
optional string cameraMake = 1;
optional string cameraModel = 2;
optional float exposureDenominator = 3;
optional float exposureNumerator = 4;
optional float fNumber = 5;
optional float focalLength = 6;
optional int32 iso = 7;
optional int32 orientation = 8;
optional google.protobuf.Timestamp takenDateTime = 9;
}
message Entity {
Reference ref = 1;
ResourceID id = 2;
string name = 3;
string etag = 4;
uint64 size = 5;
google.protobuf.Timestamp last_modified_time = 6;
string mime_type = 7;
string permissions = 8;
uint64 type = 9;
bool deleted = 10;
string shareRootName = 11;
ResourceID parent_id = 12;
repeated string tags = 13;
string highlights = 14;
Audio audio = 15;
GeoCoordinates location = 16;
ResourceID remote_item_id = 17;
Image image = 18;
Photo photo = 19;
repeated string favorites = 20;
}
message Match {
// the matched entity
Entity entity = 1;
// the match score
float score = 2;
}
@@ -0,0 +1,221 @@
syntax = "proto3";
package qsfera.messages.settings.v0;
option go_package = "github.com/qsfera/server/protogen/gen/qsfera/messages/settings/v0";
// ---
// messages for settings values
// ---
message ValueWithIdentifier {
Identifier identifier = 1;
Value value = 2;
}
message Identifier {
string extension = 1;
string bundle = 2;
string setting = 3;
}
// ---
// messages for role assignment
// ---
message UserRoleAssignment {
// id is generated upon saving the assignment
string id = 1;
string account_uuid = 2;
// the role_id is a bundle_id internally
string role_id = 3;
}
message UserRoleAssignmentFilter {
enum Type {
TYPE_UNKNOWN = 0;
TYPE_ACCOUNT = 1;
TYPE_ROLE = 2;
}
Type type = 1;
oneof term {
string account_uuid = 2;
string role_id = 3;
}
}
// ---
// resource payloads
// ---
message Resource {
enum Type {
TYPE_UNKNOWN = 0;
TYPE_SYSTEM = 1;
TYPE_FILE = 2;
TYPE_SHARE = 3;
TYPE_SETTING = 4;
TYPE_BUNDLE = 5;
TYPE_USER = 6;
TYPE_GROUP = 7;
}
Type type = 1;
string id = 2;
}
// ---
// payloads for bundles
// ---
message Bundle {
enum Type {
TYPE_UNKNOWN = 0;
TYPE_DEFAULT = 1;
TYPE_ROLE = 2;
};
string id = 1; // @gotags: yaml:"id"
string name = 2; // @gotags: yaml:"name"
Type type = 3; // @gotags: yaml:"type"
string extension = 4; // @gotags: yaml:"extension"
string display_name = 5; // @gotags: yaml:"display_name"
repeated Setting settings = 6; // @gotags: yaml:"settings"
Resource resource = 7; // @gotags: yaml:"resource"
}
message Setting {
string id = 1; // @gotags: yaml:"id"
string name = 2; // @gotags: yaml:"name"
string display_name = 3; // @gotags: yaml:"display_name"
string description = 4; // @gotags: yaml:"description"
oneof value {
Int int_value = 5; // @gotags: yaml:"int_value"
String string_value = 6; // @gotags: yaml:"string_value"
Bool bool_value = 7; // @gotags: yaml:"bool_value"
SingleChoiceList single_choice_value = 8; // @gotags: yaml:"single_choice_value"
MultiChoiceList multi_choice_value = 9; // @gotags: yaml:"multi_choice_value"
Permission permission_value = 10; // @gotags: yaml:"permission_value"
MultiChoiceCollection multi_choice_collection_value = 12; // @gotags: yaml:"multi_choice_collection_value"
}
Resource resource = 11; // @gotags: yaml:"resource"
}
message Int {
int64 default = 1; // @gotags: yaml:"default"
int64 min = 2; // @gotags: yaml:"min"
int64 max = 3; // @gotags: yaml:"max"
int64 step = 4; // @gotags: yaml:"step"
string placeholder = 5; // @gotags: yaml:"placeholder"
}
message String {
string default = 1; // @gotags: yaml:"default"
bool required = 2; // @gotags: yaml:"required"
int32 min_length = 3; // @gotags: yaml:"min_length"
int32 max_length = 4; // @gotags: yaml:"max_length"
string placeholder = 5; // @gotags: yaml:"placeholder"
}
message Bool {
bool default = 1; // @gotags: yaml:"default"
string label = 2; // @gotags: yaml:"label"
}
message SingleChoiceList {
repeated ListOption options = 1; // @gotags: yaml:"options"
}
message MultiChoiceList {
repeated ListOption options = 1; // @gotags: yaml:"options"
}
message ListOption {
ListOptionValue value = 1; // @gotags: yaml:"value"
bool default = 2; // @gotags: yaml:"default"
string display_value = 3; // @gotags: yaml:"display_value"
}
message MultiChoiceCollection {
repeated MultiChoiceCollectionOption options = 1; // @gotags: yaml:"options"
}
message MultiChoiceCollectionOption {
MultiChoiceCollectionOptionValue value = 1; // @gotags: yaml:"value"
string key = 2; // @gotags: yaml:"key"
string attribute = 3; // @gotags: yaml:"attribute"
string display_value = 4; // @gotags: yaml:"display_value"
}
message MultiChoiceCollectionOptionValue {
oneof option {
Int int_value = 1; // @gotags: yaml:"int_value"
String string_value = 2; // @gotags: yaml:"string_value"
Bool bool_value = 3; // @gotags: yaml:"bool_value"
}
}
message Permission {
enum Operation {
OPERATION_UNKNOWN = 0;
OPERATION_CREATE = 1;
OPERATION_READ = 2;
OPERATION_UPDATE = 3;
OPERATION_DELETE = 4;
OPERATION_WRITE = 5;// WRITE is a combination of CREATE and UPDATE
OPERATION_READWRITE = 6;// READWRITE is a combination of READ and WRITE
}
Operation operation = 1; // @gotags: yaml:"operation"
enum Constraint {
CONSTRAINT_UNKNOWN = 0;
CONSTRAINT_OWN = 1;
CONSTRAINT_SHARED = 2;
CONSTRAINT_ALL = 3;
}
Constraint constraint = 2; // @gotags: yaml:"constraint"
}
// ---
// payloads for values
// ---
message Value {
// id is the id of the Value. It is generated on saving it.
string id = 1; // @gotags: yaml:"id"
string bundle_id = 2; // @gotags: yaml:"bundle_id"
// setting_id is the id of the setting from within its bundle.
string setting_id = 3; // @gotags: yaml:"setting_id"
string account_uuid = 4; // @gotags: yaml:"account_uuid"
Resource resource = 5; // @gotags: yaml:"resource"
oneof value {
bool bool_value = 6; // @gotags: yaml:"bool_value"
int64 int_value = 7; // @gotags: yaml:"int_value"
string string_value = 8; // @gotags: yaml:"string_value"
ListValue list_value = 9; // @gotags: yaml:"list_value"
CollectionValue collection_value = 10; // @gotags: yaml:"collection_value"
}
}
message ListValue {
repeated ListOptionValue values = 1; // @gotags: yaml:"values"
}
message ListOptionValue {
oneof option {
string string_value = 1; // @gotags: yaml:"string_value"
int64 int_value = 2; // @gotags: yaml:"int_value"
bool bool_value = 3; // @gotags: yaml:"bool_value"
}
}
message CollectionValue {
repeated CollectionOption values = 1; // @gotags: yaml:"values"
}
message CollectionOption {
// required
string key = 1; // @gotags: yaml:"key"
oneof option {
int64 int_value = 2; // @gotags: yaml:"int_value"
string string_value = 3; // @gotags: yaml:"string_value"
bool bool_value = 4; // @gotags: yaml:"bool_value"
}
}
@@ -0,0 +1,30 @@
syntax = "proto3";
package qsfera.messages.thumbnails.v0;
option go_package = "github.com/qsfera/server/protogen/gen/qsfera/messages/thumbnails/v0";
message WebdavSource {
// REQUIRED.
string url = 1;
// REQUIRED.
bool is_public_link = 2;
// OPTIONAL.
string webdav_authorization = 3;
// OPTIONAL.
string reva_authorization = 4;
// OPTIONAL.
string public_link_token = 5;
}
message CS3Source {
string path = 1;
string authorization = 2;
}
// The file types to which the thumbnail can be encoded to.
enum ThumbnailType {
PNG = 0; // Represents PNG type
JPG = 1; // Represents JPG type
GIF = 2; // Represents GIF type
}
@@ -0,0 +1,58 @@
syntax = "proto3";
package qsfera.services.eventhistory.v0;
option go_package = "github.com/qsfera/server/protogen/gen/qsfera/services/eventhistory/v0";
import "qsfera/messages/eventhistory/v0/eventhistory.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "КуСфера eventhistory";
version: "1.0.0";
contact: {
name: "КуСфера";
url: "";
email: "";
};
license: {
name: "Apache-2.0";
url: "";
};
};
schemes: HTTP;
schemes: HTTPS;
consumes: "application/json";
produces: "application/json";
external_docs: {
description: "Developer Manual";
url: "";
};
};
// A Service for storing events
service EventHistoryService {
// returns the specified events
rpc GetEvents(GetEventsRequest) returns (GetEventsResponse);
// returns all events for the specified userID
rpc GetEventsForUser(GetEventsForUserRequest) returns (GetEventsResponse);
}
// A request to retrieve events
message GetEventsRequest {
// the ids of the events we want to get
repeated string ids = 1;
}
// A request to retrieve events belonging to a userID
message GetEventsForUserRequest {
// the userID of the events we want to get
string userID = 1;
}
// The service response
message GetEventsResponse {
repeated qsfera.messages.eventhistory.v0.Event events = 1;
}
@@ -0,0 +1,51 @@
syntax = "proto3";
package qsfera.services.policies.v0;
option go_package = "github.com/qsfera/server/protogen/gen/qsfera/service/policies/v0";
import "qsfera/messages/policies/v0/policies.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "google/api/annotations.proto";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "КуСфера policies";
version: "1.0.0";
contact: {
name: "КуСфера";
url: "";
email: "";
};
license: {
name: "Apache-2.0";
url: "";
};
};
schemes: HTTP;
schemes: HTTPS;
consumes: "application/json";
produces: "application/json";
external_docs: {
description: "Developer Manual";
url: "";
};
};
service policiesProvider {
rpc Evaluate(EvaluateRequest) returns (EvaluateResponse) {
option (google.api.http) = {
post: "/api/v0/policies/evaluate",
body: "*"
};
};
}
message EvaluateRequest {
string query = 1;
qsfera.messages.policies.v0.Environment environment = 2;
}
message EvaluateResponse {
bool result = 1;
}
@@ -0,0 +1,111 @@
syntax = "proto3";
package qsfera.services.search.v0;
option go_package = "github.com/qsfera/server/protogen/gen/qsfera/service/search/v0";
import "qsfera/messages/search/v0/search.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "google/api/field_behavior.proto";
import "google/api/annotations.proto";
import "google/protobuf/field_mask.proto";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "КуСфера search";
version: "1.0.0";
contact: {
name: "КуСфера";
url: "";
email: "";
};
license: {
name: "Apache-2.0";
url: "";
};
};
schemes: HTTP;
schemes: HTTPS;
consumes: "application/json";
produces: "application/json";
external_docs: {
description: "Developer Manual";
url: "";
};
};
service SearchProvider {
rpc Search(SearchRequest) returns (SearchResponse) {
option (google.api.http) = {
post: "/api/v0/search/search",
body: "*"
};
};
rpc IndexSpace(IndexSpaceRequest) returns (IndexSpaceResponse) {
option (google.api.http) = {
post: "/api/v0/search/index-space",
body: "*"
};
}
}
service IndexProvider {
rpc Search(SearchIndexRequest) returns (SearchIndexResponse) {
option (google.api.http) = {
post: "/api/v0/search/index/search",
body: "*"
};
};
// rpc Remove(RemoveRequest) returns (RemoveResponse) {};
}
message SearchRequest {
// Optional. The maximum number of entries to return in the response
int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];
// Optional. A pagination token returned from a previous call to `Get`
// that indicates from where search should continue
string page_token = 2 [(google.api.field_behavior) = OPTIONAL];
string query = 3;
qsfera.messages.search.v0.Reference ref = 4 [(google.api.field_behavior) = OPTIONAL];
}
message SearchResponse {
repeated qsfera.messages.search.v0.Match matches = 1;
// Token to retrieve the next page of results, or empty if there are no
// more results in the list
string next_page_token = 2;
int32 total_matches = 3;
}
message SearchIndexRequest {
// Optional. The maximum number of entries to return in the response
int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];
// Optional. A pagination token returned from a previous call to `Get`
// that indicates from where search should continue
string page_token = 2 [(google.api.field_behavior) = OPTIONAL];
string query = 3;
qsfera.messages.search.v0.Reference ref = 4 [(google.api.field_behavior) = OPTIONAL];
}
message SearchIndexResponse {
repeated qsfera.messages.search.v0.Match matches = 1;
// Token to retrieve the next page of results, or empty if there are no
// more results in the list
string next_page_token = 2;
int32 total_matches = 3;
}
message IndexSpaceRequest {
string space_id = 1;
string user_id = 2;
bool force_reindex = 3;
}
message IndexSpaceResponse {
}
@@ -0,0 +1,282 @@
syntax = "proto3";
package qsfera.services.settings.v0;
option go_package = "github.com/qsfera/server/protogen/gen/qsfera/services/settings/v0";
import "qsfera/messages/settings/v0/settings.proto";
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "КуСфера settings";
version: "1.0.0";
contact: {
name: "КуСфера";
url: "";
email: "";
};
license: {
name: "Apache-2.0";
url: "";
};
};
schemes: HTTP;
schemes: HTTPS;
consumes: "application/json";
produces: "application/json";
external_docs: {
description: "Developer Manual";
url: "";
};
};
service BundleService {
rpc SaveBundle(SaveBundleRequest) returns (SaveBundleResponse) {
option (google.api.http) = {
post: "/api/v0/settings/bundle-save",
body: "*"
};
}
rpc GetBundle(GetBundleRequest) returns (GetBundleResponse) {
option (google.api.http) = {
post: "/api/v0/settings/bundle-get",
body: "*"
};
}
rpc ListBundles(ListBundlesRequest) returns (ListBundlesResponse) {
option (google.api.http) = {
post: "/api/v0/settings/bundles-list",
body: "*"
};
}
rpc AddSettingToBundle(AddSettingToBundleRequest) returns (AddSettingToBundleResponse) {
option (google.api.http) = {
post: "/api/v0/settings/bundles-add-setting",
body: "*"
};
}
rpc RemoveSettingFromBundle(RemoveSettingFromBundleRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/api/v0/settings/bundles-remove-setting",
body: "*"
};
}
}
service ValueService {
rpc SaveValue(SaveValueRequest) returns (SaveValueResponse) {
option (google.api.http) = {
post: "/api/v0/settings/values-save",
body: "*"
};
}
rpc GetValue(GetValueRequest) returns (GetValueResponse) {
option (google.api.http) = {
post: "/api/v0/settings/values-get",
body: "*"
};
}
rpc ListValues(ListValuesRequest) returns (ListValuesResponse) {
option (google.api.http) = {
post: "/api/v0/settings/values-list",
body: "*"
};
}
rpc GetValueByUniqueIdentifiers(GetValueByUniqueIdentifiersRequest) returns (GetValueResponse) {
option (google.api.http) = {
post: "/api/v0/settings/values-get-by-unique-identifiers",
body: "*"
};
}
}
service RoleService {
rpc ListRoles(ListBundlesRequest) returns (ListBundlesResponse) {
option (google.api.http) = {
post: "/api/v0/settings/roles-list",
body: "*"
};
}
rpc ListRoleAssignments(ListRoleAssignmentsRequest) returns (ListRoleAssignmentsResponse) {
option (google.api.http) = {
post: "/api/v0/settings/assignments-list",
body: "*"
};
}
rpc ListRoleAssignmentsFiltered(ListRoleAssignmentsFilteredRequest) returns (ListRoleAssignmentsResponse) {
option (google.api.http) = {
post: "/api/v0/settings/assignments-list-filtered",
body: "*"
};
}
rpc AssignRoleToUser(AssignRoleToUserRequest) returns (AssignRoleToUserResponse) {
option (google.api.http) = {
post: "/api/v0/settings/assignments-add",
body: "*"
};
}
rpc RemoveRoleFromUser(RemoveRoleFromUserRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/api/v0/settings/assignments-remove",
body: "*"
};
}
}
service PermissionService {
rpc ListPermissions(ListPermissionsRequest) returns (ListPermissionsResponse) {
option (google.api.http) = {
post: "/api/v0/settings/permissions-list",
body: "*"
};
}
rpc ListPermissionsByResource(ListPermissionsByResourceRequest) returns (ListPermissionsByResourceResponse) {
option (google.api.http) = {
post: "/api/v0/settings/permissions-list-by-resource",
body: "*"
};
}
rpc GetPermissionByID(GetPermissionByIDRequest) returns (GetPermissionByIDResponse) {
option (google.api.http) = {
post: "/api/v0/settings/permissions-get-by-id",
body: "*"
};
}
}
// ---
// requests and responses for settings bundles
// ---
message SaveBundleRequest {
qsfera.messages.settings.v0.Bundle bundle = 1;
}
message SaveBundleResponse {
qsfera.messages.settings.v0.Bundle bundle = 1;
}
message GetBundleRequest {
string bundle_id = 1;
}
message GetBundleResponse {
qsfera.messages.settings.v0.Bundle bundle = 1;
}
message ListBundlesRequest {
repeated string bundle_ids = 1;
string locale = 2;
}
message ListBundlesResponse {
repeated qsfera.messages.settings.v0.Bundle bundles = 1;
}
message AddSettingToBundleRequest {
string bundle_id = 1;
qsfera.messages.settings.v0.Setting setting = 2;
}
message AddSettingToBundleResponse {
qsfera.messages.settings.v0.Setting setting = 1;
}
message RemoveSettingFromBundleRequest {
string bundle_id = 1;
string setting_id = 2;
}
// ---
// requests and responses for settings values
// ---
message SaveValueRequest {
qsfera.messages.settings.v0.Value value = 1;
}
message SaveValueResponse {
qsfera.messages.settings.v0.ValueWithIdentifier value = 1;
}
message GetValueRequest {
string id = 1;
}
message GetValueResponse {
qsfera.messages.settings.v0.ValueWithIdentifier value = 1;
}
message ListValuesRequest {
string bundle_id = 1;
string account_uuid = 2;
}
message ListValuesResponse {
repeated qsfera.messages.settings.v0.ValueWithIdentifier values = 1;
}
message GetValueByUniqueIdentifiersRequest{
string account_uuid = 1;
string setting_id = 2;
}
// --
// requests and responses for role assignments
// ---
message ListRoleAssignmentsRequest {
string account_uuid = 1;
}
message ListRoleAssignmentsFilteredRequest {
repeated qsfera.messages.settings.v0.UserRoleAssignmentFilter filters = 1;
}
message ListRoleAssignmentsResponse {
repeated qsfera.messages.settings.v0.UserRoleAssignment assignments = 1;
}
message AssignRoleToUserRequest {
string account_uuid = 1;
// the role_id is a bundle_id internally
string role_id = 2;
}
message AssignRoleToUserResponse {
qsfera.messages.settings.v0.UserRoleAssignment assignment = 1;
}
message RemoveRoleFromUserRequest {
string id = 1;
}
// --
// requests and responses for permissions
// ---
message ListPermissionsRequest {
string account_uuid = 1;
}
message ListPermissionsResponse {
repeated string permissions = 1;
}
message ListPermissionsByResourceRequest {
qsfera.messages.settings.v0.Resource resource = 1;
}
message ListPermissionsByResourceResponse {
repeated qsfera.messages.settings.v0.Permission permissions = 1;
}
message GetPermissionByIDRequest {
string permission_id = 1;
}
message GetPermissionByIDResponse {
qsfera.messages.settings.v0.Permission permission = 1;
}
@@ -0,0 +1,66 @@
syntax = "proto3";
package qsfera.services.thumbnails.v0;
option go_package = "github.com/qsfera/server/protogen/gen/qsfera/services/thumbnails/v0";
import "qsfera/messages/thumbnails/v0/thumbnails.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "КуСфера thumbnails";
version: "1.0.0";
contact: {
name: "КуСфера";
url: "";
email: "";
};
license: {
name: "Apache-2.0";
url: "";
};
};
schemes: HTTP;
schemes: HTTPS;
consumes: "application/json";
produces: "application/json";
external_docs: {
description: "Developer Manual";
url: "";
};
};
// A Service for handling thumbnail generation
service ThumbnailService {
// Generates the thumbnail and returns it.
rpc GetThumbnail(GetThumbnailRequest) returns (GetThumbnailResponse);
}
// A request to retrieve a thumbnail
message GetThumbnailRequest {
// The path to the source image
string filepath = 1;
// The type to which the thumbnail should get encoded to.
qsfera.messages.thumbnails.v0.ThumbnailType thumbnail_type = 2;
// The width of the thumbnail
int32 width = 3;
// The height of the thumbnail
int32 height = 4;
// Indicates which image processor to use
string processor = 5;
oneof source {
qsfera.messages.thumbnails.v0.WebdavSource webdav_source = 6;
qsfera.messages.thumbnails.v0.CS3Source cs3_source = 7;
}
}
// The service response
message GetThumbnailResponse {
// The endpoint where the thumbnail can be downloaded.
string data_endpoint = 1;
// The transfer token to be able to download the thumbnail.
string transfer_token = 2;
// The mimetype of the thumbnail
string mimetype = 3;
}