groupmeext

package
v0.0.0-...-47656ca Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OldUserSuffix = "@c.groupme.com"
	NewUserSuffix = "@groupme.com"
)

Variables

This section is empty.

Functions

func DownloadFile

func DownloadFile(RoomJID groupme.ID, FileID string, token string) (contents []byte, fname, mime string)

func DownloadImage

func DownloadImage(URL string) (bytes *[]byte, mime string, err error)

DownloadImage helper function to download image from groupme; append .large/.preview/.avatar to get various sizes

func DownloadVideo

func DownloadVideo(previewURL, videoURL, token string) (vidContents []byte, mime string)

Types

type AuthExt

type AuthExt struct{}

for authentication, specific implementation will vary based on faye library

func (*AuthExt) In

func (a *AuthExt) In(wray.Message)

func (*AuthExt) Out

func (a *AuthExt) Out(m wray.Message)

type Client

type Client struct {
	*groupme.Client
}

func NewClient

func NewClient(authToken string) *Client

NewClient creates a new GroupMe API Client

func (Client) IndexAllChats

func (c Client) IndexAllChats() ([]*groupme.Chat, error)

func (Client) IndexAllGroups

func (c Client) IndexAllGroups() ([]*groupme.Group, error)

func (Client) IndexAllRelations

func (c Client) IndexAllRelations() ([]*groupme.User, error)

func (Client) LoadMessagesAfter

func (c Client) LoadMessagesAfter(groupID groupme.ID, lastMessageID string, lastMessageFromMe bool, private bool) ([]*groupme.Message, error)

func (Client) LoadMessagesBefore

func (c Client) LoadMessagesBefore(groupID, lastMessageID string, private bool) ([]*groupme.Message, error)

func (*Client) RemoveFromGroup

func (c *Client) RemoveFromGroup(uid, groupID groupme.ID) error

type FayeClient

type FayeClient struct {
	*wray.FayeClient
}

func NewFayeClient

func NewFayeClient(logger log.Logger) *FayeClient

func (FayeClient) WaitSubscribe

func (fc FayeClient) WaitSubscribe(channel string, msgChannel chan groupme.PushMessage)

type ImgData

type ImgData struct {
	FileData struct {
		FileName string `json:"file_name"`
		FileSize int    `json:"file_size"`
		Mime     string `json:"mime_type"`
	} `json:"file_data"`
}

type Message

type Message struct{ groupme.Message }

func (*Message) Scan

func (m *Message) Scan(value interface{}) error

func (*Message) Value

func (m *Message) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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