api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListMailsResponse

type ListMailsResponse struct {
	Mails  []*Mail `json:"mails"`
	Total  int     `json:"total"`
	Limit  int     `json:"limit"`
	Offset int     `json:"offset"`
}

ListMailsResponse is the envelope returned by GET /inbox.

type Mail

type Mail struct {
	ID         string    `json:"id"`
	MessageID  string    `json:"message_id"`
	Subject    string    `json:"subject"`
	From       string    `json:"from"`
	To         string    `json:"to"`
	ReceivedAt time.Time `json:"received_at"`
	TextBody   string    `json:"text_body,omitempty"`
	HTMLBody   string    `json:"html_body,omitempty"`
}

Mail is the API representation of an email message.

type Server

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

Server wraps an Echo instance with app dependencies.

func NewServer

func NewServer(cfg *config.Config, store storage.Store) *Server

NewServer creates and configures a new Server.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the underlying http.Handler, useful for testing.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown gracefully stops the server, waiting up to the deadline in ctx.

func (*Server) Start

func (s *Server) Start(addr string) error

Start begins listening on addr. It returns http.ErrServerClosed on graceful shutdown.

Jump to

Keyboard shortcuts

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