prebox

package module
v0.0.0-...-ea55a62 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

thread is an implementaiton of jwz.org/doc/threading.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Name  string `msgpack:"name"`
	Email string `msgpack:"email"`
}

type Backend

type Backend interface {
	Name() string
	ListMailboxes() ([]Mailbox, error)
	Search(limit int, offset int, query []string) (total uint64, result []Email, err error)
	AddConnection(*Connection)
	RemoveConnection(*Connection)
}

type Config

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

func LoadConfig

func LoadConfig() ([]Config, error)

type Connection

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

func (*Connection) Log

func (c *Connection) Log(format string, v ...any)

func (*Connection) Serve

func (c *Connection) Serve() error

func (*Connection) Write

func (c *Connection) Write(b []byte) (int, error)

type Email

type Email struct {
	Type       string    `msgpack:"type,omitempty"`
	Id         string    `msgpack:"id"`
	Subject    string    `msgpack:"subject"`
	MessageId  string    `msgpack:"message_id"`
	References []string  `msgpack:"references"`
	ReplyTo    []Address `msgpack:"reply_to"`
	From       []Address `msgpack:"from"`
	To         []Address `msgpack:"to"`
	Cc         []Address `msgpack:"cc"`
	Bcc        []Address `msgpack:"bcc"`
	Mailboxes  []string  `msgpack:"mailbox_ids"`
	Keywords   []string  `msgpack:"keywords"`
	Size       uint      `msgpack:"size"`
	Date       int64     `msgpack:"date"`
}

func (Email) StrippedSubject

func (e Email) StrippedSubject() string

type JmapClient

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

func NewJmapClient

func NewJmapClient(name string, url *url.URL) (*JmapClient, error)

func (*JmapClient) AddConnection

func (c *JmapClient) AddConnection(conn *Connection)

func (*JmapClient) Connect

func (c *JmapClient) Connect() error

Connect to the remote server. If the Session object is available in the cache, then this only sets up the Listener for remote changes

func (*JmapClient) ListMailboxes

func (c *JmapClient) ListMailboxes() ([]Mailbox, error)

func (*JmapClient) Name

func (c *JmapClient) Name() string

func (*JmapClient) RemoveConnection

func (c *JmapClient) RemoveConnection(conn *Connection)

func (*JmapClient) Search

func (c *JmapClient) Search(limit int, offset int, query []string) (uint64, []Email, error)

type Mailbox

type Mailbox struct {
	Name      string `msgpack:"name"`
	Id        string `msgpack:"id"`
	ParentId  string `msgpack:"parent_id"`
	Role      string `msgpack:"role"`
	Total     uint   `msgpack:"total"`
	Unread    uint   `msgpack:"unread"`
	SortOrder uint   `msgpack:"sort_order"`
}

type Server

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

func NewServer

func NewServer(cfgs []Config) *Server

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

type ThreadedEmail

type ThreadedEmail struct {
	Email `msgpack:"email"`

	Replies []*ThreadedEmail `msgpack:"replies"`
	// contains filtered or unexported fields
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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