implemented trust mode

* implemented possibility to set the trust mode globally

see #240
This commit is contained in:
Bernhard B
2022-05-06 19:28:23 +02:00
parent a6927896ef
commit 25775a4c10
8 changed files with 348 additions and 122 deletions

View File

@@ -4,10 +4,12 @@ import (
"bufio"
"encoding/json"
"errors"
uuid "github.com/gofrs/uuid"
log "github.com/sirupsen/logrus"
"net"
"time"
"github.com/bbernhard/signal-cli-rest-api/utils"
uuid "github.com/gofrs/uuid"
log "github.com/sirupsen/logrus"
)
type Error struct {
@@ -32,10 +34,13 @@ type JsonRpc2Client struct {
receivedMessageResponses chan JsonRpc2MessageResponse
receivedMessages chan JsonRpc2ReceivedMessage
lastTimeErrorMessageSent time.Time
signalCliApiConfig *utils.SignalCliApiConfig
}
func NewJsonRpc2Client() *JsonRpc2Client {
return &JsonRpc2Client{}
func NewJsonRpc2Client(signalCliApiConfig *utils.SignalCliApiConfig) *JsonRpc2Client {
return &JsonRpc2Client{
signalCliApiConfig: signalCliApiConfig,
}
}
func (r *JsonRpc2Client) Dial(address string) error {