api

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoverAPI

func DiscoverAPI() (string, error)

DiscoverAPI attempts to auto-discover the Beeper Desktop API URL

Types

type Chat

type Chat struct {
	ID          string `json:"id"`
	Title       string `json:"title"`
	Type        string `json:"type"`
	Network     string `json:"network"`
	UnreadCount int    `json:"unreadCount"`
	IsMuted     bool   `json:"isMuted"`
	IsArchived  bool   `json:"isArchived"`
	IsPinned    bool   `json:"isPinned"`
	// Store participants as raw JSON since it's a complex nested object
	Participants map[string]interface{} `json:"participants"`
}

Chat represents a Beeper chat/conversation Using a simplified structure that works with JSON unmarshaling

type ChatsResponse

type ChatsResponse struct {
	Items   []Chat `json:"items"`
	HasMore bool   `json:"hasMore"`
}

Chat represents a Beeper chat/conversation ChatsResponse represents the API response for listing chats

type Client

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

Client handles communication with Beeper Desktop API

func NewClient

func NewClient(baseURL string) *Client

NewClient creates a new API client

func (*Client) GetChat

func (c *Client) GetChat(chatID string) (*Chat, error)

GetChat retrieves a specific chat by ID

func (*Client) ListChats

func (c *Client) ListChats() ([]Chat, error)

ListChats retrieves all chats

func (*Client) ListMessages

func (c *Client) ListMessages(chatID string, limit int) ([]Message, error)

ListMessages retrieves messages from a chat

func (*Client) Ping

func (c *Client) Ping() error

Ping checks if the API is reachable

func (*Client) SearchMessages

func (c *Client) SearchMessages(query string, limit int) ([]Message, error)

SearchMessages searches for messages across all chats

func (*Client) SendMessage

func (c *Client) SendMessage(chatID, message string) (string, error)

SendMessage sends a message to a chat and returns the message ID

func (*Client) SetAuthToken

func (c *Client) SetAuthToken(token string)

SetAuthToken sets the Bearer authentication token

type Message

type Message struct {
	ID        string `json:"id"`
	ChatID    string `json:"chatID"`
	Sender    string `json:"senderName"`
	Text      string `json:"text"`
	Timestamp string `json:"timestamp"` // ISO 8601 timestamp string
	IsSender  bool   `json:"isSender"`
}

Message represents a Beeper message

type MessagesResponse

type MessagesResponse struct {
	Items   []Message `json:"items"`
	HasMore bool      `json:"hasMore"`
}

MessagesResponse represents the API response for listing messages

type SearchResponse

type SearchResponse struct {
	Items []Message `json:"items"`
}

SearchResponse represents the API response for searching messages

type SendMessageRequest

type SendMessageRequest struct {
	Text string `json:"text"`
}

SendMessageRequest represents a message send request

type SendMessageResponse

type SendMessageResponse struct {
	ID string `json:"id"`
}

SendMessageResponse represents the API response after sending a message

Jump to

Keyboard shortcuts

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