Documentation ¶
Index ¶
- func GetAuthHeaders(sapisid string) map[string]string
- type Client
- func (c *Client) APIRequest(endpointURL, responseType string, headers map[string]string, payload []byte) ([]byte, error)
- func (c *Client) AddUser(inviteesGaiaIds []string, conversationID string) (*hangouts.AddUserResponse, error)
- func (c *Client) Create1On1Conversation(id string) (*hangouts.Conversation, error)
- func (c *Client) CreateConversation(inviteesGaiaIds []string, name string, oneOnOne bool) (*hangouts.CreateConversationResponse, error)
- func (c *Client) DeleteConversation(conversationID string, deleteUpperBoundTimestamp uint64) (*hangouts.DeleteConversationResponse, error)
- func (c *Client) EasterEgg(conversationID string, message string) (*hangouts.EasterEggResponse, error)
- func (c *Client) GetConversation(conversationID string, includeEvent bool, maxEventsPerConversation uint64) (*hangouts.GetConversationResponse, error)
- func (c *Client) GetEntities(id string) (*hangouts.Entity, error)
- func (c *Client) GetEntityByID(Ids []string) (*hangouts.GetEntityByIdResponse, error)
- func (c *Client) GetGroupConversationURL(conversationID string) (string, error)
- func (c *Client) GetSelfInfo() (*hangouts.GetSelfInfoResponse, error)
- func (c *Client) GetSuggestedEntities(maxCount uint64) (*hangouts.GetSuggestedEntitiesResponse, error)
- func (c *Client) ModifyOTRStatus(conversationID string, otrStatus hangouts.OffTheRecordStatus) (*hangouts.ModifyOTRStatusResponse, error)
- func (c *Client) NewEventRequestHeaders(conversationID string, offTheRecord bool, ...) *hangouts.EventRequestHeader
- func (c *Client) NewRequestHeaders() *hangouts.RequestHeader
- func (c *Client) ProtobufAPIRequest(apiEndpoint string, requestStruct, responseStruct proto.Message) error
- func (c *Client) QueryPresence(gaiaID string) (*hangouts.QueryPresenceResponse, error)
- func (c *Client) RemoveUser(conversationID string) (*hangouts.RemoveUserResponse, error)
- func (c *Client) RenameConversation(conversationID, newName string) (*hangouts.RenameConversationResponse, error)
- func (c *Client) SearchEntities(query string, maxCount uint64) (*hangouts.SearchEntitiesResponse, error)
- func (c *Client) SendChatImage(conversationID, imageID string) (*hangouts.SendChatMessageResponse, error)
- func (c *Client) SendChatMessage(conversationID, message string) (*hangouts.SendChatMessageResponse, error)
- func (c *Client) SendImage(to, image string) error
- func (c *Client) SendMessage(to, content string) error
- func (c *Client) SendOffNetworkInvitation(email string) (*hangouts.SendOffnetworkInvitationResponse, error)
- func (c *Client) SendPhotoID(to, photoID string) error
- func (c *Client) SetActiveClient(email string, isActive bool, timeoutSecs uint64) (*hangouts.SetActiveClientResponse, error)
- func (c *Client) SetConversationNotificationLevel(conversationID string, setQuiet bool) (*hangouts.SetConversationNotificationLevelResponse, error)
- func (c *Client) SetFocus(conversationID string, unfocus bool, timeoutSecs uint32) (*hangouts.SetFocusResponse, error)
- func (c *Client) SetGroupLinkSharingEnabled(conversationID string, status hangouts.GroupLinkSharingStatus) (*hangouts.SetGroupLinkSharingEnabledResponse, error)
- func (c *Client) SetPresence(presenceState int32, timeoutSecs uint64) (*hangouts.SetPresenceResponse, error)
- func (c *Client) SetTyping(conversationID string, typingState int32) (*hangouts.SetTypingResponse, error)
- func (c *Client) SyncAllNewEvents(lastSyncTimestamp, maxResponseSizeBytes uint64) (*hangouts.SyncAllNewEventsResponse, error)
- func (c *Client) SyncRecentConversations(maxConversations, maxEventsPerConversation uint64) (*hangouts.SyncRecentConversationsResponse, error)
- func (c *Client) UpdateWatermark(conversationID string, lastReadTimestamp uint64) (*hangouts.UpdateWatermarkResponse, error)
- func (c *Client) UploadImage(image string) (*Photo, error)
- type Photo
- type Session
- type UploadFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAuthHeaders ¶
GetAuthHeaders returns authentication header
Types ¶
type Client ¶
Client is a hangouts client
func (*Client) APIRequest ¶
func (c *Client) APIRequest(endpointURL, responseType string, headers map[string]string, payload []byte) ([]byte, error)
APIRequest performs an API Request
func (*Client) AddUser ¶
func (c *Client) AddUser(inviteesGaiaIds []string, conversationID string) (*hangouts.AddUserResponse, error)
AddUser Invite users to join an existing group conversation.
func (*Client) Create1On1Conversation ¶
func (c *Client) Create1On1Conversation(id string) (*hangouts.Conversation, error)
Create1On1Conversation create an 1 on 1 private conversation
func (*Client) CreateConversation ¶
func (c *Client) CreateConversation(inviteesGaiaIds []string, name string, oneOnOne bool) (*hangouts.CreateConversationResponse, error)
CreateConversation Create a new conversation.
func (*Client) DeleteConversation ¶
func (c *Client) DeleteConversation(conversationID string, deleteUpperBoundTimestamp uint64) (*hangouts.DeleteConversationResponse, error)
DeleteConversation Leave a one-to-one conversation. One-to-one conversations are "sticky"; they can't actually be deleted. This API clears the event history of the specified conversation up to delete_upper_bound_timestamp, hiding it if no events remain.
func (*Client) EasterEgg ¶
func (c *Client) EasterEgg(conversationID string, message string) (*hangouts.EasterEggResponse, error)
EasterEgg send an easter egg event to a conversation.
func (*Client) GetConversation ¶
func (c *Client) GetConversation(conversationID string, includeEvent bool, maxEventsPerConversation uint64) (*hangouts.GetConversationResponse, error)
GetConversation return conversation info and recent events.
func (*Client) GetEntities ¶
GetEntities returns entities of a specific id
func (*Client) GetEntityByID ¶
func (c *Client) GetEntityByID(Ids []string) (*hangouts.GetEntityByIdResponse, error)
GetEntityByID return info about a list of users.
func (*Client) GetGroupConversationURL ¶
GetGroupConversationURL get the group conversation join URL
func (*Client) GetSelfInfo ¶
func (c *Client) GetSelfInfo() (*hangouts.GetSelfInfoResponse, error)
GetSelfInfo return info about the current user.
func (*Client) GetSuggestedEntities ¶
func (c *Client) GetSuggestedEntities(maxCount uint64) (*hangouts.GetSuggestedEntitiesResponse, error)
GetSuggestedEntities return suggested contacts
func (*Client) ModifyOTRStatus ¶
func (c *Client) ModifyOTRStatus(conversationID string, otrStatus hangouts.OffTheRecordStatus) (*hangouts.ModifyOTRStatusResponse, error)
ModifyOTRStatus modify the otrstatus of current conversation
func (*Client) NewEventRequestHeaders ¶
func (c *Client) NewEventRequestHeaders(conversationID string, offTheRecord bool, deliveryMedium hangouts.DeliveryMediumType) *hangouts.EventRequestHeader
NewEventRequestHeaders creates basic event request header
func (*Client) NewRequestHeaders ¶
func (c *Client) NewRequestHeaders() *hangouts.RequestHeader
NewRequestHeaders creates basic request header
func (*Client) ProtobufAPIRequest ¶
func (c *Client) ProtobufAPIRequest(apiEndpoint string, requestStruct, responseStruct proto.Message) error
ProtobufAPIRequest do a protobuf API request
func (*Client) QueryPresence ¶
func (c *Client) QueryPresence(gaiaID string) (*hangouts.QueryPresenceResponse, error)
QueryPresence return presence status for a list of users. doesnt support passing an array of gaiaIds. fails with: {"status":4,"error_description":"Duplicate ParticipantIds in request"}
func (*Client) RemoveUser ¶
func (c *Client) RemoveUser(conversationID string) (*hangouts.RemoveUserResponse, error)
RemoveUser leave a group conversation.
func (*Client) RenameConversation ¶
func (c *Client) RenameConversation(conversationID, newName string) (*hangouts.RenameConversationResponse, error)
RenameConversation rename a conversation. Both group and one-to-one conversations may be renamed, but the official Hangouts clients have mixed support for one-to-one conversations with custom names.
func (*Client) SearchEntities ¶
func (c *Client) SearchEntities(query string, maxCount uint64) (*hangouts.SearchEntitiesResponse, error)
SearchEntities return info for users based on a query.
func (*Client) SendChatImage ¶
func (c *Client) SendChatImage(conversationID, imageID string) (*hangouts.SendChatMessageResponse, error)
SendChatImage send a image to a conversation, keep this for backward compatibility Deprecated: SendChatImage is deprecated since it has some hardcoded parameters, use SendMessage instead
func (*Client) SendChatMessage ¶
func (c *Client) SendChatMessage(conversationID, message string) (*hangouts.SendChatMessageResponse, error)
SendChatMessage send a chat message to a conversation, keep this for backward compatibility Deprecated: SendChatMessage is deprecated since it has some hardcoded parameters, use SendMessage instead
func (*Client) SendImage ¶
SendImage send image to a user or group to can be phoneNumber, email chatID/GaiaID or conversation ID image can be a file path or base64 encoded image
func (*Client) SendMessage ¶
SendMessage sends a message to a user/group to can be phoneNumber, email chatID/GaiaID or conversation ID
func (*Client) SendOffNetworkInvitation ¶
func (c *Client) SendOffNetworkInvitation(email string) (*hangouts.SendOffnetworkInvitationResponse, error)
SendOffNetworkInvitation send an invitation to a non-contact.
func (*Client) SendPhotoID ¶
SendPhotoID send image to a user or group to can be phoneNumber, email chatID/GaiaID or conversation ID photoID is a photo id from hangouts message
func (*Client) SetActiveClient ¶
func (c *Client) SetActiveClient(email string, isActive bool, timeoutSecs uint64) (*hangouts.SetActiveClientResponse, error)
SetActiveClient set the active client. timeout is 120 secs in hangups
func (*Client) SetConversationNotificationLevel ¶
func (c *Client) SetConversationNotificationLevel(conversationID string, setQuiet bool) (*hangouts.SetConversationNotificationLevelResponse, error)
SetConversationNotificationLevel set the notification level of a conversation.
func (*Client) SetFocus ¶
func (c *Client) SetFocus(conversationID string, unfocus bool, timeoutSecs uint32) (*hangouts.SetFocusResponse, error)
SetFocus set focus to a conversation.
func (*Client) SetGroupLinkSharingEnabled ¶
func (c *Client) SetGroupLinkSharingEnabled(conversationID string, status hangouts.GroupLinkSharingStatus) (*hangouts.SetGroupLinkSharingEnabledResponse, error)
SetGroupLinkSharingEnabled enable/disable group link sharing
func (*Client) SetPresence ¶
func (c *Client) SetPresence(presenceState int32, timeoutSecs uint64) (*hangouts.SetPresenceResponse, error)
SetPresence set the presence status. presenceState: 1=NONE 30=IDLE 40=ACTIVE
func (*Client) SetTyping ¶
func (c *Client) SetTyping(conversationID string, typingState int32) (*hangouts.SetTypingResponse, error)
SetTyping set the typing status of a conversation. typingState: 1=Started 2=Paused 3=Stopped
func (*Client) SyncAllNewEvents ¶
func (c *Client) SyncAllNewEvents(lastSyncTimestamp, maxResponseSizeBytes uint64) (*hangouts.SyncAllNewEventsResponse, error)
SyncAllNewEvents list all events occurring at or after a timestamp.
func (*Client) SyncRecentConversations ¶
func (c *Client) SyncRecentConversations(maxConversations, maxEventsPerConversation uint64) (*hangouts.SyncRecentConversationsResponse, error)
SyncRecentConversations return info on recent conversations and their events.
func (*Client) UpdateWatermark ¶
func (c *Client) UpdateWatermark(conversationID string, lastReadTimestamp uint64) (*hangouts.UpdateWatermarkResponse, error)
UpdateWatermark update the watermark (read timestamp) of a conversation.
type UploadFile ¶
type UploadFile struct {
// contains filtered or unexported fields
}
UploadFile contains information of image before and after image Upload