Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Elixxir dApps SDK Swift
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile
iOS
Elixxir dApps SDK Swift
Commits
8dfd7580
Commit
8dfd7580
authored
2 years ago
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Add ConnectionAuthStatusProvider
parent
92febf27
No related branches found
No related tags found
1 merge request
!2
Bindings API wrapper
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Sources/ElixxirDAppsSDK/Connection.swift
+4
-4
4 additions, 4 deletions
Sources/ElixxirDAppsSDK/Connection.swift
Sources/ElixxirDAppsSDK/ConnectionAuthStatusProvider.swift
+33
-0
33 additions, 0 deletions
Sources/ElixxirDAppsSDK/ConnectionAuthStatusProvider.swift
with
37 additions
and
4 deletions
Sources/ElixxirDAppsSDK/Connection.swift
+
4
−
4
View file @
8dfd7580
import
Bindings
public
struct
Connection
{
public
var
isAuthenticated
:
()
->
Bool
public
var
isAuthenticated
:
ConnectionAuthStatusProvider
public
var
getPartner
:
ConnectionPartnerProvider
public
var
send
:
MessageSender
public
var
listen
:
MessageListener
...
...
@@ -13,7 +13,7 @@ extension Connection {
bindingsConnection
:
BindingsConnection
)
->
Connection
{
Connection
(
isAuthenticated
:
{
false
}
,
isAuthenticated
:
.
live
(
bindingsConnection
:
bindingsConnection
)
,
getPartner
:
.
live
(
bindingsConnection
:
bindingsConnection
),
send
:
.
live
(
bindingsConnection
:
bindingsConnection
),
listen
:
.
live
(
bindingsConnection
:
bindingsConnection
),
...
...
@@ -25,7 +25,7 @@ extension Connection {
bindingsAuthenticatedConnection
:
BindingsAuthenticatedConnection
)
->
Connection
{
Connection
(
isAuthenticated
:
bindingsAuthenticatedConnection
.
i
sAuthenticated
,
isAuthenticated
:
.
live
(
bindingsAuthenticatedConnection
:
binding
sAuthenticated
Connection
)
,
getPartner
:
.
live
(
bindingsAuthenticatedConnection
:
bindingsAuthenticatedConnection
),
send
:
.
live
(
bindingsAuthenticatedConnection
:
bindingsAuthenticatedConnection
),
listen
:
.
live
(
bindingsAuthenticatedConnection
:
bindingsAuthenticatedConnection
),
...
...
@@ -37,7 +37,7 @@ extension Connection {
#if DEBUG
extension
Connection
{
public
static
let
failing
=
Connection
(
isAuthenticated
:
{
fatalError
(
"Not implemented"
)
}
,
isAuthenticated
:
.
failing
,
getPartner
:
.
failing
,
send
:
.
failing
,
listen
:
.
failing
,
...
...
This diff is collapsed.
Click to expand it.
Sources/ElixxirDAppsSDK/ConnectionAuthStatusProvider.swift
0 → 100644
+
33
−
0
View file @
8dfd7580
import
Bindings
public
struct
ConnectionAuthStatusProvider
{
public
var
isAuthenticated
:
()
->
Bool
public
func
callAsFunction
()
->
Bool
{
isAuthenticated
()
}
}
extension
ConnectionAuthStatusProvider
{
public
static
func
live
(
bindingsConnection
:
BindingsConnection
)
->
ConnectionAuthStatusProvider
{
ConnectionAuthStatusProvider
{
false
}
}
public
static
func
live
(
bindingsAuthenticatedConnection
:
BindingsAuthenticatedConnection
)
->
ConnectionAuthStatusProvider
{
ConnectionAuthStatusProvider
(
isAuthenticated
:
bindingsAuthenticatedConnection
.
isAuthenticated
)
}
}
#if DEBUG
extension
ConnectionAuthStatusProvider
{
public
static
let
failing
=
ConnectionAuthStatusProvider
{
fatalError
(
"Not implemented"
)
}
}
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment