Skip to content

Commit

Permalink
add functional reactive spring with mongodb
Browse files Browse the repository at this point in the history
  • Loading branch information
gailo22 committed Nov 4, 2019
1 parent 68234c5 commit 7bbf2bf
Show file tree
Hide file tree
Showing 15 changed files with 311 additions and 63 deletions.
37 changes: 37 additions & 0 deletions ios/IAP-Sample/IAP-Sample/IAPService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import Foundation
import StoreKit
import Firebase
import FirebaseFirestore

class IAPService: NSObject {
private override init() {}
Expand Down Expand Up @@ -63,3 +65,38 @@ extension SKPaymentTransactionState {
}
}
}


func queryAuthenTokenFirebase(callback: @escaping () -> ()) {
let ref = FirebaseApp.realtimeDatabase.reference(withPath: "authen_token")
ref.observeSingleEvent(of: .value, with: { (snapshot) in
guard let value = snapshot.value as? [String: Any] else {
// Failed to cast
return
}

NotificationCenter.default.post(name: .AuthenTokenFirebaseDataProxyInvalidated, object: nil)
callback()
}, withCancel: nil)
}

func queryAuthenTokenFirestore(callback: @escaping () -> ()) {
let ref = Firestore.firestore().collection("trueid-84d04").document("authen_token")
ref.addSnapshotListener { snapshot, error in
guard let document = snapshot else {
print("Error fetching document: \(error!)")
return
}

// NotificationCenter.default.post(name: .AuthenTokenFirebaseDataProxyInvalidated, object: nil)
callback()
}
}


extension FirebaseApp {
static var realtimeDatabase: Database {
var endPoints = ""
return Database.database(url: endPoints)
}
}
1 change: 1 addition & 0 deletions ios/IAP-Sample/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ target 'IAP-Sample' do

# Pods for IAP-Sample
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'

Expand Down
133 changes: 72 additions & 61 deletions ios/IAP-Sample/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,90 +5,98 @@ PODS:
- BoringSSL-GRPC/Implementation (0.0.3):
- BoringSSL-GRPC/Interface (= 0.0.3)
- BoringSSL-GRPC/Interface (0.0.3)
- Firebase/Auth (6.7.0):
- Firebase/Auth (6.11.0):
- Firebase/CoreOnly
- FirebaseAuth (~> 6.2.3)
- Firebase/Core (6.7.0):
- FirebaseAuth (~> 6.3.1)
- Firebase/Core (6.11.0):
- Firebase/CoreOnly
- FirebaseAnalytics (= 6.1.1)
- Firebase/CoreOnly (6.7.0):
- FirebaseCore (= 6.2.1)
- Firebase/Firestore (6.7.0):
- FirebaseAnalytics (= 6.1.3)
- Firebase/CoreOnly (6.11.0):
- FirebaseCore (= 6.3.2)
- Firebase/Database (6.11.0):
- Firebase/CoreOnly
- FirebaseFirestore (~> 1.4.4)
- FirebaseAnalytics (6.1.1):
- FirebaseCore (~> 6.2)
- FirebaseDatabase (~> 6.1.1)
- Firebase/Firestore (6.11.0):
- Firebase/CoreOnly
- FirebaseFirestore (~> 1.6.1)
- FirebaseAnalytics (6.1.3):
- FirebaseCore (~> 6.3)
- FirebaseInstanceID (~> 4.2)
- GoogleAppMeasurement (= 6.1.1)
- GoogleAppMeasurement (= 6.1.3)
- GoogleUtilities/AppDelegateSwizzler (~> 6.0)
- GoogleUtilities/MethodSwizzler (~> 6.0)
- GoogleUtilities/Network (~> 6.0)
- "GoogleUtilities/NSData+zlib (~> 6.0)"
- nanopb (~> 0.3)
- FirebaseAuth (6.2.3):
- nanopb (~> 0.3.901)
- FirebaseAuth (6.3.1):
- FirebaseAuthInterop (~> 1.0)
- FirebaseCore (~> 6.2)
- GoogleUtilities/AppDelegateSwizzler (~> 6.2)
- GoogleUtilities/Environment (~> 6.2)
- GTMSessionFetcher/Core (~> 1.1)
- FirebaseAuthInterop (1.0.0)
- FirebaseCore (6.2.1):
- FirebaseCore (6.3.2):
- FirebaseCoreDiagnostics (~> 1.0)
- FirebaseCoreDiagnosticsInterop (~> 1.0)
- GoogleUtilities/Environment (~> 6.2)
- GoogleUtilities/Logger (~> 6.2)
- FirebaseCoreDiagnostics (1.0.1):
- FirebaseCoreDiagnostics (1.1.1):
- FirebaseCoreDiagnosticsInterop (~> 1.0)
- GoogleDataTransportCCTSupport (~> 1.0)
- GoogleUtilities/Environment (~> 6.2)
- GoogleUtilities/Logger (~> 6.2)
- nanopb (~> 0.3.901)
- FirebaseCoreDiagnosticsInterop (1.0.0)
- FirebaseFirestore (1.4.5):
- FirebaseDatabase (6.1.1):
- FirebaseAuthInterop (~> 1.0)
- FirebaseCore (~> 6.0)
- leveldb-library (~> 1.22)
- FirebaseFirestore (1.6.1):
- FirebaseAuthInterop (~> 1.0)
- FirebaseCore (~> 6.2)
- FirebaseFirestore/abseil-cpp (= 1.4.5)
- FirebaseFirestore/abseil-cpp (= 1.6.1)
- "gRPC-C++ (= 0.0.9)"
- leveldb-library (~> 1.20)
- leveldb-library (~> 1.22)
- nanopb (~> 0.3.901)
- Protobuf (~> 3.1)
- FirebaseFirestore/abseil-cpp (1.4.5):
- Protobuf (>= 3.9.2, ~> 3.9)
- FirebaseFirestore/abseil-cpp (1.6.1):
- FirebaseAuthInterop (~> 1.0)
- FirebaseCore (~> 6.2)
- "gRPC-C++ (= 0.0.9)"
- leveldb-library (~> 1.20)
- leveldb-library (~> 1.22)
- nanopb (~> 0.3.901)
- Protobuf (~> 3.1)
- FirebaseInstanceID (4.2.3):
- Protobuf (>= 3.9.2, ~> 3.9)
- FirebaseInstanceID (4.2.6):
- FirebaseCore (~> 6.0)
- GoogleUtilities/Environment (~> 6.0)
- GoogleUtilities/UserDefaults (~> 6.0)
- GoogleAppMeasurement (6.1.1):
- GoogleAppMeasurement (6.1.3):
- GoogleUtilities/AppDelegateSwizzler (~> 6.0)
- GoogleUtilities/MethodSwizzler (~> 6.0)
- GoogleUtilities/Network (~> 6.0)
- "GoogleUtilities/NSData+zlib (~> 6.0)"
- nanopb (~> 0.3)
- GoogleDataTransport (1.1.3)
- GoogleDataTransportCCTSupport (1.0.2):
- GoogleDataTransport (~> 1.1)
- nanopb
- GoogleUtilities/AppDelegateSwizzler (6.2.5):
- nanopb (~> 0.3.901)
- GoogleDataTransport (3.0.1)
- GoogleDataTransportCCTSupport (1.2.1):
- GoogleDataTransport (~> 3.0)
- nanopb (~> 0.3.901)
- GoogleUtilities/AppDelegateSwizzler (6.3.1):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Environment (6.2.5)
- GoogleUtilities/Logger (6.2.5):
- GoogleUtilities/Environment (6.3.1)
- GoogleUtilities/Logger (6.3.1):
- GoogleUtilities/Environment
- GoogleUtilities/MethodSwizzler (6.2.5):
- GoogleUtilities/MethodSwizzler (6.3.1):
- GoogleUtilities/Logger
- GoogleUtilities/Network (6.2.5):
- GoogleUtilities/Network (6.3.1):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (6.2.5)"
- GoogleUtilities/Reachability (6.2.5):
- "GoogleUtilities/NSData+zlib (6.3.1)"
- GoogleUtilities/Reachability (6.3.1):
- GoogleUtilities/Logger
- GoogleUtilities/UserDefaults (6.2.5):
- GoogleUtilities/UserDefaults (6.3.1):
- GoogleUtilities/Logger
- "gRPC-C++ (0.0.9)":
- "gRPC-C++/Implementation (= 0.0.9)"
Expand All @@ -106,22 +114,23 @@ PODS:
- gRPC-Core/Interface (= 1.21.0)
- nanopb (~> 0.3)
- gRPC-Core/Interface (1.21.0)
- GTMSessionFetcher/Core (1.2.2)
- GTMSessionFetcher/Core (1.3.0)
- leveldb-library (1.22)
- nanopb (0.3.901):
- nanopb/decode (= 0.3.901)
- nanopb/encode (= 0.3.901)
- nanopb/decode (0.3.901)
- nanopb/encode (0.3.901)
- Protobuf (3.9.0)
- nanopb (0.3.9011):
- nanopb/decode (= 0.3.9011)
- nanopb/encode (= 0.3.9011)
- nanopb/decode (0.3.9011)
- nanopb/encode (0.3.9011)
- Protobuf (3.10.0)

DEPENDENCIES:
- Firebase/Auth
- Firebase/Core
- Firebase/Database
- Firebase/Firestore

SPEC REPOS:
https://github.com/cocoapods/specs.git:
trunk:
- BoringSSL-GRPC
- Firebase
- FirebaseAnalytics
Expand All @@ -130,6 +139,7 @@ SPEC REPOS:
- FirebaseCore
- FirebaseCoreDiagnostics
- FirebaseCoreDiagnosticsInterop
- FirebaseDatabase
- FirebaseFirestore
- FirebaseInstanceID
- GoogleAppMeasurement
Expand All @@ -145,26 +155,27 @@ SPEC REPOS:

SPEC CHECKSUMS:
BoringSSL-GRPC: db8764df3204ccea016e1c8dd15d9a9ad63ff318
Firebase: 291d7b0a7b393f252358083b5d224884126fa46d
FirebaseAnalytics: 843c7f64a8f9c79f0d03281197ebe7bb1d58d477
FirebaseAuth: e7f86c2dfc57281cd01f7da5e4b40e01e4510a4a
Firebase: bc9cfc7a96c73268656d5aaab453ff1b4b530e0e
FirebaseAnalytics: 0e3ecff2c5d86070f7d4325e21f1edabfbd558dc
FirebaseAuth: b401a012cc33b04df3b52bb308b04e8766f2693e
FirebaseAuthInterop: 0ffa57668be100582bb7643d4fcb7615496c41fc
FirebaseCore: 32b48f41c84a56fbde73b35ed01a830b3b6dc048
FirebaseCoreDiagnostics: 4c04ae09d0ab027c30179828c6bb47764df1bd13
FirebaseCore: beeff42c07c30ea94702471d99db2089b594fbbd
FirebaseCoreDiagnostics: af29e43048607588c050889d19204f4d7b758c9f
FirebaseCoreDiagnosticsInterop: 6829da2b8d1fc795ff1bd99df751d3788035d2cb
FirebaseFirestore: c457c22c49ccf15a0fbe95bfcbcf69b984dec285
FirebaseInstanceID: 8b42755db950682e7de0d167bc6fb26a57b244af
GoogleAppMeasurement: 86a82f0e1f20b8eedf8e20326530138fd71409de
GoogleDataTransport: 91e682bd60a49d3f8f69f2e909a66efaed5a1e7a
GoogleDataTransportCCTSupport: 6b545f7149111180763dc18c6f372c963de4a310
GoogleUtilities: e7dc37039b19df7fe543479d3e4a02ac8d11bb69
FirebaseDatabase: 524802f7694268c79d34aeac3d67997593e1a0c9
FirebaseFirestore: bb8315fa13a15ea8977e940496b74ba6ad9071f2
FirebaseInstanceID: d0eafcd8bdbd3447cd694594734078c3e3e77d8b
GoogleAppMeasurement: 434cc7be25e71dc04b8d0e3079125127b330e84a
GoogleDataTransport: 166f9b9f82cbf60a204e8fe2daa9db3e3ec1fb15
GoogleDataTransportCCTSupport: f6ab1962e9dc05ab1fb938b795e5b310209edeec
GoogleUtilities: f895fde57977df4e0233edda0dbeac490e3703b6
"gRPC-C++": 9dfe7b44821e7b3e44aacad2af29d2c21f7cde83
gRPC-Core: c9aef9a261a1247e881b18059b84d597293c9947
GTMSessionFetcher: 61bb0f61a4cb560030f1222021178008a5727a23
GTMSessionFetcher: 43b8b64263023d4f32caa0b40f4c8bfa3c5f36d8
leveldb-library: 55d93ee664b4007aac644a782d11da33fba316f7
nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48
Protobuf: 1097ca58584c8d9be81bfbf2c5ff5975648dd87a
nanopb: 18003b5e52dab79db540fe93fe9579f399bd1ccd
Protobuf: a4dc852ad69c027ca2166ed287b856697814375b

PODFILE CHECKSUM: 99abe336ee649497c92e2cd2378dd09f54569775
PODFILE CHECKSUM: 2870d87d0b8db4dee4cc23655f299e2a41d01ceb

COCOAPODS: 1.7.5
COCOAPODS: 1.8.4
7 changes: 7 additions & 0 deletions microservices/functional-reactive-spring-demo/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM openjdk:8u191-jdk-alpine3.9
MAINTAINER [email protected]
EXPOSE 8080
VOLUME /tmp
ARG JAR_FILE=build/libs/functional-reactive-spring-demo-0.0.1-SNAPSHOT.jar
ADD ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","-Dspring.profiles.active=default","-XX:+UnlockExperimentalVMOptions","-XX:+UseCGroupMemoryLimitForHeap","-XX:MaxRAMFraction=2","/app.jar"]
27 changes: 27 additions & 0 deletions microservices/functional-reactive-spring-demo/kube/mongo-pv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
kind: PersistentVolume
apiVersion: v1
metadata:
name: mongo-pv
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/tmp/mongo_data"

---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: mongo-pv-claim
spec:
storageClassName: manual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
26 changes: 26 additions & 0 deletions microservices/functional-reactive-spring-demo/kube/services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: v1
kind: Service
metadata:
name: mongo
labels:
name: mongo
spec:
ports:
- port: 27017
targetPort: 27017
clusterIP: None
selector:
name: mongo

---
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
ports:
- port: 8080
targetPort: 8080
clusterIP: None
selector:
app: MyApp
Loading

0 comments on commit 7bbf2bf

Please sign in to comment.