Documentation ¶
Index ¶
- func Run()
- type ACKMessage
- type Conn
- type CrayfishInstance
- func (c *CrayfishInstance) CrayfishRegister(registrationInfo *registration.RegistrationInfo, phoneNumber string, ...) error
- func (c *CrayfishInstance) CrayfishRegisterWithCode(registrationInfo *registration.RegistrationInfo, phoneNumber string, ...) (*CrayfishRegistration, error)
- func (c *CrayfishInstance) DecryptAvatar(avatar, key []byte) ([]byte, error)
- func (c *CrayfishInstance) HandleEnvelope(msg []byte) (*CrayfishWebSocketResponse_HANDLE_ENVELOPE_MESSAGE, error)
- func (c *CrayfishInstance) HandleUnidentifiedSenderMessage(msg []byte) error
- func (c *CrayfishInstance) StartListening() error
- func (c *CrayfishInstance) StartWebsocket() error
- func (c *CrayfishInstance) Stop() error
- func (c *CrayfishInstance) StopListening() error
- type CrayfishRegistration
- type CrayfishWebSocketMessage
- type CrayfishWebSocketMessageType
- type CrayfishWebSocketRequestMessage
- type CrayfishWebSocketRequestMessageTyp_SEALED_SESSION_DECRYPT_Message
- type CrayfishWebSocketRequestMessageType
- type CrayfishWebSocketRequest_AVATAR_MESSAGE
- type CrayfishWebSocketRequest_HANDLE_ENVELOPE_MESSAGE
- type CrayfishWebSocketRequest_REGISTER_MESSAGE
- type CrayfishWebSocketRequest_VERIFY_REGISTER_MESSAGE
- type CrayfishWebSocketResponseMessage
- type CrayfishWebSocketResponseMessageType
- type CrayfishWebSocketResponse_AVATAR_MESSAGE
- type CrayfishWebSocketResponse_HANDLE_ENVELOPE_MESSAGE
- type CrayfishWebSocketResponse_VERIFY_REGISTER_MESSAGE
- type PhoneNumber
- type PhoneNumberCode
- type PhoneNumberNational
- type Sender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ACKMessage ¶
type ACKMessage struct {
Status string `json:"status"`
}
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is a wrapper for the websocket connection
type CrayfishInstance ¶
type CrayfishInstance struct { LocalUUID string LocalDeviceID int32 // contains filtered or unexported fields }
var ( Instance *CrayfishInstance // ErrNotListening is returned when trying to stop listening when there's no // valid listening connection set up ErrNotListening = errors.New("[textsecure-crayfish-ws] there is no listening connection to stop") )
func (*CrayfishInstance) CrayfishRegister ¶
func (c *CrayfishInstance) CrayfishRegister(registrationInfo *registration.RegistrationInfo, phoneNumber string, captcha string) error
func (*CrayfishInstance) CrayfishRegisterWithCode ¶
func (c *CrayfishInstance) CrayfishRegisterWithCode(registrationInfo *registration.RegistrationInfo, phoneNumber string, captcha string, code string) (*CrayfishRegistration, error)
func (*CrayfishInstance) DecryptAvatar ¶
func (c *CrayfishInstance) DecryptAvatar(avatar, key []byte) ([]byte, error)
func (*CrayfishInstance) HandleEnvelope ¶
func (c *CrayfishInstance) HandleEnvelope(msg []byte) (*CrayfishWebSocketResponse_HANDLE_ENVELOPE_MESSAGE, error)
func (*CrayfishInstance) HandleUnidentifiedSenderMessage ¶
func (c *CrayfishInstance) HandleUnidentifiedSenderMessage(msg []byte) error
func (*CrayfishInstance) StartListening ¶
func (c *CrayfishInstance) StartListening() error
func (*CrayfishInstance) StartWebsocket ¶
func (c *CrayfishInstance) StartWebsocket() error
BackendStartWebsocket connects to the server and handles incoming websocket messages.
func (*CrayfishInstance) Stop ¶
func (c *CrayfishInstance) Stop() error
func (*CrayfishInstance) StopListening ¶
func (c *CrayfishInstance) StopListening() error
StopListening disables the receiving of messages.
type CrayfishRegistration ¶
type CrayfishWebSocketMessage ¶
type CrayfishWebSocketMessage struct { Type *CrayfishWebSocketMessageType `json:"type,omitempty"` Request *CrayfishWebSocketRequestMessage `json:"request,omitempty"` Response *CrayfishWebSocketResponseMessage `json:"response,omitempty"` }
type CrayfishWebSocketMessageType ¶
type CrayfishWebSocketMessageType int32
const ( CrayfishWebSocketMessage_UNKNOWN CrayfishWebSocketMessageType = 0 CrayfishWebSocketMessage_REQUEST CrayfishWebSocketMessageType = 1 CrayfishWebSocketMessage_RESPONSE CrayfishWebSocketMessageType = 2 )
the crayfish websocket message types
type CrayfishWebSocketRequestMessage ¶
type CrayfishWebSocketRequestMessage struct { Type *CrayfishWebSocketRequestMessageType `json:"type,omitempty"` Message interface{} `json:"message,omitempty"` }
type CrayfishWebSocketRequestMessageTyp_SEALED_SESSION_DECRYPT_Message ¶
type CrayfishWebSocketRequestMessageTyp_SEALED_SESSION_DECRYPT_Message struct { }
type CrayfishWebSocketRequestMessageType ¶
type CrayfishWebSocketRequestMessageType int32
const ( CrayfishWebSocketRequestMessageTyp_UNKNOWN CrayfishWebSocketRequestMessageType = 0 CrayfishWebSocketRequestMessageTyp_START_REGISTRATION CrayfishWebSocketRequestMessageType = 1 CrayfishWebSocketRequestMessageTyp_VERIFY_REGISTRATION CrayfishWebSocketRequestMessageType = 2 CrayfishWebSocketRequestMessageTyp_HANDLE_ENVELOPE CrayfishWebSocketRequestMessageType = 3 CrayfishWebSocketRequestMessageTyp_DECRYPT_AVATAR CrayfishWebSocketRequestMessageType = 4 )
the crayfish request types
type CrayfishWebSocketResponseMessage ¶
type CrayfishWebSocketResponseMessage struct { Type *CrayfishWebSocketResponseMessageType `json:"type,omitempty"` Message interface{} `json:"message,omitempty"` }
type CrayfishWebSocketResponseMessageType ¶
type CrayfishWebSocketResponseMessageType int32
const ( CrayfishWebSocketResponseMessageTyp_UNKNOWN CrayfishWebSocketResponseMessageType = 0 CrayfishWebSocketResponseMessageTyp_ACK CrayfishWebSocketResponseMessageType = 1 CrayfishWebSocketResponseMessageTyp_VERIFY_REGISTRATION CrayfishWebSocketResponseMessageType = 2 CrayfishWebSocketResponseMessageTyp_HANDLE_ENVELOPE CrayfishWebSocketResponseMessageType = 3 CrayfishWebSocketResponseMessageTyp_DECRYPT_AVATAR CrayfishWebSocketResponseMessageType = 3 )
type CrayfishWebSocketResponse_AVATAR_MESSAGE ¶
type CrayfishWebSocketResponse_AVATAR_MESSAGE struct {
Avatar string `json:"avatar"`
}
type PhoneNumber ¶
type PhoneNumber struct { Code PhoneNumberCode `json:"code"` National PhoneNumberNational `json:"national,string,omitempty"` }
type PhoneNumberCode ¶
type PhoneNumberNational ¶
type Sender ¶
type Sender struct { UUID string `json:"uuid"` PhoneNumber PhoneNumber `json:"phonenumber"` }
Click to show internal directories.
Click to hide internal directories.