Documentation ¶
Index ¶
- Variables
- func DeleteAttachment(id string) (err error)
- func GetAttachment(id string) (raw []byte, err error)
- func GetAttachments() (attachments []string, err error)
- func GetHealth() (resp string, err error)
- func GetLinkAccountQRCode(deviceName string) (link string, err error)
- func PostConfiguration(data Configuration) (err error)
- func PostSend(data SendMessageV2) (resp struct{ ... }, err error)
- type Account
- func (a *Account) DeleteGroup(groupID string) (err error)
- func (a *Account) DeleteGroupAdmins(groupID string, data struct{ ... }) (err error)
- func (a *Account) DeleteGroupMembers(groupID string, data struct{ ... }) (err error)
- func (a *Account) DeleteReaction(data struct{ ... }) (err error)
- func (a *Account) DeleteTypingIndicator(data struct{ ... }) (err error)
- func (a *Account) DeleteUsername() (err error)
- func (a *Account) GetConfiguration() (resp Account_Configuration, err error)
- func (a *Account) GetContacts() (contacts []Contact, err error)
- func (a *Account) GetGroup(groupID string) (group Group, err error)
- func (a *Account) GetGroups() (groups []Group, err error)
- func (a *Account) GetIdentities() (identities []Identity, err error)
- func (a *Account) GetMessages() (messages []MessageResponse, err error)
- func (a *Account) GetMessagesSocket(messages chan<- MessageResponse) (err error)
- func (a *Account) GetStickerPacks() (packs []StickerPack, err error)
- func (a *Account) PostBlockGroup(groupID string) (err error)
- func (a *Account) PostConfiguration(data Account_Configuration) (err error)
- func (a *Account) PostContact(data struct{ ... }) (contacts []Contact, err error)
- func (a *Account) PostCreateGroup(data struct{ ... }) (resp struct{ ... }, err error)
- func (a *Account) PostGroupAdmins(groupID string, data struct{ ... }) (err error)
- func (a *Account) PostGroupMembers(groupID string, data struct{ ... }) (err error)
- func (a *Account) PostJoinGroup(groupID string) (err error)
- func (a *Account) PostLinkDevice(data struct{ ... }) (err error)
- func (a *Account) PostProfile(data struct{ ... }) (err error)
- func (a *Account) PostQuitGroup(groupID string) (err error)
- func (a *Account) PostRateLimitChallenge(data struct{ ... }) (err error)
- func (a *Account) PostReaction(data struct{ ... }) (err error)
- func (a *Account) PostReceipt(data struct{ ... }) (err error)
- func (a *Account) PostRegister(captcha string, useVoice bool) error
- func (a *Account) PostRegisterVerify(token string, pin string) error
- func (a *Account) PostStickerPack(data struct{ ... }) (err error)
- func (a *Account) PostUnregistert(data struct{ ... }) (err error)
- func (a *Account) PostUsername(data struct{ ... }) (resp Account_PostUsernameResponse, err error)
- func (a *Account) PutContactsSync() (err error)
- func (a *Account) PutGroupSettings(groupID string, data struct{ ... }) (err error)
- func (a *Account) PutSettings(data struct{ ... }) (err error)
- func (a *Account) PutTrustIdentity(numberToTrust string, data struct{ ... }) (err error)
- func (a *Account) PutTypingIndicator(data struct{ ... }) (err error)
- type Account_Configuration
- type Account_PostUsernameResponse
- type Configuration
- type Contact
- type GetAboutResponse
- type Group
- type Identity
- type MessageResponse
- type SearchResult
- type SendMessageV2
- type SendMessageV2_MessageMention
- type StickerPack
Constants ¶
This section is empty.
Variables ¶
var API_URL = "http://127.0.0.1:8080"
Functions ¶
func GetHealth ¶
API Health Check.
Internally used by the docker container to perform the health check.
func GetLinkAccountQRCode ¶
Link device and generate QR code.
func PostConfiguration ¶
func PostConfiguration(data Configuration) (err error)
Set the REST API configuration.
func PostSend ¶
func PostSend(data SendMessageV2) (resp struct { Timestamp string `json:"timestamp"` }, err error)
Send a signal message.
Send a signal message. Set the text_mode to 'styled' in case you want to add formatting to your text message. Styling Options: *italic text*, **bold text**, ~strikethrough text~.
Types ¶
type Account ¶
type Account struct {
Number string
}
func (*Account) DeleteGroup ¶
Delete the specified Signal Group.
func (*Account) DeleteGroupAdmins ¶
func (a *Account) DeleteGroupAdmins(groupID string, data struct { Admins []string `json:"admins"` }) (err error)
Remove one or more admins from an existing Signal Group.
func (*Account) DeleteGroupMembers ¶
func (a *Account) DeleteGroupMembers(groupID string, data struct { Members []string `json:"members"` }) (err error)
Remove one or more members from an existing Signal Group.
func (*Account) DeleteReaction ¶
func (a *Account) DeleteReaction(data struct { Reaction string `json:"reaction"` Recipient string `json:"recipient"` TargetAuthor string `json:"target_author"` Timestamp int64 `json:"timestamp"` }) (err error)
Remove a reaction.
func (*Account) DeleteTypingIndicator ¶
func (a *Account) DeleteTypingIndicator(data struct { Recipient string `json:"recipient"` }) (err error)
Hide Typing Indicator.
func (*Account) DeleteUsername ¶
Remove a username.
Delete the username associated with this account.
func (*Account) GetConfiguration ¶
func (a *Account) GetConfiguration() (resp Account_Configuration, err error)
List account specific settings.
func (*Account) GetIdentities ¶
List all identities for the given number.
func (*Account) GetMessages ¶
func (a *Account) GetMessages() (messages []MessageResponse, err error)
Receive Signal Messages.
Only works if the signal api is running in `normal` or `native` mode. If you are running in `json-rpc` mode, use `GetMessagesSocket`.
func (*Account) GetMessagesSocket ¶ added in v0.1.0
func (a *Account) GetMessagesSocket(messages chan<- MessageResponse) (err error)
Opens a socket to receive Signal Messages and sends them to the `messages` channel.
Will only return if there is an error or the socket closes.
Only works if the signal api is running in `json-rpc` mode. If you are running in `normal` or `native` mode, use `GetMessages`.
func (*Account) GetStickerPacks ¶
func (a *Account) GetStickerPacks() (packs []StickerPack, err error)
List Installed Sticker Packs.
func (*Account) PostBlockGroup ¶
Block the specified Signal Group.
func (*Account) PostConfiguration ¶
func (a *Account) PostConfiguration(data Account_Configuration) (err error)
Set account specific settings.
func (*Account) PostContact ¶
func (a *Account) PostContact(data struct { ExpirationInSeconds int `json:"expiration_in_seconds"` Name string `json:"name"` Recipient string `json:"recipient"` }) (contacts []Contact, err error)
Updates the info associated to a number on the contact list. If the contact doesn’t exist yet, it will be added.
func (*Account) PostCreateGroup ¶
func (a *Account) PostCreateGroup(data struct { Description string `json:"description"` ExpirationTime int `json:"expiration_time"` GroupLink string `json:"group_link"` Members []string `json:"members"` Name string `json:"name"` Permissions struct { AddMembers string `json:"add_members"` EditGroup string `json:"edit_group"` } `json:"permissions"` }) (resp struct { ID string `json:"id"` }, err error)
Create a new Signal Group with the specified members.
func (*Account) PostGroupAdmins ¶
func (a *Account) PostGroupAdmins(groupID string, data struct { Admins []string `json:"admins"` }) (err error)
Add one or more admins to an existing Signal Group.
func (*Account) PostGroupMembers ¶
func (a *Account) PostGroupMembers(groupID string, data struct { Members []string `json:"members"` }) (err error)
Add one or more members to an existing Signal Group.
func (*Account) PostJoinGroup ¶
Join the specified Signal Group.
func (*Account) PostLinkDevice ¶
Links another device to this device. Only works, if this is the master device.
func (*Account) PostProfile ¶
func (a *Account) PostProfile(data struct { About string `json:"about"` Base64Avatar string `json:"base64_avatar"` Name string `json:"name"` }) (err error)
Update Profile.
Set your name and optional an avatar.
func (*Account) PostQuitGroup ¶
Quit the specified Signal Group.
func (*Account) PostRateLimitChallenge ¶
func (a *Account) PostRateLimitChallenge(data struct { Captcha string `json:"captcha"` ChallengeToken string `json:"challenge_token"` }) (err error)
Lift rate limit restrictions by solving a captcha.
When running into rate limits, sometimes the limit can be lifted, by solving a CAPTCHA. To get the captcha token, go to https://signalcaptchas.org/challenge/generate.html For the staging environment, use: https://signalcaptchas.org/staging/registration/generate.html. The \"challenge_token\" is the token from the failed send attempt. The \"captcha\" is the captcha result, starting with signalcaptcha://.
func (*Account) PostReaction ¶
func (a *Account) PostReaction(data struct { Reaction string `json:"reaction"` Recipient string `json:"recipient"` TargetAuthor string `json:"target_author"` Timestamp int64 `json:"timestamp"` }) (err error)
Send a reaction.
React to a message.
func (*Account) PostReceipt ¶
func (a *Account) PostReceipt(data struct { ReceiptType string `json:"receipt_type"` Recipient string `json:"recipient"` Timestamp int64 `json:"timestamp"` }) (err error)
Send a receipt.
Send a read or viewed receipt.
func (*Account) PostRegister ¶
Register a phone number.
Register a phone number with the signal network.
func (*Account) PostRegisterVerify ¶
Verify a registered phone number.
Verify a registered phone number with the signal network.
func (*Account) PostStickerPack ¶
func (a *Account) PostStickerPack(data struct { PackID string `json:"pack_id"` PackKey string `json:"pack_key"` }) (err error)
Add Sticker Pack.
In order to add a sticker pack, browse to https://signalstickers.org/ and select the sticker pack you want to add. Then, press the \"Add to Signal\" button. If you look at the address bar in your browser you should see an URL in this format: https://signal.art/addstickers/#pack_id=XXX\u0026pack_key=YYY, where XXX is the pack_id and YYY is the pack_key.
func (*Account) PostUnregistert ¶
func (a *Account) PostUnregistert(data struct { DeleteAccount bool `json:"delete_account"` DeleteLocalData bool `json:"delete_local_data"` }) (err error)
Unregister a phone number.
Disables push support for this device. **WARNING:** If *delete_account* is set to *true*, the account will be deleted from the Signal Server. This cannot be undone without loss.
func (*Account) PostUsername ¶
func (a *Account) PostUsername(data struct { Username string `json:"username"` }) (resp Account_PostUsernameResponse, err error)
Set a username.
Allows to set the username that should be used for this account. This can either be just the nickname (e.g. test) or the complete username with discriminator (e.g. test.123). Returns the new username with discriminator and the username link.
func (*Account) PutContactsSync ¶
Send a synchronization message with the local contacts list to all linked devices. This command should only be used if this is the primary device.
func (*Account) PutGroupSettings ¶
func (a *Account) PutGroupSettings(groupID string, data struct { Base64Avatar string `json:"base64_avatar"` Description string `json:"description"` Name string `json:"name"` }) (err error)
Update the state of a Signal Group.
func (*Account) PutSettings ¶
func (a *Account) PutSettings(data struct { DiscoverableByNumber bool `json:"discoverable_by_number"` ShareNumber bool `json:"share_number"` }) (err error)
Update the account settings.
Update the account attributes on the signal server.
func (*Account) PutTrustIdentity ¶
func (a *Account) PutTrustIdentity(numberToTrust string, data struct { TrustAllKnownKeys bool `json:"trust_all_known_keys"` VerifiedSafetyNumber string `json:"verified_safety_number"` }) (err error)
Trust an identity. When 'trust_all_known_keys' is set to 'true', all known keys of this user are trusted. **This is only recommended for testing.**
func (*Account) PutTypingIndicator ¶
func (a *Account) PutTypingIndicator(data struct { Recipient string `json:"recipient"` }) (err error)
Show Typing Indicator.
type Account_Configuration ¶
type Account_Configuration struct {
TrustMode string `json:"trust_mode"`
}
type Configuration ¶
type Configuration struct { Logging struct { Level string `json:"Level"` } `json:"logging"` }
func GetConfiguration ¶
func GetConfiguration() (resp Configuration, err error)
List the REST API configuration.
type GetAboutResponse ¶
type GetAboutResponse struct { Build int `json:"build"` Capabilities map[string][]string `json:"capabilities"` Mode string `json:"mode"` Version string `json:"version"` Versions []string `json:"versions"` }
func GetAbout ¶
func GetAbout() (resp GetAboutResponse, err error)
List all accounts.
Lists all of the accounts linked or registered.
type Group ¶
type Group struct { Admins []string `json:"admins"` Blocked bool `json:"blocked"` ID string `json:"id"` InternalID string `json:"internal_id"` InviteLink string `json:"invite_link"` Members []string `json:"members"` Name string `json:"name"` PendingInvites []string `json:"pending_invites"` PendingRequests []string `json:"pending_requests"` }
type MessageResponse ¶ added in v0.1.0
type MessageResponse struct { Envelope signaltypes.MessageEnvelope `json:"envelope"` Account string `json:"account"` }
type SearchResult ¶
func GetSearch ¶
func GetSearch(numbers []string) (results []SearchResult, err error)
Check if one or more phone numbers are registered with the Signal Service.
type SendMessageV2 ¶
type SendMessageV2 struct { Number string `json:"number"` Recipients []string `json:"recipients"` Message string `json:"message"` Base64Attachments []string `` /* 181-byte string literal not displayed */ Sticker string `json:"sticker"` Mentions []SendMessageV2_MessageMention `json:"mentions"` QuoteTimestamp *int64 `json:"quote_timestamp"` QuoteAuthor *string `json:"quote_author"` QuoteMessage *string `json:"quote_message"` QuoteMentions []SendMessageV2_MessageMention `json:"quote_mentions"` TextMode *string `json:"text_mode" enums:"normal,styled"` EditTimestamp *int64 `json:"edit_timestamp"` NotifySelf *bool `json:"notify_self"` }