gchatmeow

package
v0.5.3-0...-dfec8a0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNetworkError     = errors.New("network error")
	ErrUnexpectedStatus = errors.New("unexpected status")
	ErrSIDInvalid       = errors.New("SID invalid")
	ErrSIDExpiring      = errors.New("SID expiring")
	ErrChannelLifetime  = errors.New("channel lifetime expired")
)
View Source
var (
	CookieNames = []string{"COMPASS", "SSID", "SID", "OSID", "HSID"}
)

Functions

This section is empty.

Types

type Channel

type Channel struct {
	OnConnect      *Event
	OnReconnect    *Event
	OnDisconnect   *Event
	OnReceiveArray *Event
	// contains filtered or unexported fields
}

func NewChannel

func NewChannel(session *Session, maxRetries, retryBackoffBase int) (*Channel, error)

func (*Channel) IsConnected

func (c *Channel) IsConnected() bool

func (*Channel) Listen

func (c *Channel) Listen(ctx context.Context, maxAge time.Duration) error

type ChunkParser

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

func NewChunkParser

func NewChunkParser() *ChunkParser

func (*ChunkParser) GetChunks

func (p *ChunkParser) GetChunks(newDataBytes []byte) []string

type Client

type Client struct {

	// Events
	OnConnect     *Event
	OnReconnect   *Event
	OnDisconnect  *Event
	OnStreamEvent *Event
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cookies *Cookies, userAgent string, maxRetries, retryBackoffBase int) *Client

func (*Client) CatchUpGroup

func (c *Client) CatchUpGroup(ctx context.Context, request *proto.CatchUpGroupRequest) (*proto.CatchUpResponse, error)

func (*Client) Connect

func (c *Client) Connect(ctx context.Context, maxAge time.Duration) error

func (*Client) CreateMessage

func (c *Client) CreateMessage(ctx context.Context, request *proto.CreateMessageRequest) (*proto.CreateMessageResponse, error)

func (*Client) CreateTopic

func (c *Client) CreateTopic(ctx context.Context, request *proto.CreateTopicRequest) (*proto.CreateTopicResponse, error)

func (*Client) DeleteMessage

func (c *Client) DeleteMessage(ctx context.Context, request *proto.DeleteMessageRequest) (*proto.DeleteMessageResponse, error)

func (*Client) DownloadAttachment

func (c *Client) DownloadAttachment(ctx context.Context, attUrl *url.URL) (*http.Response, error)

func (*Client) EditMessage

func (c *Client) EditMessage(ctx context.Context, request *proto.EditMessageRequest) (*proto.EditMessageResponse, error)

func (*Client) GetGroup

func (c *Client) GetGroup(ctx context.Context, request *proto.GetGroupRequest) (*proto.GetGroupResponse, error)

func (*Client) GetMembers

func (c *Client) GetMembers(ctx context.Context, ids []string) (*proto.GetMembersResponse, error)

func (*Client) GetSelf

func (c *Client) GetSelf(ctx context.Context) (*proto.User, error)

func (*Client) MarkGroupReadstate

func (*Client) RefreshTokens

func (c *Client) RefreshTokens(ctx context.Context) error

func (*Client) SetTypingState

func (c *Client) SetTypingState(ctx context.Context, request *proto.SetTypingStateRequest) (*proto.SetTypingStateResponse, error)

func (*Client) SplitEventBodies

func (c *Client) SplitEventBodies(evt *proto.Event) []*proto.Event

func (*Client) Sync

func (*Client) UpdateReaction

func (c *Client) UpdateReaction(ctx context.Context, request *proto.UpdateReactionRequest) (*proto.UpdateReactionResponse, error)

func (*Client) UploadFile

func (c *Client) UploadFile(ctx context.Context, data []byte, groupId string, fileName string, mimeType string) (*proto.UploadMetadata, error)

type Cookies

type Cookies struct {
	COMPASS string
	SSID    string
	SID     string
	OSID    string
	HSID    string
}

func (*Cookies) UpdateValues

func (c *Cookies) UpdateValues(values map[string]string)

type Event

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

func (*Event) AddObserver

func (e *Event) AddObserver(observer Observer)

func (*Event) Fire

func (e *Event) Fire(data interface{})

type FetchResponse

type FetchResponse struct {
	Code    int
	Headers http.Header
	Body    []byte
}

type NetworkError

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

func (*NetworkError) Error

func (e *NetworkError) Error() string

type Observer

type Observer func(interface{})

type Session

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

func NewSession

func NewSession(cookies *Cookies, proxyURL string, userAgent string) (*Session, error)

func (*Session) Fetch

func (s *Session) Fetch(ctx context.Context, method, urlStr string, params url.Values, headers http.Header, allowRedirects bool, data []byte) (*FetchResponse, error)

func (*Session) FetchRaw

func (s *Session) FetchRaw(ctx context.Context, method, urlStr string, params url.Values, headers http.Header, allowRedirects bool, data []byte) (*http.Response, error)

type UTF16String

type UTF16String []uint16

func NewUTF16String

func NewUTF16String(s string) UTF16String

func (UTF16String) String

func (u UTF16String) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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