Add windows stub for pipeBridge to fix windows build; fix goland error arround ConnectionState[Type]
This commit is contained in:
parent
24855ca604
commit
8c16210407
|
@ -6,7 +6,6 @@ import (
|
||||||
"cwtch.im/cwtch/storage"
|
"cwtch.im/cwtch/storage"
|
||||||
"fmt"
|
"fmt"
|
||||||
"git.openprivacy.ca/openprivacy/libricochet-go/log"
|
"git.openprivacy.ca/openprivacy/libricochet-go/log"
|
||||||
|
|
||||||
"path"
|
"path"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package bridge
|
||||||
|
|
||||||
|
import (
|
||||||
|
"cwtch.im/cwtch/event"
|
||||||
|
"log"
|
||||||
|
)
|
||||||
|
|
||||||
|
func NewPipeBridgeClient(inFilename, outFilename string) event.IPCBridge {
|
||||||
|
log.Fatal("Not supported on windows")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPipeBridgeService returns a pipe backed IPCBridge for a service
|
||||||
|
func NewPipeBridgeService(inFilename, outFilename string) event.IPCBridge {
|
||||||
|
log.Fatal("Not supported on windows")
|
||||||
|
return nil
|
||||||
|
}
|
|
@ -1,3 +1,5 @@
|
||||||
|
// +build !windows
|
||||||
|
|
||||||
package bridge
|
package bridge
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -5,12 +7,12 @@ import (
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"git.openprivacy.ca/openprivacy/libricochet-go/log"
|
"git.openprivacy.ca/openprivacy/libricochet-go/log"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
"cwtch.im/cwtch/event"
|
"cwtch.im/cwtch/event"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"os"
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
"syscall"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
/* pipeBridge creates a pair of named pipes
|
/* pipeBridge creates a pair of named pipes
|
||||||
|
|
|
@ -189,11 +189,11 @@ func (cp *cwtchPeer) GetProfile() *model.Profile {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cp *cwtchPeer) GetPeerState(onion string) connections.ConnectionState {
|
func (cp *cwtchPeer) GetPeerState(onion string) connections.ConnectionState {
|
||||||
return connections.ConnectionStateType[cp.Profile.Contacts[onion].State]
|
return connections.ConnectionStateToType[cp.Profile.Contacts[onion].State]
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cp *cwtchPeer) GetGroupState(groupid string) connections.ConnectionState {
|
func (cp *cwtchPeer) GetGroupState(groupid string) connections.ConnectionState {
|
||||||
return connections.ConnectionStateType[cp.Profile.Groups[groupid].State]
|
return connections.ConnectionStateToType[cp.Profile.Groups[groupid].State]
|
||||||
}
|
}
|
||||||
|
|
||||||
// PeerWithOnion is the entry point for cwtchPeer relationships
|
// PeerWithOnion is the entry point for cwtchPeer relationships
|
||||||
|
|
|
@ -23,7 +23,7 @@ var (
|
||||||
// ConnectionStateName allows conversion of states to their string representations
|
// ConnectionStateName allows conversion of states to their string representations
|
||||||
ConnectionStateName = []string{"Disconnected", "Connecting", "Connected", "Authenticated", "Synced", "Failed", "Killed"}
|
ConnectionStateName = []string{"Disconnected", "Connecting", "Connected", "Authenticated", "Synced", "Failed", "Killed"}
|
||||||
|
|
||||||
// ConnectionStateType allows conversion of strings to their state type
|
// ConnectionStateToType allows conversion of strings to their state type
|
||||||
ConnectionStateType = map[string]ConnectionState{"Disconnected": DISCONNECTED, "Connecting": CONNECTING,
|
ConnectionStateToType = map[string]ConnectionState{"Disconnected": DISCONNECTED, "Connecting": CONNECTING,
|
||||||
"Connected": CONNECTED, "Authenticated": AUTHENTICATED, "Synced": SYNCED, "Failed": FAILED, "Killed": KILLED}
|
"Connected": CONNECTED, "Authenticated": AUTHENTICATED, "Synced": SYNCED, "Failed": FAILED, "Killed": KILLED}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue