Skip to content

Commit

Permalink
Merge branch 'main' into feature/egress-gateway/add-egress-query
Browse files Browse the repository at this point in the history
  • Loading branch information
hlts2 committed Nov 28, 2023
2 parents aa3f6c4 + 623c302 commit 7c6c179
Show file tree
Hide file tree
Showing 19 changed files with 2,017 additions and 1,318 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ linters:
- errorlint
- execinquery
- exhaustive
- exhaustruct
- exportloopref
- forcetypeassert
- ginkgolinter
Expand Down Expand Up @@ -92,6 +91,7 @@ linters:
# Disabled by your configuration linters
# - cyclop
# - errcheck
# - exhaustruct
# - forbidigo
# - funlen
# - gci
Expand Down
935 changes: 481 additions & 454 deletions apis/docs/v1/docs.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions apis/grpc/v1/agent/core/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ const (
SaveIndexRPCName = "SaveIndex"
CreateAndSaveIndexRPCName = "CreateAndSaveIndex"
IndexInfoRPCName = "IndexInfo"
GetTimestampRPCName = "GetTimestamp"
)
41 changes: 26 additions & 15 deletions apis/grpc/v1/agent/core/agent.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions apis/grpc/v1/agent/core/agent_vtproto.pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ type AgentClient interface {
CreateAndSaveIndex(ctx context.Context, in *payload.Control_CreateIndexRequest, opts ...grpc.CallOption) (*payload.Empty, error)
// Represent the RPC to get the agent index information.
IndexInfo(ctx context.Context, in *payload.Empty, opts ...grpc.CallOption) (*payload.Info_Index_Count, error)
// Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process
GetTimestamp(ctx context.Context, in *payload.Object_GetTimestampRequest, opts ...grpc.CallOption) (*payload.Object_Timestamp, error)
}

type agentClient struct {
Expand Down Expand Up @@ -96,6 +98,15 @@ func (c *agentClient) IndexInfo(ctx context.Context, in *payload.Empty, opts ...
return out, nil
}

func (c *agentClient) GetTimestamp(ctx context.Context, in *payload.Object_GetTimestampRequest, opts ...grpc.CallOption) (*payload.Object_Timestamp, error) {
out := new(payload.Object_Timestamp)
err := c.cc.Invoke(ctx, "/core.v1.Agent/GetTimestamp", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}

// AgentServer is the server API for Agent service.
// All implementations must embed UnimplementedAgentServer
// for forward compatibility
Expand All @@ -108,6 +119,8 @@ type AgentServer interface {
CreateAndSaveIndex(context.Context, *payload.Control_CreateIndexRequest) (*payload.Empty, error)
// Represent the RPC to get the agent index information.
IndexInfo(context.Context, *payload.Empty) (*payload.Info_Index_Count, error)
// Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process
GetTimestamp(context.Context, *payload.Object_GetTimestampRequest) (*payload.Object_Timestamp, error)
mustEmbedUnimplementedAgentServer()
}

Expand All @@ -127,6 +140,9 @@ func (UnimplementedAgentServer) CreateAndSaveIndex(context.Context, *payload.Con
func (UnimplementedAgentServer) IndexInfo(context.Context, *payload.Empty) (*payload.Info_Index_Count, error) {
return nil, status.Errorf(codes.Unimplemented, "method IndexInfo not implemented")
}
func (UnimplementedAgentServer) GetTimestamp(context.Context, *payload.Object_GetTimestampRequest) (*payload.Object_Timestamp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetTimestamp not implemented")
}
func (UnimplementedAgentServer) mustEmbedUnimplementedAgentServer() {}

// UnsafeAgentServer may be embedded to opt out of forward compatibility for this service.
Expand Down Expand Up @@ -212,6 +228,24 @@ func _Agent_IndexInfo_Handler(srv interface{}, ctx context.Context, dec func(int
return interceptor(ctx, in, info, handler)
}

func _Agent_GetTimestamp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(payload.Object_GetTimestampRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgentServer).GetTimestamp(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/core.v1.Agent/GetTimestamp",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgentServer).GetTimestamp(ctx, req.(*payload.Object_GetTimestampRequest))
}
return interceptor(ctx, in, info, handler)
}

// Agent_ServiceDesc is the grpc.ServiceDesc for Agent service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
Expand All @@ -235,6 +269,10 @@ var Agent_ServiceDesc = grpc.ServiceDesc{
MethodName: "IndexInfo",
Handler: _Agent_IndexInfo_Handler,
},
{
MethodName: "GetTimestamp",
Handler: _Agent_GetTimestamp_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "apis/proto/v1/agent/core/agent.proto",
Expand Down
Loading

0 comments on commit 7c6c179

Please sign in to comment.