Documentation
¶
Overview ¶
Package serviceclient defines official Signal service client contracts used by deterministic test doubles and future policy-gated live transports.
Index ¶
- Constants
- Variables
- type Client
- type DownloadBackupRequest
- type DownloadBackupResponse
- type LinkDeviceRequest
- type LinkDeviceResponse
- type ReceiveRequest
- type ReceiveResponse
- type RegisterRequest
- type RegisterResponse
- type RequestMetadata
- type ReserveUsernameRequest
- type ReserveUsernameResponse
- type RespondToChallengeRequest
- type RespondToChallengeResponse
- type ResponseMetadata
- type SendRequest
- type SendResponse
- type Transport
- type TransportConfig
- type TransportMode
- type UploadBackupRequest
- type UploadBackupResponse
Constants ¶
View Source
const UsernameHashSize = 32
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
Register(context.Context, RegisterRequest) (RegisterResponse, error)
LinkDevice(context.Context, LinkDeviceRequest) (LinkDeviceResponse, error)
Send(context.Context, SendRequest) (SendResponse, error)
Receive(context.Context, ReceiveRequest) (ReceiveResponse, error)
ReserveUsername(context.Context, ReserveUsernameRequest) (ReserveUsernameResponse, error)
UploadBackup(context.Context, UploadBackupRequest) (UploadBackupResponse, error)
DownloadBackup(context.Context, DownloadBackupRequest) (DownloadBackupResponse, error)
RespondToChallenge(context.Context, RespondToChallengeRequest) (RespondToChallengeResponse, error)
}
type DownloadBackupRequest ¶
type DownloadBackupRequest struct {
Metadata RequestMetadata
BackupID string
}
type DownloadBackupResponse ¶
type DownloadBackupResponse struct {
Metadata ResponseMetadata
}
func (DownloadBackupResponse) Common ¶
func (r DownloadBackupResponse) Common() ResponseMetadata
type LinkDeviceRequest ¶
type LinkDeviceRequest struct {
Metadata RequestMetadata
LinkCodeRef string
}
type LinkDeviceResponse ¶
type LinkDeviceResponse struct {
Metadata ResponseMetadata
}
func (LinkDeviceResponse) Common ¶
func (r LinkDeviceResponse) Common() ResponseMetadata
type ReceiveRequest ¶
type ReceiveRequest struct {
Metadata RequestMetadata
CursorRef string
}
type ReceiveResponse ¶
type ReceiveResponse struct {
Metadata ResponseMetadata
}
func (ReceiveResponse) Common ¶
func (r ReceiveResponse) Common() ResponseMetadata
type RegisterRequest ¶
type RegisterRequest struct {
Metadata RequestMetadata
Username string
}
type RegisterResponse ¶
type RegisterResponse struct {
Metadata ResponseMetadata
}
func (RegisterResponse) Common ¶
func (r RegisterResponse) Common() ResponseMetadata
type RequestMetadata ¶
type ReserveUsernameRequest ¶
type ReserveUsernameRequest struct {
Metadata RequestMetadata
// Username is kept for legacy fake-only callers. New username reservation
// flows should pass UsernameHashes or UsernameHashHexes.
Username string
UsernameHashes [][]byte
UsernameHashHexes []string
SelectedUsernameHashIndex int
}
func (ReserveUsernameRequest) NormalizedUsernameHashes ¶ added in v0.7.0
func (r ReserveUsernameRequest) NormalizedUsernameHashes() ([][]byte, error)
type ReserveUsernameResponse ¶
type ReserveUsernameResponse struct {
Metadata ResponseMetadata
ReservedUsernameHash []byte
ReservedUsernameHashHex string
UsernameHashCount int
}
func (ReserveUsernameResponse) Common ¶
func (r ReserveUsernameResponse) Common() ResponseMetadata
type RespondToChallengeRequest ¶
type RespondToChallengeRequest struct {
Metadata RequestMetadata
ChallengeRef string
ResponseRef string
}
type RespondToChallengeResponse ¶
type RespondToChallengeResponse struct {
Metadata ResponseMetadata
}
func (RespondToChallengeResponse) Common ¶
func (r RespondToChallengeResponse) Common() ResponseMetadata
type ResponseMetadata ¶
type SendRequest ¶
type SendRequest struct {
Metadata RequestMetadata
RecipientRef string
PayloadRef string
}
type SendResponse ¶
type SendResponse struct {
Metadata ResponseMetadata
}
func (SendResponse) Common ¶
func (r SendResponse) Common() ResponseMetadata
type Transport ¶ added in v0.4.0
type Transport struct {
Client
// contains filtered or unexported fields
}
func NewTransport ¶ added in v0.4.0
func NewTransport(client Client, cfg TransportConfig) (*Transport, error)
func (*Transport) Mode ¶ added in v0.4.0
func (t *Transport) Mode() TransportMode
type TransportConfig ¶ added in v0.4.0
type TransportConfig struct {
Mode TransportMode
SandboxEndpoint string
ApprovalPackage servicepolicy.ApprovalPackage
ApprovalTime time.Time
RequestedActions []servicepolicy.Action
}
type TransportMode ¶ added in v0.4.0
type TransportMode string
const ( TransportModeFake TransportMode = "fake" TransportModeSandbox TransportMode = "sandbox" TransportModeLive TransportMode = "live" )
type UploadBackupRequest ¶
type UploadBackupRequest struct {
Metadata RequestMetadata
BackupRef string
}
type UploadBackupResponse ¶
type UploadBackupResponse struct {
Metadata ResponseMetadata
}
func (UploadBackupResponse) Common ¶
func (r UploadBackupResponse) Common() ResponseMetadata
Click to show internal directories.
Click to hide internal directories.