@gnolang/gnonative 0.1.2

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 (123) hide show
  1. package/.eslintrc.js +5 -0
  2. package/.prettierrc.js +12 -0
  3. package/Makefile +62 -0
  4. package/README.md +118 -0
  5. package/android/build.gradle +93 -0
  6. package/android/libs/gnocore-sources.jar +0 -0
  7. package/android/libs/gnocore.aar +0 -0
  8. package/android/src/main/AndroidManifest.xml +2 -0
  9. package/android/src/main/java/land/gno/gnonative/GnonativeModule.kt +150 -0
  10. package/android/src/main/java/land/gno/gnonative/GnonativeView.kt +7 -0
  11. package/android/src/main/java/land/gno/gnonative/GoBridgeError.kt +6 -0
  12. package/android/src/main/java/land/gno/gnonative/JavaPromiseBlock.kt +42 -0
  13. package/build/Gnonative.types.d.ts +7 -0
  14. package/build/Gnonative.types.d.ts.map +1 -0
  15. package/build/Gnonative.types.js +2 -0
  16. package/build/Gnonative.types.js.map +1 -0
  17. package/build/GnonativeModule.d.ts +3 -0
  18. package/build/GnonativeModule.d.ts.map +1 -0
  19. package/build/GnonativeModule.js +5 -0
  20. package/build/GnonativeModule.js.map +1 -0
  21. package/build/GnonativeModule.web.d.ts +7 -0
  22. package/build/GnonativeModule.web.d.ts.map +1 -0
  23. package/build/GnonativeModule.web.js +12 -0
  24. package/build/GnonativeModule.web.js.map +1 -0
  25. package/build/GnonativeView.d.ts +4 -0
  26. package/build/GnonativeView.d.ts.map +1 -0
  27. package/build/GnonativeView.js +7 -0
  28. package/build/GnonativeView.js.map +1 -0
  29. package/build/GnonativeView.web.d.ts +4 -0
  30. package/build/GnonativeView.web.d.ts.map +1 -0
  31. package/build/GnonativeView.web.js +7 -0
  32. package/build/GnonativeView.web.js.map +1 -0
  33. package/build/GoBridge.d.ts +12 -0
  34. package/build/GoBridge.d.ts.map +1 -0
  35. package/build/GoBridge.js +27 -0
  36. package/build/GoBridge.js.map +1 -0
  37. package/build/grpc/client.d.ts +4 -0
  38. package/build/grpc/client.d.ts.map +1 -0
  39. package/build/grpc/client.js +12 -0
  40. package/build/grpc/client.js.map +1 -0
  41. package/build/grpc/error.d.ts +15 -0
  42. package/build/grpc/error.d.ts.map +1 -0
  43. package/build/grpc/error.js +70 -0
  44. package/build/grpc/error.js.map +1 -0
  45. package/build/grpc/transport_native.d.ts +4 -0
  46. package/build/grpc/transport_native.d.ts.map +1 -0
  47. package/build/grpc/transport_native.js +140 -0
  48. package/build/grpc/transport_native.js.map +1 -0
  49. package/build/hooks/types.d.ts +17 -0
  50. package/build/hooks/types.d.ts.map +1 -0
  51. package/build/hooks/types.js +2 -0
  52. package/build/hooks/types.js.map +1 -0
  53. package/build/hooks/use-gno.d.ts +35 -0
  54. package/build/hooks/use-gno.d.ts.map +1 -0
  55. package/build/hooks/use-gno.js +248 -0
  56. package/build/hooks/use-gno.js.map +1 -0
  57. package/build/index.d.ts +9 -0
  58. package/build/index.d.ts.map +1 -0
  59. package/build/index.js +13 -0
  60. package/build/index.js.map +1 -0
  61. package/expo-module.config.json +9 -0
  62. package/ios/Frameworks/GnoCore.xcframework/Info.plist +44 -0
  63. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/GnoCore +0 -0
  64. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Headers/GnoCore.h +13 -0
  65. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Headers/GnoGnonative.objc.h +93 -0
  66. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Headers/Universe.objc.h +29 -0
  67. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Headers/ref.h +35 -0
  68. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Modules/module.modulemap +8 -0
  69. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Resources/Info.plist +6 -0
  70. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Versions/A/GnoCore +0 -0
  71. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Versions/A/Headers/GnoCore.h +13 -0
  72. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Versions/A/Headers/GnoGnonative.objc.h +93 -0
  73. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Versions/A/Headers/Universe.objc.h +29 -0
  74. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Versions/A/Headers/ref.h +35 -0
  75. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Versions/A/Modules/module.modulemap +8 -0
  76. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Versions/A/Resources/Info.plist +6 -0
  77. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Versions/Current/GnoCore +0 -0
  78. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Versions/Current/Headers/GnoCore.h +13 -0
  79. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Versions/Current/Headers/GnoGnonative.objc.h +93 -0
  80. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Versions/Current/Headers/Universe.objc.h +29 -0
  81. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Versions/Current/Headers/ref.h +35 -0
  82. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Versions/Current/Modules/module.modulemap +8 -0
  83. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Versions/Current/Resources/Info.plist +6 -0
  84. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/GnoCore +0 -0
  85. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/Headers/GnoCore.h +13 -0
  86. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/Headers/GnoGnonative.objc.h +93 -0
  87. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/Headers/Universe.objc.h +29 -0
  88. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/Headers/ref.h +35 -0
  89. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/Modules/module.modulemap +8 -0
  90. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/Resources/Info.plist +6 -0
  91. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/Versions/A/GnoCore +0 -0
  92. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/Versions/A/Headers/GnoCore.h +13 -0
  93. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/Versions/A/Headers/GnoGnonative.objc.h +93 -0
  94. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/Versions/A/Headers/Universe.objc.h +29 -0
  95. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/Versions/A/Headers/ref.h +35 -0
  96. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/Versions/A/Modules/module.modulemap +8 -0
  97. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/Versions/A/Resources/Info.plist +6 -0
  98. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/Versions/Current/GnoCore +0 -0
  99. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/Versions/Current/Headers/GnoCore.h +13 -0
  100. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/Versions/Current/Headers/GnoGnonative.objc.h +93 -0
  101. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/Versions/Current/Headers/Universe.objc.h +29 -0
  102. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/Versions/Current/Headers/ref.h +35 -0
  103. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/Versions/Current/Modules/module.modulemap +8 -0
  104. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/Versions/Current/Resources/Info.plist +6 -0
  105. package/ios/GnoError.swift +31 -0
  106. package/ios/Gnonative.podspec +28 -0
  107. package/ios/GnonativeModule.swift +186 -0
  108. package/ios/GnonativeView.swift +7 -0
  109. package/ios/PromiseBlock.swift +45 -0
  110. package/package.json +50 -0
  111. package/src/Gnonative.types.ts +7 -0
  112. package/src/GnonativeModule.ts +5 -0
  113. package/src/GnonativeModule.web.ts +13 -0
  114. package/src/GnonativeView.tsx +11 -0
  115. package/src/GnonativeView.web.tsx +11 -0
  116. package/src/GoBridge.ts +44 -0
  117. package/src/grpc/client.ts +14 -0
  118. package/src/grpc/error.ts +89 -0
  119. package/src/grpc/transport_native.ts +197 -0
  120. package/src/hooks/types.ts +19 -0
  121. package/src/hooks/use-gno.ts +423 -0
  122. package/src/index.ts +20 -0
  123. package/tsconfig.json +9 -0
@@ -0,0 +1,29 @@
1
+ // Objective-C API for talking to Go package.
2
+ // gobind -lang=objc -prefix="Gno"
3
+ //
4
+ // File is generated by gobind. Do not edit.
5
+
6
+ #ifndef __Universe_H__
7
+ #define __Universe_H__
8
+
9
+ @import Foundation;
10
+ #include "ref.h"
11
+
12
+ @protocol Universeerror;
13
+ @class Universeerror;
14
+
15
+ @protocol Universeerror <NSObject>
16
+ - (NSString* _Nonnull)error;
17
+ @end
18
+
19
+ @class Universeerror;
20
+
21
+ @interface Universeerror : NSError <goSeqRefInterface, Universeerror> {
22
+ }
23
+ @property(strong, readonly) _Nonnull id _ref;
24
+
25
+ - (nonnull instancetype)initWithRef:(_Nonnull id)ref;
26
+ - (NSString* _Nonnull)error;
27
+ @end
28
+
29
+ #endif
@@ -0,0 +1,35 @@
1
+ // Copyright 2015 The Go Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style
3
+ // license that can be found in the LICENSE file.
4
+
5
+ #ifndef __GO_REF_HDR__
6
+ #define __GO_REF_HDR__
7
+
8
+ #include <Foundation/Foundation.h>
9
+
10
+ // GoSeqRef is an object tagged with an integer for passing back and
11
+ // forth across the language boundary. A GoSeqRef may represent either
12
+ // an instance of a Go object, or an Objective-C object passed to Go.
13
+ // The explicit allocation of a GoSeqRef is used to pin a Go object
14
+ // when it is passed to Objective-C. The Go seq package maintains a
15
+ // reference to the Go object in a map keyed by the refnum along with
16
+ // a reference count. When the reference count reaches zero, the Go
17
+ // seq package will clear the corresponding entry in the map.
18
+ @interface GoSeqRef : NSObject {
19
+ }
20
+ @property(readonly) int32_t refnum;
21
+ @property(strong) id obj; // NULL when representing a Go object.
22
+
23
+ // new GoSeqRef object to proxy a Go object. The refnum must be
24
+ // provided from Go side.
25
+ - (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj;
26
+
27
+ - (int32_t)incNum;
28
+
29
+ @end
30
+
31
+ @protocol goSeqRefInterface
32
+ -(GoSeqRef*) _ref;
33
+ @end
34
+
35
+ #endif
@@ -0,0 +1,8 @@
1
+ framework module "GnoCore" {
2
+ header "ref.h"
3
+ header "GnoGnonative.objc.h"
4
+ header "Universe.objc.h"
5
+ header "GnoCore.h"
6
+
7
+ export *
8
+ }
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ </dict>
6
+ </plist>
@@ -0,0 +1,13 @@
1
+
2
+ // Objective-C API for talking to the following Go packages
3
+ //
4
+ // github.com/gnolang/gnonative/framework/service
5
+ //
6
+ // File is generated by gomobile bind. Do not edit.
7
+ #ifndef __GnoCore_FRAMEWORK_H__
8
+ #define __GnoCore_FRAMEWORK_H__
9
+
10
+ #include "GnoGnonative.objc.h"
11
+ #include "Universe.objc.h"
12
+
13
+ #endif
@@ -0,0 +1,93 @@
1
+ // Objective-C API for talking to github.com/gnolang/gnonative/framework/service Go package.
2
+ // gobind -lang=objc -prefix="Gno" github.com/gnolang/gnonative/framework/service
3
+ //
4
+ // File is generated by gobind. Do not edit.
5
+
6
+ #ifndef __GnoGnonative_H__
7
+ #define __GnoGnonative_H__
8
+
9
+ @import Foundation;
10
+ #include "ref.h"
11
+ #include "Universe.objc.h"
12
+
13
+
14
+ @class GnoGnonativeBridge;
15
+ @class GnoGnonativeBridgeConfig;
16
+ @protocol GnoGnonativePromiseBlock;
17
+ @class GnoGnonativePromiseBlock;
18
+ @protocol GnoGnonativeServiceClient;
19
+ @class GnoGnonativeServiceClient;
20
+
21
+ @protocol GnoGnonativePromiseBlock <NSObject>
22
+ - (void)callReject:(NSError* _Nullable)error;
23
+ - (void)callResolve:(NSString* _Nullable)reply;
24
+ @end
25
+
26
+ @protocol GnoGnonativeServiceClient <NSObject>
27
+ - (void)closeStreamClientWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise id_:(NSString* _Nullable)id_;
28
+ - (void)createStreamClientWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise method:(NSString* _Nullable)method jsonMessage:(NSString* _Nullable)jsonMessage;
29
+ - (void)invokeGrpcMethodWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise method:(NSString* _Nullable)method jsonMessage:(NSString* _Nullable)jsonMessage;
30
+ - (void)streamClientReceiveWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise id_:(NSString* _Nullable)id_;
31
+ @end
32
+
33
+ @interface GnoGnonativeBridge : NSObject <goSeqRefInterface, GnoGnonativeServiceClient> {
34
+ }
35
+ @property(strong, readonly) _Nonnull id _ref;
36
+
37
+ - (nonnull instancetype)initWithRef:(_Nonnull id)ref;
38
+ - (nullable instancetype)init:(GnoGnonativeBridgeConfig* _Nullable)config;
39
+ @property (nonatomic) id<GnoGnonativeServiceClient> _Nullable serviceClient;
40
+ - (BOOL)close:(NSError* _Nullable* _Nullable)error;
41
+ - (void)closeStreamClientWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise id_:(NSString* _Nullable)id_;
42
+ - (void)createStreamClientWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise method:(NSString* _Nullable)method jsonMessage:(NSString* _Nullable)jsonMessage;
43
+ - (NSString* _Nonnull)getTcpAddr;
44
+ - (long)getTcpPort;
45
+ - (NSString* _Nonnull)getUDSPath;
46
+ - (void)invokeGrpcMethodWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise method:(NSString* _Nullable)method jsonMessage:(NSString* _Nullable)jsonMessage;
47
+ - (void)streamClientReceiveWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise id_:(NSString* _Nullable)id_;
48
+ @end
49
+
50
+ @interface GnoGnonativeBridgeConfig : NSObject <goSeqRefInterface> {
51
+ }
52
+ @property(strong, readonly) _Nonnull id _ref;
53
+
54
+ - (nonnull instancetype)initWithRef:(_Nonnull id)ref;
55
+ - (nullable instancetype)init;
56
+ @property (nonatomic) NSString* _Nonnull rootDir;
57
+ @property (nonatomic) NSString* _Nonnull tmpDir;
58
+ @property (nonatomic) BOOL useTcpListener;
59
+ @property (nonatomic) BOOL disableUdsListener;
60
+ @end
61
+
62
+ FOUNDATION_EXPORT GnoGnonativeBridge* _Nullable GnoGnonativeNewBridge(GnoGnonativeBridgeConfig* _Nullable config, NSError* _Nullable* _Nullable error);
63
+
64
+ FOUNDATION_EXPORT GnoGnonativeBridgeConfig* _Nullable GnoGnonativeNewBridgeConfig(void);
65
+
66
+ // skipped function NewServiceClient with unsupported parameter or return types
67
+
68
+
69
+ @class GnoGnonativePromiseBlock;
70
+
71
+ @class GnoGnonativeServiceClient;
72
+
73
+ @interface GnoGnonativePromiseBlock : NSObject <goSeqRefInterface, GnoGnonativePromiseBlock> {
74
+ }
75
+ @property(strong, readonly) _Nonnull id _ref;
76
+
77
+ - (nonnull instancetype)initWithRef:(_Nonnull id)ref;
78
+ - (void)callReject:(NSError* _Nullable)error;
79
+ - (void)callResolve:(NSString* _Nullable)reply;
80
+ @end
81
+
82
+ @interface GnoGnonativeServiceClient : NSObject <goSeqRefInterface, GnoGnonativeServiceClient> {
83
+ }
84
+ @property(strong, readonly) _Nonnull id _ref;
85
+
86
+ - (nonnull instancetype)initWithRef:(_Nonnull id)ref;
87
+ - (void)closeStreamClientWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise id_:(NSString* _Nullable)id_;
88
+ - (void)createStreamClientWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise method:(NSString* _Nullable)method jsonMessage:(NSString* _Nullable)jsonMessage;
89
+ - (void)invokeGrpcMethodWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise method:(NSString* _Nullable)method jsonMessage:(NSString* _Nullable)jsonMessage;
90
+ - (void)streamClientReceiveWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise id_:(NSString* _Nullable)id_;
91
+ @end
92
+
93
+ #endif
@@ -0,0 +1,29 @@
1
+ // Objective-C API for talking to Go package.
2
+ // gobind -lang=objc -prefix="Gno"
3
+ //
4
+ // File is generated by gobind. Do not edit.
5
+
6
+ #ifndef __Universe_H__
7
+ #define __Universe_H__
8
+
9
+ @import Foundation;
10
+ #include "ref.h"
11
+
12
+ @protocol Universeerror;
13
+ @class Universeerror;
14
+
15
+ @protocol Universeerror <NSObject>
16
+ - (NSString* _Nonnull)error;
17
+ @end
18
+
19
+ @class Universeerror;
20
+
21
+ @interface Universeerror : NSError <goSeqRefInterface, Universeerror> {
22
+ }
23
+ @property(strong, readonly) _Nonnull id _ref;
24
+
25
+ - (nonnull instancetype)initWithRef:(_Nonnull id)ref;
26
+ - (NSString* _Nonnull)error;
27
+ @end
28
+
29
+ #endif
@@ -0,0 +1,35 @@
1
+ // Copyright 2015 The Go Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style
3
+ // license that can be found in the LICENSE file.
4
+
5
+ #ifndef __GO_REF_HDR__
6
+ #define __GO_REF_HDR__
7
+
8
+ #include <Foundation/Foundation.h>
9
+
10
+ // GoSeqRef is an object tagged with an integer for passing back and
11
+ // forth across the language boundary. A GoSeqRef may represent either
12
+ // an instance of a Go object, or an Objective-C object passed to Go.
13
+ // The explicit allocation of a GoSeqRef is used to pin a Go object
14
+ // when it is passed to Objective-C. The Go seq package maintains a
15
+ // reference to the Go object in a map keyed by the refnum along with
16
+ // a reference count. When the reference count reaches zero, the Go
17
+ // seq package will clear the corresponding entry in the map.
18
+ @interface GoSeqRef : NSObject {
19
+ }
20
+ @property(readonly) int32_t refnum;
21
+ @property(strong) id obj; // NULL when representing a Go object.
22
+
23
+ // new GoSeqRef object to proxy a Go object. The refnum must be
24
+ // provided from Go side.
25
+ - (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj;
26
+
27
+ - (int32_t)incNum;
28
+
29
+ @end
30
+
31
+ @protocol goSeqRefInterface
32
+ -(GoSeqRef*) _ref;
33
+ @end
34
+
35
+ #endif
@@ -0,0 +1,8 @@
1
+ framework module "GnoCore" {
2
+ header "ref.h"
3
+ header "GnoGnonative.objc.h"
4
+ header "Universe.objc.h"
5
+ header "GnoCore.h"
6
+
7
+ export *
8
+ }
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ </dict>
6
+ </plist>
@@ -0,0 +1,13 @@
1
+
2
+ // Objective-C API for talking to the following Go packages
3
+ //
4
+ // github.com/gnolang/gnonative/framework/service
5
+ //
6
+ // File is generated by gomobile bind. Do not edit.
7
+ #ifndef __GnoCore_FRAMEWORK_H__
8
+ #define __GnoCore_FRAMEWORK_H__
9
+
10
+ #include "GnoGnonative.objc.h"
11
+ #include "Universe.objc.h"
12
+
13
+ #endif
@@ -0,0 +1,93 @@
1
+ // Objective-C API for talking to github.com/gnolang/gnonative/framework/service Go package.
2
+ // gobind -lang=objc -prefix="Gno" github.com/gnolang/gnonative/framework/service
3
+ //
4
+ // File is generated by gobind. Do not edit.
5
+
6
+ #ifndef __GnoGnonative_H__
7
+ #define __GnoGnonative_H__
8
+
9
+ @import Foundation;
10
+ #include "ref.h"
11
+ #include "Universe.objc.h"
12
+
13
+
14
+ @class GnoGnonativeBridge;
15
+ @class GnoGnonativeBridgeConfig;
16
+ @protocol GnoGnonativePromiseBlock;
17
+ @class GnoGnonativePromiseBlock;
18
+ @protocol GnoGnonativeServiceClient;
19
+ @class GnoGnonativeServiceClient;
20
+
21
+ @protocol GnoGnonativePromiseBlock <NSObject>
22
+ - (void)callReject:(NSError* _Nullable)error;
23
+ - (void)callResolve:(NSString* _Nullable)reply;
24
+ @end
25
+
26
+ @protocol GnoGnonativeServiceClient <NSObject>
27
+ - (void)closeStreamClientWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise id_:(NSString* _Nullable)id_;
28
+ - (void)createStreamClientWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise method:(NSString* _Nullable)method jsonMessage:(NSString* _Nullable)jsonMessage;
29
+ - (void)invokeGrpcMethodWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise method:(NSString* _Nullable)method jsonMessage:(NSString* _Nullable)jsonMessage;
30
+ - (void)streamClientReceiveWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise id_:(NSString* _Nullable)id_;
31
+ @end
32
+
33
+ @interface GnoGnonativeBridge : NSObject <goSeqRefInterface, GnoGnonativeServiceClient> {
34
+ }
35
+ @property(strong, readonly) _Nonnull id _ref;
36
+
37
+ - (nonnull instancetype)initWithRef:(_Nonnull id)ref;
38
+ - (nullable instancetype)init:(GnoGnonativeBridgeConfig* _Nullable)config;
39
+ @property (nonatomic) id<GnoGnonativeServiceClient> _Nullable serviceClient;
40
+ - (BOOL)close:(NSError* _Nullable* _Nullable)error;
41
+ - (void)closeStreamClientWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise id_:(NSString* _Nullable)id_;
42
+ - (void)createStreamClientWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise method:(NSString* _Nullable)method jsonMessage:(NSString* _Nullable)jsonMessage;
43
+ - (NSString* _Nonnull)getTcpAddr;
44
+ - (long)getTcpPort;
45
+ - (NSString* _Nonnull)getUDSPath;
46
+ - (void)invokeGrpcMethodWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise method:(NSString* _Nullable)method jsonMessage:(NSString* _Nullable)jsonMessage;
47
+ - (void)streamClientReceiveWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise id_:(NSString* _Nullable)id_;
48
+ @end
49
+
50
+ @interface GnoGnonativeBridgeConfig : NSObject <goSeqRefInterface> {
51
+ }
52
+ @property(strong, readonly) _Nonnull id _ref;
53
+
54
+ - (nonnull instancetype)initWithRef:(_Nonnull id)ref;
55
+ - (nullable instancetype)init;
56
+ @property (nonatomic) NSString* _Nonnull rootDir;
57
+ @property (nonatomic) NSString* _Nonnull tmpDir;
58
+ @property (nonatomic) BOOL useTcpListener;
59
+ @property (nonatomic) BOOL disableUdsListener;
60
+ @end
61
+
62
+ FOUNDATION_EXPORT GnoGnonativeBridge* _Nullable GnoGnonativeNewBridge(GnoGnonativeBridgeConfig* _Nullable config, NSError* _Nullable* _Nullable error);
63
+
64
+ FOUNDATION_EXPORT GnoGnonativeBridgeConfig* _Nullable GnoGnonativeNewBridgeConfig(void);
65
+
66
+ // skipped function NewServiceClient with unsupported parameter or return types
67
+
68
+
69
+ @class GnoGnonativePromiseBlock;
70
+
71
+ @class GnoGnonativeServiceClient;
72
+
73
+ @interface GnoGnonativePromiseBlock : NSObject <goSeqRefInterface, GnoGnonativePromiseBlock> {
74
+ }
75
+ @property(strong, readonly) _Nonnull id _ref;
76
+
77
+ - (nonnull instancetype)initWithRef:(_Nonnull id)ref;
78
+ - (void)callReject:(NSError* _Nullable)error;
79
+ - (void)callResolve:(NSString* _Nullable)reply;
80
+ @end
81
+
82
+ @interface GnoGnonativeServiceClient : NSObject <goSeqRefInterface, GnoGnonativeServiceClient> {
83
+ }
84
+ @property(strong, readonly) _Nonnull id _ref;
85
+
86
+ - (nonnull instancetype)initWithRef:(_Nonnull id)ref;
87
+ - (void)closeStreamClientWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise id_:(NSString* _Nullable)id_;
88
+ - (void)createStreamClientWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise method:(NSString* _Nullable)method jsonMessage:(NSString* _Nullable)jsonMessage;
89
+ - (void)invokeGrpcMethodWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise method:(NSString* _Nullable)method jsonMessage:(NSString* _Nullable)jsonMessage;
90
+ - (void)streamClientReceiveWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise id_:(NSString* _Nullable)id_;
91
+ @end
92
+
93
+ #endif
@@ -0,0 +1,29 @@
1
+ // Objective-C API for talking to Go package.
2
+ // gobind -lang=objc -prefix="Gno"
3
+ //
4
+ // File is generated by gobind. Do not edit.
5
+
6
+ #ifndef __Universe_H__
7
+ #define __Universe_H__
8
+
9
+ @import Foundation;
10
+ #include "ref.h"
11
+
12
+ @protocol Universeerror;
13
+ @class Universeerror;
14
+
15
+ @protocol Universeerror <NSObject>
16
+ - (NSString* _Nonnull)error;
17
+ @end
18
+
19
+ @class Universeerror;
20
+
21
+ @interface Universeerror : NSError <goSeqRefInterface, Universeerror> {
22
+ }
23
+ @property(strong, readonly) _Nonnull id _ref;
24
+
25
+ - (nonnull instancetype)initWithRef:(_Nonnull id)ref;
26
+ - (NSString* _Nonnull)error;
27
+ @end
28
+
29
+ #endif
@@ -0,0 +1,35 @@
1
+ // Copyright 2015 The Go Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style
3
+ // license that can be found in the LICENSE file.
4
+
5
+ #ifndef __GO_REF_HDR__
6
+ #define __GO_REF_HDR__
7
+
8
+ #include <Foundation/Foundation.h>
9
+
10
+ // GoSeqRef is an object tagged with an integer for passing back and
11
+ // forth across the language boundary. A GoSeqRef may represent either
12
+ // an instance of a Go object, or an Objective-C object passed to Go.
13
+ // The explicit allocation of a GoSeqRef is used to pin a Go object
14
+ // when it is passed to Objective-C. The Go seq package maintains a
15
+ // reference to the Go object in a map keyed by the refnum along with
16
+ // a reference count. When the reference count reaches zero, the Go
17
+ // seq package will clear the corresponding entry in the map.
18
+ @interface GoSeqRef : NSObject {
19
+ }
20
+ @property(readonly) int32_t refnum;
21
+ @property(strong) id obj; // NULL when representing a Go object.
22
+
23
+ // new GoSeqRef object to proxy a Go object. The refnum must be
24
+ // provided from Go side.
25
+ - (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj;
26
+
27
+ - (int32_t)incNum;
28
+
29
+ @end
30
+
31
+ @protocol goSeqRefInterface
32
+ -(GoSeqRef*) _ref;
33
+ @end
34
+
35
+ #endif
@@ -0,0 +1,8 @@
1
+ framework module "GnoCore" {
2
+ header "ref.h"
3
+ header "GnoGnonative.objc.h"
4
+ header "Universe.objc.h"
5
+ header "GnoCore.h"
6
+
7
+ export *
8
+ }
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ </dict>
6
+ </plist>
@@ -0,0 +1,13 @@
1
+
2
+ // Objective-C API for talking to the following Go packages
3
+ //
4
+ // github.com/gnolang/gnonative/framework/service
5
+ //
6
+ // File is generated by gomobile bind. Do not edit.
7
+ #ifndef __GnoCore_FRAMEWORK_H__
8
+ #define __GnoCore_FRAMEWORK_H__
9
+
10
+ #include "GnoGnonative.objc.h"
11
+ #include "Universe.objc.h"
12
+
13
+ #endif
@@ -0,0 +1,93 @@
1
+ // Objective-C API for talking to github.com/gnolang/gnonative/framework/service Go package.
2
+ // gobind -lang=objc -prefix="Gno" github.com/gnolang/gnonative/framework/service
3
+ //
4
+ // File is generated by gobind. Do not edit.
5
+
6
+ #ifndef __GnoGnonative_H__
7
+ #define __GnoGnonative_H__
8
+
9
+ @import Foundation;
10
+ #include "ref.h"
11
+ #include "Universe.objc.h"
12
+
13
+
14
+ @class GnoGnonativeBridge;
15
+ @class GnoGnonativeBridgeConfig;
16
+ @protocol GnoGnonativePromiseBlock;
17
+ @class GnoGnonativePromiseBlock;
18
+ @protocol GnoGnonativeServiceClient;
19
+ @class GnoGnonativeServiceClient;
20
+
21
+ @protocol GnoGnonativePromiseBlock <NSObject>
22
+ - (void)callReject:(NSError* _Nullable)error;
23
+ - (void)callResolve:(NSString* _Nullable)reply;
24
+ @end
25
+
26
+ @protocol GnoGnonativeServiceClient <NSObject>
27
+ - (void)closeStreamClientWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise id_:(NSString* _Nullable)id_;
28
+ - (void)createStreamClientWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise method:(NSString* _Nullable)method jsonMessage:(NSString* _Nullable)jsonMessage;
29
+ - (void)invokeGrpcMethodWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise method:(NSString* _Nullable)method jsonMessage:(NSString* _Nullable)jsonMessage;
30
+ - (void)streamClientReceiveWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise id_:(NSString* _Nullable)id_;
31
+ @end
32
+
33
+ @interface GnoGnonativeBridge : NSObject <goSeqRefInterface, GnoGnonativeServiceClient> {
34
+ }
35
+ @property(strong, readonly) _Nonnull id _ref;
36
+
37
+ - (nonnull instancetype)initWithRef:(_Nonnull id)ref;
38
+ - (nullable instancetype)init:(GnoGnonativeBridgeConfig* _Nullable)config;
39
+ @property (nonatomic) id<GnoGnonativeServiceClient> _Nullable serviceClient;
40
+ - (BOOL)close:(NSError* _Nullable* _Nullable)error;
41
+ - (void)closeStreamClientWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise id_:(NSString* _Nullable)id_;
42
+ - (void)createStreamClientWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise method:(NSString* _Nullable)method jsonMessage:(NSString* _Nullable)jsonMessage;
43
+ - (NSString* _Nonnull)getTcpAddr;
44
+ - (long)getTcpPort;
45
+ - (NSString* _Nonnull)getUDSPath;
46
+ - (void)invokeGrpcMethodWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise method:(NSString* _Nullable)method jsonMessage:(NSString* _Nullable)jsonMessage;
47
+ - (void)streamClientReceiveWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise id_:(NSString* _Nullable)id_;
48
+ @end
49
+
50
+ @interface GnoGnonativeBridgeConfig : NSObject <goSeqRefInterface> {
51
+ }
52
+ @property(strong, readonly) _Nonnull id _ref;
53
+
54
+ - (nonnull instancetype)initWithRef:(_Nonnull id)ref;
55
+ - (nullable instancetype)init;
56
+ @property (nonatomic) NSString* _Nonnull rootDir;
57
+ @property (nonatomic) NSString* _Nonnull tmpDir;
58
+ @property (nonatomic) BOOL useTcpListener;
59
+ @property (nonatomic) BOOL disableUdsListener;
60
+ @end
61
+
62
+ FOUNDATION_EXPORT GnoGnonativeBridge* _Nullable GnoGnonativeNewBridge(GnoGnonativeBridgeConfig* _Nullable config, NSError* _Nullable* _Nullable error);
63
+
64
+ FOUNDATION_EXPORT GnoGnonativeBridgeConfig* _Nullable GnoGnonativeNewBridgeConfig(void);
65
+
66
+ // skipped function NewServiceClient with unsupported parameter or return types
67
+
68
+
69
+ @class GnoGnonativePromiseBlock;
70
+
71
+ @class GnoGnonativeServiceClient;
72
+
73
+ @interface GnoGnonativePromiseBlock : NSObject <goSeqRefInterface, GnoGnonativePromiseBlock> {
74
+ }
75
+ @property(strong, readonly) _Nonnull id _ref;
76
+
77
+ - (nonnull instancetype)initWithRef:(_Nonnull id)ref;
78
+ - (void)callReject:(NSError* _Nullable)error;
79
+ - (void)callResolve:(NSString* _Nullable)reply;
80
+ @end
81
+
82
+ @interface GnoGnonativeServiceClient : NSObject <goSeqRefInterface, GnoGnonativeServiceClient> {
83
+ }
84
+ @property(strong, readonly) _Nonnull id _ref;
85
+
86
+ - (nonnull instancetype)initWithRef:(_Nonnull id)ref;
87
+ - (void)closeStreamClientWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise id_:(NSString* _Nullable)id_;
88
+ - (void)createStreamClientWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise method:(NSString* _Nullable)method jsonMessage:(NSString* _Nullable)jsonMessage;
89
+ - (void)invokeGrpcMethodWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise method:(NSString* _Nullable)method jsonMessage:(NSString* _Nullable)jsonMessage;
90
+ - (void)streamClientReceiveWithPromiseBlock:(id<GnoGnonativePromiseBlock> _Nullable)promise id_:(NSString* _Nullable)id_;
91
+ @end
92
+
93
+ #endif
@@ -0,0 +1,29 @@
1
+ // Objective-C API for talking to Go package.
2
+ // gobind -lang=objc -prefix="Gno"
3
+ //
4
+ // File is generated by gobind. Do not edit.
5
+
6
+ #ifndef __Universe_H__
7
+ #define __Universe_H__
8
+
9
+ @import Foundation;
10
+ #include "ref.h"
11
+
12
+ @protocol Universeerror;
13
+ @class Universeerror;
14
+
15
+ @protocol Universeerror <NSObject>
16
+ - (NSString* _Nonnull)error;
17
+ @end
18
+
19
+ @class Universeerror;
20
+
21
+ @interface Universeerror : NSError <goSeqRefInterface, Universeerror> {
22
+ }
23
+ @property(strong, readonly) _Nonnull id _ref;
24
+
25
+ - (nonnull instancetype)initWithRef:(_Nonnull id)ref;
26
+ - (NSString* _Nonnull)error;
27
+ @end
28
+
29
+ #endif
@@ -0,0 +1,35 @@
1
+ // Copyright 2015 The Go Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style
3
+ // license that can be found in the LICENSE file.
4
+
5
+ #ifndef __GO_REF_HDR__
6
+ #define __GO_REF_HDR__
7
+
8
+ #include <Foundation/Foundation.h>
9
+
10
+ // GoSeqRef is an object tagged with an integer for passing back and
11
+ // forth across the language boundary. A GoSeqRef may represent either
12
+ // an instance of a Go object, or an Objective-C object passed to Go.
13
+ // The explicit allocation of a GoSeqRef is used to pin a Go object
14
+ // when it is passed to Objective-C. The Go seq package maintains a
15
+ // reference to the Go object in a map keyed by the refnum along with
16
+ // a reference count. When the reference count reaches zero, the Go
17
+ // seq package will clear the corresponding entry in the map.
18
+ @interface GoSeqRef : NSObject {
19
+ }
20
+ @property(readonly) int32_t refnum;
21
+ @property(strong) id obj; // NULL when representing a Go object.
22
+
23
+ // new GoSeqRef object to proxy a Go object. The refnum must be
24
+ // provided from Go side.
25
+ - (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj;
26
+
27
+ - (int32_t)incNum;
28
+
29
+ @end
30
+
31
+ @protocol goSeqRefInterface
32
+ -(GoSeqRef*) _ref;
33
+ @end
34
+
35
+ #endif
@@ -0,0 +1,8 @@
1
+ framework module "GnoCore" {
2
+ header "ref.h"
3
+ header "GnoGnonative.objc.h"
4
+ header "Universe.objc.h"
5
+ header "GnoCore.h"
6
+
7
+ export *
8
+ }
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ </dict>
6
+ </plist>