Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User facing type is unexported #28

Open
akfaew opened this issue Jun 7, 2023 · 2 comments
Open

User facing type is unexported #28

akfaew opened this issue Jun 7, 2023 · 2 comments

Comments

@akfaew
Copy link

akfaew commented Jun 7, 2023

I'm going through the sample code, and noticed that one type is unexported.

The sample code is:

140                         Id: &pb.PointId{                                                                                                                                                                                                                                                                                   
141                                 PointIdOptions: &pb.PointId_Num{Num: 2},                                                                                                                                                                                                                                                   
142                         },

I understand that I can use either an int or a uuid. I wanted to learn how to use a uuid:

$ go doc github.com/qdrant/go-client/qdrant.PointId
package go_client // import "github.com/qdrant/go-client/qdrant"

type PointId struct {

        // Types that are assignable to PointIdOptions:
        //      *PointId_Num
        //      *PointId_Uuid
        PointIdOptions isPointId_PointIdOptions `protobuf_oneof:"point_id_options"`
        // Has unexported fields.
}

func (*PointId) Descriptor() ([]byte, []int)
func (x *PointId) GetNum() uint64
func (m *PointId) GetPointIdOptions() isPointId_PointIdOptions
func (x *PointId) GetUuid() string
func (*PointId) ProtoMessage()
func (x *PointId) ProtoReflect() protoreflect.Message
func (x *PointId) Reset()
func (x *PointId) String() string

But we see that isPointId_PointIdOptions is unexported

@akfaew
Copy link
Author

akfaew commented Jun 7, 2023

It's similar with other types. I'm trying to learn how to delete a point:

$ grep -rw '^func.*Upsert'
points_service_grpc.pb.go:func (c *pointsClient) Upsert(ctx context.Context, in *UpsertPoints, opts ...grpc.CallOption) (*PointsOperationResponse, error) {
points_service_grpc.pb.go:func (UnimplementedPointsServer) Upsert(context.Context, *UpsertPoints) (*PointsOperationResponse, error) {


$ go doc Upsert
package go_client // import "."

func (UnimplementedPointsServer) Upsert(context.Context, *UpsertPoints) (*PointsOperationResponse, error)


$ go doc UnimplementedPointsServer
package go_client // import "."

type UnimplementedPointsServer struct {
}
    UnimplementedPointsServer must be embedded to have forward compatible
    implementations.

func (UnimplementedPointsServer) ClearPayload(context.Context, *ClearPayloadPoints) (*PointsOperationResponse, error)
func (UnimplementedPointsServer) Count(context.Context, *CountPoints) (*CountResponse, error)
func (UnimplementedPointsServer) CreateFieldIndex(context.Context, *CreateFieldIndexCollection) (*PointsOperationResponse, error)
func (UnimplementedPointsServer) Delete(context.Context, *DeletePoints) (*PointsOperationResponse, error)
func (UnimplementedPointsServer) DeleteFieldIndex(context.Context, *DeleteFieldIndexCollection) (*PointsOperationResponse, error)
func (UnimplementedPointsServer) DeletePayload(context.Context, *DeletePayloadPoints) (*PointsOperationResponse, error)
func (UnimplementedPointsServer) DeleteVectors(context.Context, *DeletePointVectors) (*PointsOperationResponse, error)
func (UnimplementedPointsServer) Get(context.Context, *GetPoints) (*GetResponse, error)
func (UnimplementedPointsServer) OverwritePayload(context.Context, *SetPayloadPoints) (*PointsOperationResponse, error)
func (UnimplementedPointsServer) Recommend(context.Context, *RecommendPoints) (*RecommendResponse, error)
func (UnimplementedPointsServer) RecommendBatch(context.Context, *RecommendBatchPoints) (*RecommendBatchResponse, error)
func (UnimplementedPointsServer) RecommendGroups(context.Context, *RecommendPointGroups) (*RecommendGroupsResponse, error)
func (UnimplementedPointsServer) Scroll(context.Context, *ScrollPoints) (*ScrollResponse, error)
func (UnimplementedPointsServer) Search(context.Context, *SearchPoints) (*SearchResponse, error)
func (UnimplementedPointsServer) SearchBatch(context.Context, *SearchBatchPoints) (*SearchBatchResponse, error)
func (UnimplementedPointsServer) SearchGroups(context.Context, *SearchPointGroups) (*SearchGroupsResponse, error)
func (UnimplementedPointsServer) SetPayload(context.Context, *SetPayloadPoints) (*PointsOperationResponse, error)
func (UnimplementedPointsServer) UpdateVectors(context.Context, *UpdatePointVectors) (*PointsOperationResponse, error)
func (UnimplementedPointsServer) Upsert(context.Context, *UpsertPoints) (*PointsOperationResponse, error)


$ go doc DeletePoints
package go_client // import "."

type DeletePoints struct {
        CollectionName string          `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` // name of the collection
        Wait           *bool           `protobuf:"varint,2,opt,name=wait,proto3,oneof" json:"wait,omitempty"`                                    // Wait until the changes have been applied?
        Points         *PointsSelector `protobuf:"bytes,3,opt,name=points,proto3" json:"points,omitempty"`                                       // Affected points
        Ordering       *WriteOrdering  `protobuf:"bytes,4,opt,name=ordering,proto3,oneof" json:"ordering,omitempty"` // Write ordering guarantees
        // Has unexported fields.
}

func (*DeletePoints) Descriptor() ([]byte, []int)
func (x *DeletePoints) GetCollectionName() string
func (x *DeletePoints) GetOrdering() *WriteOrdering
func (x *DeletePoints) GetPoints() *PointsSelector
func (x *DeletePoints) GetWait() bool
func (*DeletePoints) ProtoMessage()
func (x *DeletePoints) ProtoReflect() protoreflect.Message
func (x *DeletePoints) Reset()
func (x *DeletePoints) String() string


$ go doc PointsSelector
package go_client // import "."

type PointsSelector struct {

        // Types that are assignable to PointsSelectorOneOf:
        //      *PointsSelector_Points
        //      *PointsSelector_Filter
        PointsSelectorOneOf isPointsSelector_PointsSelectorOneOf `protobuf_oneof:"points_selector_one_of"`
        // Has unexported fields.
}

func (*PointsSelector) Descriptor() ([]byte, []int)
func (x *PointsSelector) GetFilter() *Filter
func (x *PointsSelector) GetPoints() *PointsIdsList
func (m *PointsSelector) GetPointsSelectorOneOf() isPointsSelector_PointsSelectorOneOf
func (*PointsSelector) ProtoMessage()
func (x *PointsSelector) ProtoReflect() protoreflect.Message
func (x *PointsSelector) Reset()
func (x *PointsSelector) String() string

And as you can see I'm running into a dead end

@generall
Copy link
Member

generall commented Jun 8, 2023

Hi @akfaew, I have extended the example with usage of UUID: b637292

I hope it helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants