divi 0.0.1.dev0__tar.gz → 0.0.1.dev8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. divi-0.0.1.dev8/.gitignore +16 -0
  2. divi-0.0.1.dev8/LICENSE +21 -0
  3. divi-0.0.1.dev8/Makefile +18 -0
  4. divi-0.0.1.dev8/PKG-INFO +15 -0
  5. divi-0.0.1.dev8/README.md +23 -0
  6. divi-0.0.1.dev8/apps/README.md +3 -0
  7. divi-0.0.1.dev8/core/README.md +3 -0
  8. divi-0.0.1.dev8/core/go.mod +15 -0
  9. divi-0.0.1.dev8/core/go.sum +32 -0
  10. divi-0.0.1.dev8/core/main.go +44 -0
  11. divi-0.0.1.dev8/core/proto/core.pb.go +83 -0
  12. divi-0.0.1.dev8/core/proto/core_grpc.pb.go +125 -0
  13. divi-0.0.1.dev8/core/proto/health_check_request.pb.go +147 -0
  14. divi-0.0.1.dev8/core/proto/health_check_response.pb.go +156 -0
  15. divi-0.0.1.dev8/divi/__init__.py +9 -0
  16. divi-0.0.1.dev8/divi/core/__init__.py +5 -0
  17. divi-0.0.1.dev8/divi/core/finish.py +15 -0
  18. divi-0.0.1.dev8/divi/core/init.py +80 -0
  19. divi-0.0.1.dev8/divi/core/run.py +35 -0
  20. divi-0.0.1.dev8/divi/proto/core/v1/core.proto +13 -0
  21. divi-0.0.1.dev8/divi/proto/core/v1/core_pb2.py +39 -0
  22. divi-0.0.1.dev8/divi/proto/core/v1/core_pb2.pyi +6 -0
  23. divi-0.0.1.dev8/divi/proto/core/v1/core_pb2_grpc.py +101 -0
  24. divi-0.0.1.dev8/divi/proto/core/v1/go/core.pb.go +83 -0
  25. divi-0.0.1.dev8/divi/proto/core/v1/go/core_grpc.pb.go +125 -0
  26. divi-0.0.1.dev8/divi/proto/core/v1/go/health_check_request.pb.go +147 -0
  27. divi-0.0.1.dev8/divi/proto/core/v1/go/health_check_response.pb.go +156 -0
  28. divi-0.0.1.dev8/divi/proto/core/v1/health_check_request.proto +7 -0
  29. divi-0.0.1.dev8/divi/proto/core/v1/health_check_request_pb2.py +37 -0
  30. divi-0.0.1.dev8/divi/proto/core/v1/health_check_request_pb2.pyi +11 -0
  31. divi-0.0.1.dev8/divi/proto/core/v1/health_check_request_pb2_grpc.py +24 -0
  32. divi-0.0.1.dev8/divi/proto/core/v1/health_check_response.proto +10 -0
  33. divi-0.0.1.dev8/divi/proto/core/v1/health_check_response_pb2.py +37 -0
  34. divi-0.0.1.dev8/divi/proto/core/v1/health_check_response_pb2.pyi +13 -0
  35. divi-0.0.1.dev8/divi/proto/core/v1/health_check_response_pb2_grpc.py +24 -0
  36. divi-0.0.1.dev8/divi/utils.py +14 -0
  37. divi-0.0.1.dev8/docs/README.md +3 -0
  38. divi-0.0.1.dev8/go.work +3 -0
  39. divi-0.0.1.dev8/go.work.sum +38 -0
  40. divi-0.0.1.dev8/hatch.toml +9 -0
  41. divi-0.0.1.dev8/hatch_build.py +47 -0
  42. divi-0.0.1.dev8/package_readme.md +5 -0
  43. divi-0.0.1.dev8/packages/README.md +3 -0
  44. {divi-0.0.1.dev0 → divi-0.0.1.dev8}/pyproject.toml +12 -2
  45. divi-0.0.1.dev8/scripts/README.md +3 -0
  46. divi-0.0.1.dev8/uv.lock +178 -0
  47. divi-0.0.1.dev0/.gitignore +0 -28
  48. divi-0.0.1.dev0/.python-version +0 -1
  49. divi-0.0.1.dev0/PKG-INFO +0 -19
  50. divi-0.0.1.dev0/README.md +0 -12
  51. divi-0.0.1.dev0/divi/__init__.py +0 -6
  52. divi-0.0.1.dev0/divi/hello.py +0 -6
  53. divi-0.0.1.dev0/hatch.toml +0 -2
@@ -0,0 +1,16 @@
1
+ .vscode/
2
+ .idea/
3
+
4
+ # Byte-compiled / optimized / DLL files
5
+ __pycache__/
6
+ *.py[cod]
7
+ *$py.class
8
+
9
+ # Distribution / packaging
10
+ dist/
11
+ build/
12
+ divi/bin/
13
+
14
+ # Environments
15
+ .venv/
16
+ .env
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Kaikai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,18 @@
1
+ all: build
2
+
3
+ protobuf:
4
+ protoc --go_out=. --go_opt=paths=source_relative \
5
+ --go-grpc_out=. --go-grpc_opt=paths=source_relative \
6
+ divi/proto/core/v1/health_check_response.proto
7
+
8
+ mv divi/proto/core/v1/*.go divi/proto/core/v1/go/
9
+ cp divi/proto/core/v1/go/* core/proto/
10
+
11
+ python3 -m grpc_tools.protoc -Idivi/proto=divi/proto \
12
+ --python_out=. \
13
+ --pyi_out=. \
14
+ --grpc_python_out=. \
15
+ divi/proto/core/v1/health_check_response.proto
16
+
17
+ build:
18
+ cd core && go build -o ../divi/bin/core main.go
@@ -0,0 +1,15 @@
1
+ Metadata-Version: 2.4
2
+ Name: divi
3
+ Version: 0.0.1.dev8
4
+ Summary: The Agent Platform for Observability & Evaluation
5
+ License-File: LICENSE
6
+ Requires-Python: >=3.11
7
+ Requires-Dist: grpcio>=1.69.0
8
+ Requires-Dist: protobuf>=5.29.3
9
+ Description-Content-Type: text/markdown
10
+
11
+ # Divine Agent
12
+
13
+ Agent Platform for Observability • Evaluation • Playground
14
+
15
+ > The project is still in the development stage. 😇
@@ -0,0 +1,23 @@
1
+ # divine-agent
2
+
3
+ Agent Platform for Observability • Evaluation • Playground
4
+
5
+ ## Structure
6
+
7
+ > Divine Agent is a monorepo project. The project is structured as follows:
8
+
9
+ ```plaintext
10
+ .
11
+ ├── apps
12
+ ├── core
13
+ ├── docs
14
+ ├── packages
15
+ ├── scripts
16
+ └── sdk
17
+ ```
18
+
19
+ ## Thanks
20
+
21
+ 1. [uv](https://github.com/astral-sh/uv): An extremely fast Python package and project manager, written in Rust.
22
+ 2. [hatch](https://github.com/pypa/hatch): Hatch is a modern, extensible Python project manager.
23
+ 3. [github cli](https://cli.github.com/manual): GitHub CLI, or gh, is a command-line interface to GitHub for use in your terminal or your scripts.
@@ -0,0 +1,3 @@
1
+ # Apps
2
+
3
+ > A series of web applications.
@@ -0,0 +1,3 @@
1
+ # Core
2
+
3
+ > A gRPC server written in Go.
@@ -0,0 +1,15 @@
1
+ module github.com/Kaikaikaifang/divine-agent/core
2
+
3
+ go 1.23.4
4
+
5
+ require (
6
+ google.golang.org/grpc v1.69.4
7
+ google.golang.org/protobuf v1.36.3
8
+ )
9
+
10
+ require (
11
+ golang.org/x/net v0.34.0 // indirect
12
+ golang.org/x/sys v0.29.0 // indirect
13
+ golang.org/x/text v0.21.0 // indirect
14
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
15
+ )
@@ -0,0 +1,32 @@
1
+ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
2
+ github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
3
+ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
4
+ github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
5
+ github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
6
+ github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
7
+ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
8
+ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
9
+ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
10
+ github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
11
+ go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY=
12
+ go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE=
13
+ go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE=
14
+ go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY=
15
+ go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk=
16
+ go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0=
17
+ go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc=
18
+ go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8=
19
+ go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys=
20
+ go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A=
21
+ golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
22
+ golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
23
+ golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
24
+ golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
25
+ golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
26
+ golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
27
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f h1:OxYkA3wjPsZyBylwymxSHa7ViiW1Sml4ToBrncvFehI=
28
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50=
29
+ google.golang.org/grpc v1.69.4 h1:MF5TftSMkd8GLw/m0KM6V8CMOCY6NZ1NQDPGFgbTt4A=
30
+ google.golang.org/grpc v1.69.4/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4=
31
+ google.golang.org/protobuf v1.36.3 h1:82DV7MYdb8anAVi3qge1wSnMDrnKK7ebr+I0hHRN1BU=
32
+ google.golang.org/protobuf v1.36.3/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
@@ -0,0 +1,44 @@
1
+ // Package main implements a server for gRPC service.
2
+ package main
3
+
4
+ import (
5
+ "context"
6
+ "flag"
7
+ "fmt"
8
+ "log"
9
+ "net"
10
+
11
+ pb "github.com/Kaikaikaifang/divine-agent/core/proto"
12
+ "google.golang.org/grpc"
13
+ )
14
+
15
+ var (
16
+ port = flag.Int("port", 50051, "The server port")
17
+ )
18
+
19
+ // server is used to implement health server.
20
+ type server struct {
21
+ pb.UnimplementedCoreServer
22
+ }
23
+
24
+ func (s *server) Check(ctx context.Context, in *pb.HealthCheckRequest) (*pb.HealthCheckResponse, error) {
25
+ log.Printf("SDK Version: %s", in.Version)
26
+ return &pb.HealthCheckResponse{
27
+ Status: true,
28
+ Message: "ok",
29
+ }, nil
30
+ }
31
+
32
+ func main() {
33
+ flag.Parse()
34
+ lis, err := net.Listen("tcp", fmt.Sprintf(":%d", *port))
35
+ if err != nil {
36
+ log.Fatalf("failed to listen: %v", err)
37
+ }
38
+ s := grpc.NewServer()
39
+ pb.RegisterCoreServer(s, &server{})
40
+ log.Printf("server listening at %v", lis.Addr())
41
+ if err := s.Serve(lis); err != nil {
42
+ log.Fatalf("failed to serve: %v", err)
43
+ }
44
+ }
@@ -0,0 +1,83 @@
1
+ // Code generated by protoc-gen-go. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-go v1.33.0
4
+ // protoc v4.23.4
5
+ // source: divi/proto/core/v1/core.proto
6
+
7
+ package proto
8
+
9
+ import (
10
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
11
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
12
+ reflect "reflect"
13
+ )
14
+
15
+ const (
16
+ // Verify that this generated code is sufficiently up-to-date.
17
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
18
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
19
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
20
+ )
21
+
22
+ var File_divi_proto_core_v1_core_proto protoreflect.FileDescriptor
23
+
24
+ var file_divi_proto_core_v1_core_proto_rawDesc = []byte{
25
+ 0x0a, 0x1d, 0x64, 0x69, 0x76, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x72,
26
+ 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
27
+ 0x07, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x2d, 0x64, 0x69, 0x76, 0x69, 0x2f, 0x70,
28
+ 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x68, 0x65, 0x61,
29
+ 0x6c, 0x74, 0x68, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73,
30
+ 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x64, 0x69, 0x76, 0x69, 0x2f, 0x70, 0x72,
31
+ 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x68, 0x65, 0x61, 0x6c,
32
+ 0x74, 0x68, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
33
+ 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x4c, 0x0a, 0x04, 0x43, 0x6f, 0x72, 0x65, 0x12,
34
+ 0x44, 0x0a, 0x05, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1b, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e,
35
+ 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65,
36
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e,
37
+ 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f,
38
+ 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
39
+ 0x63, 0x6f, 0x6d, 0x2f, 0x4b, 0x61, 0x69, 0x6b, 0x61, 0x69, 0x6b, 0x61, 0x69, 0x46, 0x61, 0x6e,
40
+ 0x67, 0x2f, 0x64, 0x69, 0x76, 0x69, 0x6e, 0x65, 0x2d, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x63,
41
+ 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
42
+ 0x33,
43
+ }
44
+
45
+ var file_divi_proto_core_v1_core_proto_goTypes = []interface{}{
46
+ (*HealthCheckRequest)(nil), // 0: core.v1.HealthCheckRequest
47
+ (*HealthCheckResponse)(nil), // 1: core.v1.HealthCheckResponse
48
+ }
49
+ var file_divi_proto_core_v1_core_proto_depIdxs = []int32{
50
+ 0, // 0: core.v1.Core.Check:input_type -> core.v1.HealthCheckRequest
51
+ 1, // 1: core.v1.Core.Check:output_type -> core.v1.HealthCheckResponse
52
+ 1, // [1:2] is the sub-list for method output_type
53
+ 0, // [0:1] is the sub-list for method input_type
54
+ 0, // [0:0] is the sub-list for extension type_name
55
+ 0, // [0:0] is the sub-list for extension extendee
56
+ 0, // [0:0] is the sub-list for field type_name
57
+ }
58
+
59
+ func init() { file_divi_proto_core_v1_core_proto_init() }
60
+ func file_divi_proto_core_v1_core_proto_init() {
61
+ if File_divi_proto_core_v1_core_proto != nil {
62
+ return
63
+ }
64
+ file_divi_proto_core_v1_health_check_request_proto_init()
65
+ file_divi_proto_core_v1_health_check_response_proto_init()
66
+ type x struct{}
67
+ out := protoimpl.TypeBuilder{
68
+ File: protoimpl.DescBuilder{
69
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
70
+ RawDescriptor: file_divi_proto_core_v1_core_proto_rawDesc,
71
+ NumEnums: 0,
72
+ NumMessages: 0,
73
+ NumExtensions: 0,
74
+ NumServices: 1,
75
+ },
76
+ GoTypes: file_divi_proto_core_v1_core_proto_goTypes,
77
+ DependencyIndexes: file_divi_proto_core_v1_core_proto_depIdxs,
78
+ }.Build()
79
+ File_divi_proto_core_v1_core_proto = out.File
80
+ file_divi_proto_core_v1_core_proto_rawDesc = nil
81
+ file_divi_proto_core_v1_core_proto_goTypes = nil
82
+ file_divi_proto_core_v1_core_proto_depIdxs = nil
83
+ }
@@ -0,0 +1,125 @@
1
+ // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2
+ // versions:
3
+ // - protoc-gen-go-grpc v1.5.1
4
+ // - protoc v4.23.4
5
+ // source: divi/proto/core/v1/core.proto
6
+
7
+ package proto
8
+
9
+ import (
10
+ context "context"
11
+ grpc "google.golang.org/grpc"
12
+ codes "google.golang.org/grpc/codes"
13
+ status "google.golang.org/grpc/status"
14
+ )
15
+
16
+ // This is a compile-time assertion to ensure that this generated file
17
+ // is compatible with the grpc package it is being compiled against.
18
+ // Requires gRPC-Go v1.64.0 or later.
19
+ const _ = grpc.SupportPackageIsVersion9
20
+
21
+ const (
22
+ Core_Check_FullMethodName = "/core.v1.Core/Check"
23
+ )
24
+
25
+ // CoreClient is the client API for Core service.
26
+ //
27
+ // 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.
28
+ //
29
+ // Health is a service that implements health check.
30
+ type CoreClient interface {
31
+ Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)
32
+ }
33
+
34
+ type coreClient struct {
35
+ cc grpc.ClientConnInterface
36
+ }
37
+
38
+ func NewCoreClient(cc grpc.ClientConnInterface) CoreClient {
39
+ return &coreClient{cc}
40
+ }
41
+
42
+ func (c *coreClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) {
43
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
44
+ out := new(HealthCheckResponse)
45
+ err := c.cc.Invoke(ctx, Core_Check_FullMethodName, in, out, cOpts...)
46
+ if err != nil {
47
+ return nil, err
48
+ }
49
+ return out, nil
50
+ }
51
+
52
+ // CoreServer is the server API for Core service.
53
+ // All implementations must embed UnimplementedCoreServer
54
+ // for forward compatibility.
55
+ //
56
+ // Health is a service that implements health check.
57
+ type CoreServer interface {
58
+ Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
59
+ mustEmbedUnimplementedCoreServer()
60
+ }
61
+
62
+ // UnimplementedCoreServer must be embedded to have
63
+ // forward compatible implementations.
64
+ //
65
+ // NOTE: this should be embedded by value instead of pointer to avoid a nil
66
+ // pointer dereference when methods are called.
67
+ type UnimplementedCoreServer struct{}
68
+
69
+ func (UnimplementedCoreServer) Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) {
70
+ return nil, status.Errorf(codes.Unimplemented, "method Check not implemented")
71
+ }
72
+ func (UnimplementedCoreServer) mustEmbedUnimplementedCoreServer() {}
73
+ func (UnimplementedCoreServer) testEmbeddedByValue() {}
74
+
75
+ // UnsafeCoreServer may be embedded to opt out of forward compatibility for this service.
76
+ // Use of this interface is not recommended, as added methods to CoreServer will
77
+ // result in compilation errors.
78
+ type UnsafeCoreServer interface {
79
+ mustEmbedUnimplementedCoreServer()
80
+ }
81
+
82
+ func RegisterCoreServer(s grpc.ServiceRegistrar, srv CoreServer) {
83
+ // If the following call pancis, it indicates UnimplementedCoreServer was
84
+ // embedded by pointer and is nil. This will cause panics if an
85
+ // unimplemented method is ever invoked, so we test this at initialization
86
+ // time to prevent it from happening at runtime later due to I/O.
87
+ if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
88
+ t.testEmbeddedByValue()
89
+ }
90
+ s.RegisterService(&Core_ServiceDesc, srv)
91
+ }
92
+
93
+ func _Core_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
94
+ in := new(HealthCheckRequest)
95
+ if err := dec(in); err != nil {
96
+ return nil, err
97
+ }
98
+ if interceptor == nil {
99
+ return srv.(CoreServer).Check(ctx, in)
100
+ }
101
+ info := &grpc.UnaryServerInfo{
102
+ Server: srv,
103
+ FullMethod: Core_Check_FullMethodName,
104
+ }
105
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
106
+ return srv.(CoreServer).Check(ctx, req.(*HealthCheckRequest))
107
+ }
108
+ return interceptor(ctx, in, info, handler)
109
+ }
110
+
111
+ // Core_ServiceDesc is the grpc.ServiceDesc for Core service.
112
+ // It's only intended for direct use with grpc.RegisterService,
113
+ // and not to be introspected or modified (even as a copy)
114
+ var Core_ServiceDesc = grpc.ServiceDesc{
115
+ ServiceName: "core.v1.Core",
116
+ HandlerType: (*CoreServer)(nil),
117
+ Methods: []grpc.MethodDesc{
118
+ {
119
+ MethodName: "Check",
120
+ Handler: _Core_Check_Handler,
121
+ },
122
+ },
123
+ Streams: []grpc.StreamDesc{},
124
+ Metadata: "divi/proto/core/v1/core.proto",
125
+ }
@@ -0,0 +1,147 @@
1
+ // Code generated by protoc-gen-go. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-go v1.33.0
4
+ // protoc v4.23.4
5
+ // source: divi/proto/core/v1/health_check_request.proto
6
+
7
+ package proto
8
+
9
+ import (
10
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
11
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
12
+ reflect "reflect"
13
+ sync "sync"
14
+ )
15
+
16
+ const (
17
+ // Verify that this generated code is sufficiently up-to-date.
18
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
19
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
20
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
21
+ )
22
+
23
+ type HealthCheckRequest struct {
24
+ state protoimpl.MessageState
25
+ sizeCache protoimpl.SizeCache
26
+ unknownFields protoimpl.UnknownFields
27
+
28
+ Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
29
+ }
30
+
31
+ func (x *HealthCheckRequest) Reset() {
32
+ *x = HealthCheckRequest{}
33
+ if protoimpl.UnsafeEnabled {
34
+ mi := &file_divi_proto_core_v1_health_check_request_proto_msgTypes[0]
35
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
36
+ ms.StoreMessageInfo(mi)
37
+ }
38
+ }
39
+
40
+ func (x *HealthCheckRequest) String() string {
41
+ return protoimpl.X.MessageStringOf(x)
42
+ }
43
+
44
+ func (*HealthCheckRequest) ProtoMessage() {}
45
+
46
+ func (x *HealthCheckRequest) ProtoReflect() protoreflect.Message {
47
+ mi := &file_divi_proto_core_v1_health_check_request_proto_msgTypes[0]
48
+ if protoimpl.UnsafeEnabled && x != nil {
49
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
50
+ if ms.LoadMessageInfo() == nil {
51
+ ms.StoreMessageInfo(mi)
52
+ }
53
+ return ms
54
+ }
55
+ return mi.MessageOf(x)
56
+ }
57
+
58
+ // Deprecated: Use HealthCheckRequest.ProtoReflect.Descriptor instead.
59
+ func (*HealthCheckRequest) Descriptor() ([]byte, []int) {
60
+ return file_divi_proto_core_v1_health_check_request_proto_rawDescGZIP(), []int{0}
61
+ }
62
+
63
+ func (x *HealthCheckRequest) GetVersion() string {
64
+ if x != nil {
65
+ return x.Version
66
+ }
67
+ return ""
68
+ }
69
+
70
+ var File_divi_proto_core_v1_health_check_request_proto protoreflect.FileDescriptor
71
+
72
+ var file_divi_proto_core_v1_health_check_request_proto_rawDesc = []byte{
73
+ 0x0a, 0x2d, 0x64, 0x69, 0x76, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x72,
74
+ 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x5f, 0x63, 0x68, 0x65, 0x63,
75
+ 0x6b, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
76
+ 0x07, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x22, 0x2e, 0x0a, 0x12, 0x48, 0x65, 0x61, 0x6c,
77
+ 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18,
78
+ 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
79
+ 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68,
80
+ 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4b, 0x61, 0x69, 0x6b, 0x61, 0x69, 0x6b, 0x61, 0x69,
81
+ 0x46, 0x61, 0x6e, 0x67, 0x2f, 0x64, 0x69, 0x76, 0x69, 0x6e, 0x65, 0x2d, 0x61, 0x67, 0x65, 0x6e,
82
+ 0x74, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72,
83
+ 0x6f, 0x74, 0x6f, 0x33,
84
+ }
85
+
86
+ var (
87
+ file_divi_proto_core_v1_health_check_request_proto_rawDescOnce sync.Once
88
+ file_divi_proto_core_v1_health_check_request_proto_rawDescData = file_divi_proto_core_v1_health_check_request_proto_rawDesc
89
+ )
90
+
91
+ func file_divi_proto_core_v1_health_check_request_proto_rawDescGZIP() []byte {
92
+ file_divi_proto_core_v1_health_check_request_proto_rawDescOnce.Do(func() {
93
+ file_divi_proto_core_v1_health_check_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_divi_proto_core_v1_health_check_request_proto_rawDescData)
94
+ })
95
+ return file_divi_proto_core_v1_health_check_request_proto_rawDescData
96
+ }
97
+
98
+ var file_divi_proto_core_v1_health_check_request_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
99
+ var file_divi_proto_core_v1_health_check_request_proto_goTypes = []interface{}{
100
+ (*HealthCheckRequest)(nil), // 0: core.v1.HealthCheckRequest
101
+ }
102
+ var file_divi_proto_core_v1_health_check_request_proto_depIdxs = []int32{
103
+ 0, // [0:0] is the sub-list for method output_type
104
+ 0, // [0:0] is the sub-list for method input_type
105
+ 0, // [0:0] is the sub-list for extension type_name
106
+ 0, // [0:0] is the sub-list for extension extendee
107
+ 0, // [0:0] is the sub-list for field type_name
108
+ }
109
+
110
+ func init() { file_divi_proto_core_v1_health_check_request_proto_init() }
111
+ func file_divi_proto_core_v1_health_check_request_proto_init() {
112
+ if File_divi_proto_core_v1_health_check_request_proto != nil {
113
+ return
114
+ }
115
+ if !protoimpl.UnsafeEnabled {
116
+ file_divi_proto_core_v1_health_check_request_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
117
+ switch v := v.(*HealthCheckRequest); i {
118
+ case 0:
119
+ return &v.state
120
+ case 1:
121
+ return &v.sizeCache
122
+ case 2:
123
+ return &v.unknownFields
124
+ default:
125
+ return nil
126
+ }
127
+ }
128
+ }
129
+ type x struct{}
130
+ out := protoimpl.TypeBuilder{
131
+ File: protoimpl.DescBuilder{
132
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
133
+ RawDescriptor: file_divi_proto_core_v1_health_check_request_proto_rawDesc,
134
+ NumEnums: 0,
135
+ NumMessages: 1,
136
+ NumExtensions: 0,
137
+ NumServices: 0,
138
+ },
139
+ GoTypes: file_divi_proto_core_v1_health_check_request_proto_goTypes,
140
+ DependencyIndexes: file_divi_proto_core_v1_health_check_request_proto_depIdxs,
141
+ MessageInfos: file_divi_proto_core_v1_health_check_request_proto_msgTypes,
142
+ }.Build()
143
+ File_divi_proto_core_v1_health_check_request_proto = out.File
144
+ file_divi_proto_core_v1_health_check_request_proto_rawDesc = nil
145
+ file_divi_proto_core_v1_health_check_request_proto_goTypes = nil
146
+ file_divi_proto_core_v1_health_check_request_proto_depIdxs = nil
147
+ }