app

package
v0.0.0-...-9362338 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package app provides client app support.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

func New

func New(client *Client, cfg *Config) *App

func (*App) ButtonHandler

func (a *App) ButtonHandler()

func (*App) FindName

func (a *App) FindName(id string) string

func (*App) Run

func (a *App) Run() error

func (*App) UpdateContact

func (a *App) UpdateContact(id string, name string)

func (*App) WriteText

func (a *App) WriteText(name string, msg string)

type Client

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

func NewClient

func NewClient(id string, url string, cfg *Config) *Client

func (*Client) Close

func (c *Client) Close() error

func (*Client) Handshake

func (c *Client) Handshake(name string, uiWrite UIScreenWrite, uiUpdateContact UIUpdateContact) error

func (*Client) Send

func (c *Client) Send(to string, msg string) error

type Config

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

func NewConfig

func NewConfig(filePath string) (*Config, error)

func (*Config) AddContact

func (c *Config) AddContact(id string, name string) error

func (*Config) Contacts

func (c *Config) Contacts() []User

func (*Config) LookupContact

func (c *Config) LookupContact(id string) (User, error)

func (*Config) User

func (c *Config) User() User

type UIScreenWrite

type UIScreenWrite func(name string, msg string)

type UIUpdateContact

type UIUpdateContact func(id string, name string)

type User

type User struct {
	ID   string
	Name string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳