cli

package
v0.0.0-...-d6b5dc2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	AllMessages(ctx context.Context) ([]Message, error)
	Requeue(ctx context.Context, msg Message) error
	Ack(ctx context.Context, msg Message) error
}

type BackendConfig

type BackendConfig struct {
	Topic    string
	RawTopic string
}

func (BackendConfig) Validate

func (c BackendConfig) Validate() error

type BackendConstructor

type BackendConstructor func(ctx context.Context, cfg BackendConfig) (Backend, error)

type Dialog

type Dialog struct {
	Prompt  string
	Action  func() tea.Msg
	Choice  int
	Running bool
}

type DialogResult

type DialogResult struct {
	Err error
}

type Message

type Message struct {
	// ID is a unique message ID across the Pub/Sub's topic.
	ID       string
	UUID     string
	Payload  string
	Metadata map[string]string

	OriginalTopic string
	DelayedUntil  string
	DelayedFor    string
	RequeueIn     time.Duration
}

func NewMessage

func NewMessage(id string, uuid string, payload string, metadata map[string]string) (Message, error)

type MessagesUpdated

type MessagesUpdated struct {
	Messages []Message
}

type Model

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

func NewModel

func NewModel(backend Backend) Model

func (Model) FetchMessages

func (m Model) FetchMessages() tea.Cmd

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model) View

func (m Model) View() string

func (Model) WaitForMessages

func (m Model) WaitForMessages() tea.Cmd

Jump to

Keyboard shortcuts

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