Commit 61b666ca authored by Stefan van den Oord's avatar Stefan van den Oord Committed by Stefan van den Oord

Adding some documentation

parent 384a9004
' Class diagram created with PlantUML version 8020 (http://plantuml.sourceforge.net)
@startuml
class DeviceId {
- certificate : SecCertificate
+ {static} myId() : DeviceId
+ description() : String
}
class Connector {
- deviceId : DeviceId
+ init(deviceId)
+ connect(host,port,deviceId,onCompletion,onMessage,onError)
}
class Connection {
+ disconnect()
+ send(message)
--
Shouldn't this be private?
+ socketDidReadData()
}
Connector o--> DeviceId
Connector -- Connection : creates >
@enduml
' Sequence diagram created with PlantUML version 8020 (http://plantuml.sourceforge.net)
@startuml
autonumber "#:"
hide footbox
skinparam sequence {
ArrowColor black
ActorBorderColor black
LifeLineBorderColor black
LifeLineBackgroundColor #EEEEEE
ParticipantBorderColor black
ParticipantBackgroundColor white
ActorBackgroundColor white
}
participant "app" as app
participant "identity" as identity
participant "connector" as connector
participant "socket" as socket
participant "tls" as tls
participant "connection" as connection
activate app
activate identity
app -> identity : getMyId
identity --> app : identity
deactivate identity
activate connector
app -> connector : instantiate(identity)
app -> connector : connect(remoteIdentity)
activate socket
connector -> socket : open
socket --> connector
activate tls
connector -> tls : secure(socket)
tls -> socket : startTLS
socket -> tls : didReceiveTrust
tls -> tls : verifyRemoteDeviceId
tls -> connector : onComplete(true)
activate connection
connector -> connection : instantiate(socket)
connector -> app : onComplete(connection)
deactivate connection
deactivate tls
deactivate socket
deactivate connector
deactivate app
@enduml
#!/bin/sh
###
# Fix jazzy/sourcekitten error about libswiftCore.dylib: https://github.com/realm/jazzy/issues/159
###
scriptDir="`dirname $0`"
scriptName="`basename $0`"
absScriptDir="`cd $scriptDir; pwd`"
docsdir=${absScriptDir}/docs
fatal() {
echo "[fatal] $1" 1>&2
exit 1
}
absPath() {
case "$1" in
/*)
printf "%s\n" "$1"
;;
*)
printf "%s\n" "$PWD/$1"
;;
esac;
}
main() {
if [ ! -d ${docsdir} ]; then
mkdir -p ${docsdir}
fi
rm -r ${docsdir}/*
java -jar ${absScriptDir}/3rdParty/plantuml.8020.jar -o ${docsdir} -graphvizdot "/opt/local/bin/dot" ${absScriptDir}/Documentation/class.pu ${absScriptDir}/Documentation/sequence.pu || fatal "Failed to create diagrams"
jazzy -a "Mark Spanbroek and Stefan van den Oord" -u https://source.ind.ie/project/pulse-swift -m "Pulse-Swift" --min-acl public || fatal "Documentation generation failed"
}
which -s jazzy || fatal "Documentation generator 'jazzy' not found. Can be installed as ruby gem."
main $*
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment