fake

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingIdempotencyKey = errors.New("missing idempotency key")
	ErrIdempotencyConflict   = errors.New("idempotency key reused with different request")
)

Functions

This section is empty.

Types

type Adapter added in v0.5.0

type Adapter struct {
	// contains filtered or unexported fields
}

func NewAdapter added in v0.5.0

func NewAdapter() *Adapter

func (*Adapter) Records added in v0.5.0

func (a *Adapter) Records() []AdapterRecord

func (*Adapter) SubmitOperation added in v0.5.0

type AdapterRecord added in v0.5.0

type AdapterRecord struct {
	Operation      service.Operation
	OperationID    string
	IdempotencyKey string
	Audit          service.AuditMetadata
}

type LedgerRecord added in v0.3.0

type LedgerRecord struct {
	Operation   string
	Fingerprint string
	Response    serviceclient.ResponseMetadata
}

type Remote

type Remote struct {
	UsernameHashResponse        *accountpb.LookupUsernameHashResponse
	UsernameLinkResponse        *accountpb.LookupUsernameLinkResponse
	ReserveUsernameHashResponse *accountpb.ReserveUsernameHashResponse
	ConfirmUsernameHashResponse *accountpb.ConfirmUsernameHashResponse
	DeleteUsernameHashResponse  *accountpb.DeleteUsernameHashResponse
	SetUsernameLinkResponse     *accountpb.SetUsernameLinkResponse
	DeleteUsernameLinkResponse  *accountpb.DeleteUsernameLinkResponse
	DevicesResponse             *devicepb.GetDevicesResponse
	PreKeysResponse             *keyspb.GetPreKeysAnonymousResponse
	MessageResponse             *messagespb.SendMessageAuthenticatedSenderResponse
	ProfileResponse             *profilepb.GetVersionedProfileAnonymousResponse
	SetBackupIDResponse         *backuppb.SetBackupIdResponse
	BackupAuthCredentials       *backuppb.GetBackupAuthCredentialsResponse
	CdnCredentials              *backuppb.GetCdnCredentialsResponse
	SvrBCredentials             *backuppb.GetSvrBCredentialsResponse
	MessageBackupInfo           *backuppb.GetMessageBackupInfoResponse
	MediaBackupInfo             *backuppb.GetMediaBackupInfoResponse
	ChallengeResponse           *challengepb.AnswerChallengeResponse
	ExternalCredentialResponse  *credentialspb.GetExternalServiceCredentialsResponse
	// contains filtered or unexported fields
}

func NewRemote

func NewRemote() *Remote

func (*Remote) ConfirmUsernameHash added in v0.6.0

func (*Remote) DeleteUsernameHash added in v0.6.0

func (*Remote) GetCdnCredentials added in v0.6.0

func (*Remote) GetDevices

func (*Remote) GetMediaBackupInfo added in v0.6.0

func (*Remote) GetMessageBackupInfo added in v0.6.0

func (*Remote) GetSvrBCredentials added in v0.6.0

func (*Remote) Records

func (r *Remote) Records() []RequestRecord

func (*Remote) ReserveUsernameHash added in v0.6.0

func (*Remote) SetBackupId added in v0.6.0

type RequestRecord

type RequestRecord struct {
	Operation      string
	RequestType    string
	RequestBytes   int
	RedactedFields []string
}

type ServiceClient added in v0.3.0

type ServiceClient struct {
	// contains filtered or unexported fields
}

func NewServiceClient added in v0.3.0

func NewServiceClient(opts ...ServiceClientOption) *ServiceClient

func (*ServiceClient) DownloadBackup added in v0.3.0

func (*ServiceClient) Ledger added in v0.3.0

func (c *ServiceClient) Ledger() map[string]LedgerRecord

func (*ServiceClient) LinkDevice added in v0.3.0

func (*ServiceClient) Receive added in v0.3.0

func (*ServiceClient) Records added in v0.3.0

func (c *ServiceClient) Records() []ServiceClientRecord

func (*ServiceClient) Register added in v0.3.0

func (*ServiceClient) ReserveUsername added in v0.3.0

func (*ServiceClient) RespondToChallenge added in v0.3.0

func (*ServiceClient) Send added in v0.3.0

func (*ServiceClient) UploadBackup added in v0.3.0

type ServiceClientOption added in v0.3.0

type ServiceClientOption func(*ServiceClient)

func WithChallenge added in v0.3.0

func WithChallenge(operation, challengeRef string) ServiceClientOption

func WithExpiredCredentials added in v0.3.0

func WithExpiredCredentials() ServiceClientOption

func WithLedger added in v0.3.0

func WithLedger(ledger map[string]LedgerRecord) ServiceClientOption

type ServiceClientRecord added in v0.3.0

type ServiceClientRecord struct {
	Operation               string
	IdempotencyKey          string
	RequestID               string
	Status                  string
	UsernameHashCount       int
	ReservedUsernameHashHex string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL