Skip to content

allow grpc server code generation stubs #61

Closed
@aria3ppp

Description

@aria3ppp

i need to run integration tests on qdrant server but i do not want to go down with testcontainers heavy stuffs
so i just create mock servers and let clients request go through network but hit an especially forged mock server on the other side
for http server it is simple
for grpc i need server stubs too
but the qdrant go client have striped the server parts
so i propose to let the server stubs into the package to be able test the client in isolation to qdrant server

Current Behavior and Steps to Reproduce

at this time i created a script to locate proto files in qdrant go client module on go module cache and then generate the go code from those files
but i need to remove the client stubs bc they cannot co-exists in the same package bc of protobuf namespaces

panic: proto: file "collections.proto" is already registered
                previously from: "github.com/aria3ppp/rag-server/gen/go/qdrantpb"
                currently from:  "github.com/qdrant/go-client/qdrant"
        See https://protobuf.dev/reference/go/faq#namespace-conflict

so i have to remove the client parts and also link the proto messges to qdrant client

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             (unknown)
// source: collections_service.proto

package qdrantpb

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	. "github.com/qdrant/go-client/qdrant"
)

// 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

// CollectionsServer is the server API for Collections service.
// All implementations must embed UnimplementedCollectionsServer
// for forward compatibility.
type CollectionsServer interface {
	// Get detailed information about specified existing collection
	Get(context.Context, *GetCollectionInfoRequest) (*GetCollectionInfoResponse, error)
	// Get list name of all existing collections
	List(context.Context, *ListCollectionsRequest) (*ListCollectionsResponse, error)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions