bridge

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 57 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

Overview

Package bridge exposes the business services to the frontend as Wails services.

Every exported method on a bridge service becomes a callable binding in the renderer. The bridge is the only place allowed to reshape business data for the UI: it redacts secrets that must never leave the Go process and resolves the credential modes the settings and connection forms rely on.

Index

Constants

View Source
const (
	TitleBarHeight   = 40.0
	TrafficLightLeft = 16.0
)

Title bar geometry shared with the renderer. Keep in step with the .tb2 and .tb2--mac rules in frontend/src/design/tokens.css.

View Source
const AgentEvent = "agent:event"

AgentEvent carries every change to a conversation. The renderer applies them in seq order, and asks for a snapshot when one is missing.

View Source
const MainWindowName = "main"

MainWindowName identifies the single application window.

View Source
const SettingsEvent = "settings:changed"

SettingsEvent tells the renderer the settings changed. It has to be told: the tray writes them too, and the window holds its own copy of the values it paints from.

View Source
const ZoomEvent = "ui:zoom"

ZoomEvent asks the renderer to change its UI scale. The payload is one of "in", "out" or "reset"; see useUIScale in the frontend.

Variables

This section is empty.

Functions

func BackgroundColour

func BackgroundColour(dark bool) application.RGBA

BackgroundColour returns the window colour for the requested appearance.

func Services

func Services(
	services *app.Services,
	version string,
	shell *ShellService,
	updates *update.Manager,
	translate func(string) string,
) []application.Service

Services returns every bridge service in registration order.

The shell service and the update manager are passed in rather than built here. Both outlive a single call: the shell's consumer is the system tray, which cannot exist until the application is running, and the updater keeps a background schedule the caller has to be able to stop. Translate resolves i18n keys in the application's language; only the composition root can embed the locale files it reads.

Types

type ACLService

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

ACLService exposes access-control administration to the frontend.

func (*ACLService) DeleteAccess

func (s *ACLService) DeleteAccess(connID int, accessKey string) error

DeleteAccess removes an ACL access config entry.

func (*ACLService) DeletePrincipal

func (s *ACLService) DeletePrincipal(connID int, name string) error

DeletePrincipal removes a principal.

func (*ACLService) DeleteRule

func (s *ACLService) DeleteRule(connID int, subject string) error

DeleteRule drops every policy attached to a subject.

func (*ACLService) DirectoryEnabled

func (s *ACLService) DirectoryEnabled(connID int) (bool, error)

DirectoryEnabled reports whether the broker runs identity-based access control, which is what decides which of the two ACL systems the page shows.

func (*ACLService) Enabled

func (s *ACLService) Enabled(connID int) (bool, error)

Enabled reports whether the broker has ACL turned on.

func (*ACLService) Principals

func (s *ACLService) Principals(connID int) ([]*model.AccessPrincipal, error)

Principals returns the identities the broker authenticates.

func (*ACLService) Rules

func (s *ACLService) Rules(connID int) ([]*model.AccessRule, error)

Rules returns every subject's policies.

func (*ACLService) UpdateAccess

func (s *ACLService) UpdateAccess(connID int, input AccessConfigInput) error

UpdateAccess creates or replaces an ACL access config entry.

func (*ACLService) UpdatePrincipal

func (s *ACLService) UpdatePrincipal(connID int, input PrincipalInput) error

UpdatePrincipal creates a principal, or updates one that already exists.

func (*ACLService) UpdateRule

func (s *ACLService) UpdateRule(connID int, input AccessRuleInput) error

UpdateRule replaces one subject's policies. It replaces rather than merges, which is what the broker does with the set it is handed.

func (*ACLService) UpdateWhiteAddrs

func (s *ACLService) UpdateWhiteAddrs(connID int, addrs []string) error

UpdateWhiteAddrs replaces the broker global IP white list.

func (*ACLService) Version

func (s *ACLService) Version(connID int) (*model.AclVersionInfo, error)

Version returns the broker ACL config version and its entries.

type AccessConfigInput

type AccessConfigInput struct {
	AccessKey          string   `json:"accessKey"`
	SecretKey          string   `json:"secretKey"`
	WhiteRemoteAddress string   `json:"whiteRemoteAddress"`
	IsAdmin            bool     `json:"isAdmin"`
	DefaultTopicPerm   string   `json:"defaultTopicPerm"`
	DefaultGroupPerm   string   `json:"defaultGroupPerm"`
	TopicPerms         []string `json:"topicPerms"`
	GroupPerms         []string `json:"groupPerms"`
}

AccessConfigInput carries an ACL access config form submission.

type AccessRuleInput

type AccessRuleInput struct {
	Subject     string        `json:"subject"`
	Description string        `json:"description"`
	Policies    []PolicyInput `json:"policies"`
}

AccessRuleInput carries an access-rule form submission.

type AccessView added in v0.0.3

type AccessView struct {
	// Enabled is false on a cluster running without an authorizer. Its ACL
	// calls all answer SECURITY_DISABLED, which is a deployment choice rather
	// than a fault, so the page says so instead of showing an error.
	Enabled bool `json:"enabled"`

	Rules []*model.AccessRule `json:"rules"`

	// Principals are the SCRAM users the cluster stores. A cluster
	// authenticating over mTLS or Kerberos has principals it never stores, so
	// a rule can name someone who is not in this list - which is the truth
	// rather than an omission.
	Principals []*model.AccessPrincipal `json:"principals"`

	// Operations and ResourceKinds are what a rule may be built from. The set
	// is closed and comes from Go, so the renderer cannot write a grant that
	// has not been reviewed.
	Operations    []string `json:"operations"`
	ResourceKinds []string `json:"resourceKinds"`
}

AccessView is the access control page in one answer.

type AclUserInput added in v0.0.5

type AclUserInput struct {
	Name    string `json:"name"`
	Enabled bool   `json:"enabled"`
	// Password is a new password. Empty keeps whatever is stored.
	Password string `json:"password"`
	// ClearPasswords leaves a user that cannot authenticate at all, which is
	// the opposite of NoPassword rather than a milder form of it.
	ClearPasswords bool `json:"clearPasswords"`
	// NoPassword lets the user authenticate with anything.
	NoPassword      bool     `json:"noPassword"`
	KeyPatterns     []string `json:"keyPatterns"`
	ChannelPatterns []string `json:"channelPatterns"`
	CommandRules    []string `json:"commandRules"`
}

AclUserInput is a user as the form collects it.

type ActiveMQDestinationInput added in v0.0.9

type ActiveMQDestinationInput struct {
	Name string `json:"name"`
	// Topic rather than a kind string, because there are exactly two and a
	// boolean cannot arrive misspelled. It is not inferable from the name: a
	// queue and a topic may both be called ORDERS, and on Classic they are
	// different objects in different trees.
	Topic bool `json:"topic"`
}

ActiveMQDestinationInput is a destination declaration as the ActiveMQ form collects it.

Deliberately not TopicService.Create's shape. That one takes a broker address, a read queue count, a write queue count and a permission string, which is RocketMQ's vocabulary; a JMS destination has none of those, and a form that filled them in with placeholders would be lying about what it sent.

type ActiveMQMoveInput added in v0.0.9

type ActiveMQMoveInput struct {
	From string `json:"from"`
	To   string `json:"to"`
}

MoveInput names one destination to drain into another.

Flatter than the canonical MoveRequest because ActiveMQ has no exchange and no routing key: a JMS move puts the message in the named destination, with no topology in between for it to take.

type ActiveMQPublishInput added in v0.0.9

type ActiveMQPublishInput struct {
	Destination string `json:"destination"`
	Body        string `json:"body"`
	// Persistent is honoured on Artemis, whose sendMessage takes it. Classic's
	// sendTextMessage has no delivery-mode parameter and the destination's own
	// policy decides, so the switch does nothing there - which the console
	// says rather than pretending otherwise.
	Persistent    bool              `json:"persistent"`
	Priority      int               `json:"priority"`
	CorrelationID string            `json:"correlationId"`
	ReplyTo       string            `json:"replyTo"`
	JMSType       string            `json:"jmsType"`
	Headers       map[string]string `json:"headers"`
	Count         int               `json:"count"`
}

ActiveMQPublishInput is a send as the ActiveMQ console collects it.

Flatter than the canonical PublishRequest, which is AMQP's: there is no exchange, no routing key and no mandatory flag here, because a JMS send names its destination and nothing routes in between. What is left is the body, the JMS headers a producer can set, and a count.

type ActiveMQService added in v0.0.9

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

ActiveMQService is the renderer's entry point for the operations only ActiveMQ has. Queues and topics, durable subscribers, browsing and sending all go through the canonical services; what is here is the rest.

func (*ActiveMQService) CloseConnection added in v0.0.9

func (s *ActiveMQService) CloseConnection(connID int, name string) error

CloseConnection disconnects one client.

By the broker's own connection id rather than by address, because an address is not unique - one host can hold twenty connections, and closing by address would take all of them.

func (*ActiveMQService) Connections added in v0.0.9

func (s *ActiveMQService) Connections(connID int) ([]*model.ClientConnection, error)

Connections lists what is holding a socket open on the broker.

The protocol column is read differently on the two products and both are the broker's own answer: Artemis reports the connection's Java class, which the driver maps onto the protocol's name, and Classic reports which connector accepted the socket - which is the same fact, since a connector serves one protocol.

func (*ActiveMQService) CreateDestination added in v0.0.9

func (s *ActiveMQService) CreateDestination(connID int, input ActiveMQDestinationInput) error

CreateDestination declares a queue or a topic.

func (*ActiveMQService) CreateSubscription added in v0.0.9

func (s *ActiveMQService) CreateSubscription(connID int, input ActiveMQSubscriptionInput) error

CreateSubscription registers a durable subscription on a topic.

func (*ActiveMQService) DeadLetterQueues added in v0.0.9

func (s *ActiveMQService) DeadLetterQueues(connID int) ([]*model.DeadLetterQueue, error)

DeadLetterQueues finds the destinations dead letters land in, and the destinations that feed them.

The sources are empty on Classic and filled on Artemis, and that is the broker rather than the driver: Artemis records a dead-letter address on every queue, so the topology can be walked backwards; Classic decides by a broker-wide policy and keeps no record of where a dead letter came from.

func (*ActiveMQService) MoveMessages added in v0.0.9

func (s *ActiveMQService) MoveMessages(connID int, input ActiveMQMoveInput) (int, error)

MoveMessages drains one destination into another and reports how many the broker moved. The count is the broker's own, which is what separates a move that matched nothing from one that moved everything.

func (*ActiveMQService) PollSubscription added in v0.0.9

func (s *ActiveMQService) PollSubscription(connID int, id string, after int64, limit int) (*model.LiveBatch, error)

PollSubscription drains what has arrived since the caller's cursor.

func (*ActiveMQService) Publish added in v0.0.9

func (s *ActiveMQService) Publish(connID int, input ActiveMQPublishInput) (*model.PublishResult, error)

Publish sends one or more messages and reports what the broker took.

func (*ActiveMQService) PurgeQueue added in v0.0.9

func (s *ActiveMQService) PurgeQueue(connID int, name string) error

PurgeQueue drops everything a destination is holding. There is no undo.

On an Artemis topic this empties every subscription under the address rather than the address itself, which holds nothing - a call against the address would report success and change nothing.

func (*ActiveMQService) RemoveDestination added in v0.0.9

func (s *ActiveMQService) RemoveDestination(connID int, name string) error

RemoveDestination deletes a destination and everything it holds.

func (*ActiveMQService) RemoveSubscription added in v0.0.9

func (s *ActiveMQService) RemoveSubscription(connID int, name string) error

RemoveSubscription unsubscribes, discarding whatever it was still owed.

func (*ActiveMQService) RetryDeadLetters added in v0.0.9

func (s *ActiveMQService) RetryDeadLetters(connID int, name string) (int, error)

RetryDeadLetters sends a dead-lettered destination's contents back to the destinations each message originally failed on, and reports how many the broker moved.

The whole destination, because that is the only form either product offers: retryMessages() takes no arguments on Classic or on Artemis.

func (*ActiveMQService) StartSubscription added in v0.0.9

func (s *ActiveMQService) StartSubscription(connID int, input ActiveMQSubscribeInput) (*model.LiveSubscription, error)

StartSubscription attaches a live view to one or more topics.

func (*ActiveMQService) StopSubscription added in v0.0.9

func (s *ActiveMQService) StopSubscription(connID int, id string) error

StopSubscription detaches a live view.

func (*ActiveMQService) Subscriptions added in v0.0.9

func (s *ActiveMQService) Subscriptions(connID int) ([]*model.LiveSubscription, error)

Subscriptions is what is running.

type ActiveMQSubscribeInput added in v0.0.9

type ActiveMQSubscribeInput struct {
	Topics []string `json:"topics"`
	// Buffer bounds what one stream holds between polls. Zero takes the
	// driver's default, and whatever it drops is reported rather than lost
	// silently - a busy topic and a quiet one look the same otherwise.
	Buffer int `json:"buffer"`
}

ActiveMQSubscribeInput is a live view as the workbench asks for one.

Topics only, and the driver enforces it rather than the form: a JMS consumer consumes, so attaching one to a queue would take its messages and hand them to a window somebody opened to look.

type ActiveMQSubscriptionInput added in v0.0.9

type ActiveMQSubscriptionInput struct {
	// Topic is what the subscription reads.
	Topic string `json:"topic"`
	// Name is the canonical ref. On Artemis it is the queue's name; on Classic
	// it is the client id and the subscription name joined by a vertical bar,
	// because a JMS client id routinely contains a slash or a colon.
	Name string `json:"name"`
	// Selector is a JMS selector expression, empty for everything. Classic
	// rejects an empty string as an expression, so the driver sends null.
	Selector string `json:"selector"`
}

ActiveMQSubscriptionInput is a durable subscription as the ActiveMQ form collects it.

Deliberately not ConsumerInput's shape: that one carries a broker address, a consume mode and a retry count, and carries no topic - which is the one thing a durable subscription cannot be made without.

type AgentFailure added in v0.3.0

type AgentFailure struct {
	Reason string `json:"reason"`
	Status int    `json:"status"`
	Detail string `json:"detail"`
}

* AgentFailure is why a call to a model service failed. * * Reason is one of provider.Reason, or "invalid" for a form the call could * not even be made from, so the page can say what to do about it in the * reader's language. Detail is the service's own words, for the rest.

type AgentModel added in v0.3.0

type AgentModel struct {
	ID   string `json:"id"`
	Name string `json:"name,omitempty"`
}

AgentModel is one model a service offers.

type AgentModels added in v0.3.0

type AgentModels struct {
	Models  []AgentModel  `json:"models"`
	Failure *AgentFailure `json:"failure,omitempty"`
}

AgentModels is a service's model listing, or why there is none.

type AgentPreferencesInput added in v0.3.0

type AgentPreferencesInput struct {
	Default   string `json:"default"`
	Effort    string `json:"effort"`
	Writes    string `json:"writes"`
	BodyBytes int    `json:"bodyBytes"`
	Retention int    `json:"retention"`
}

AgentPreferencesInput is everything on the page that is not a provider.

type AgentProbe added in v0.3.0

type AgentProbe struct {
	OK        bool          `json:"ok"`
	Model     string        `json:"model"`
	ElapsedMs int64         `json:"elapsedMs"`
	Failure   *AgentFailure `json:"failure,omitempty"`
}

AgentProbe is what a test of a model service found.

type AgentProviderInput added in v0.3.0

type AgentProviderInput struct {
	// ID is empty for a service not saved yet.
	ID       string `json:"id"`
	Name     string `json:"name"`
	Kind     string `json:"kind"`
	BaseURL  string `json:"baseURL"`
	Model    string `json:"model"`
	Proxy    string `json:"proxy"`
	Fallback bool   `json:"fallback"`
	APIKey   string `json:"apiKey"`
	// APIKeyMode is preserve, replace or clear. Preserve keeps the stored key
	// of the service ID names, and is no key at all for a new one.
	APIKeyMode string `json:"apiKeyMode"`
}

AgentProviderInput is a model service form submission, and what a test or a model listing is run with before anything is saved.

type AgentProviderView added in v0.3.0

type AgentProviderView struct {
	ID               string `json:"id"`
	Name             string `json:"name"`
	Kind             string `json:"kind"`
	BaseURL          string `json:"baseURL"`
	Model            string `json:"model"`
	Proxy            string `json:"proxy"`
	Fallback         bool   `json:"fallback"`
	APIKeyConfigured bool   `json:"apiKeyConfigured"`
}

AgentProviderView is a model service with its key replaced by whether one is set.

type AgentService added in v0.3.0

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

AgentService runs the window's assistant: its conversations, the runs that answer them, and the questions a run puts to the person.

func NewAgentService added in v0.3.0

func NewAgentService(manager *assistant.Manager) *AgentService

NewAgentService fronts manager.

func (*AgentService) Clear added in v0.3.0

func (s *AgentService) Clear() error

Clear forgets every conversation but one answering.

func (*AgentService) Continue added in v0.3.0

func (s *AgentService) Continue(session string) error

Continue runs a conversation again from where a failed, stopped or limited run left it, without anything new said.

func (*AgentService) Decide added in v0.3.0

func (s *AgentService) Decide(session, ask string, approve, remember bool) error

Decide answers a question a run is waiting on.

func (*AgentService) Delete added in v0.3.0

func (s *AgentService) Delete(session string) error

Delete forgets a conversation, here and on disk.

func (*AgentService) Rename added in v0.3.0

func (s *AgentService) Rename(session, title string) error

Rename gives a conversation a title of the person's choosing.

func (*AgentService) SaveTranscript added in v0.3.0

func (s *AgentService) SaveTranscript(title, markdown string) (string, error)

* SaveTranscript prompts for a file and writes a conversation to it. The * renderer writes the Markdown, in the reader's language, and this only puts * it where the person chose. It returns the path, or an empty string when the * person cancels.

func (*AgentService) Send added in v0.3.0

func (s *AgentService) Send(session, text string, where assistant.Context) error

Send adds what the person said, and where they were, and starts the run that answers it. What the run does arrives as events.

func (*AgentService) Sessions added in v0.3.0

func (s *AgentService) Sessions() ([]assistant.Summary, error)

Sessions lists the conversations held and kept, the most recently changed first.

func (*AgentService) Snapshot added in v0.3.0

func (s *AgentService) Snapshot(session string) (assistant.Snapshot, error)

Snapshot is a conversation as it stands, for a renderer that missed an event or opened late.

func (*AgentService) Start added in v0.3.0

func (s *AgentService) Start(provider string) (assistant.Summary, error)

Start opens a conversation on a model service; empty is the default one.

func (*AgentService) Stop added in v0.3.0

func (s *AgentService) Stop(session string) error

Stop ends a conversation's run.

type AgentSettingsService added in v0.3.0

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

AgentSettingsService sets up the window's assistant: the model services it runs on and how it treats writes. A key goes in and never comes back out.

func NewAgentSettingsService added in v0.3.0

func NewAgentSettingsService(store *assistant.Store, prune func() error) *AgentSettingsService

NewAgentSettingsService fronts the assistant settings kept in store. Prune may be nil.

func (*AgentSettingsService) Consent added in v0.3.0

Consent records that the person agreed to what is sent to a model service, which the assistant waits for before it sends anything there.

func (*AgentSettingsService) DeleteProvider added in v0.3.0

func (s *AgentSettingsService) DeleteProvider(id string) (*AgentSettingsView, error)

DeleteProvider removes a model service and its key.

func (*AgentSettingsService) Get added in v0.3.0

Get returns the assistant's set-up, keys redacted.

func (*AgentSettingsService) ListModels added in v0.3.0

ListModels asks the service which models it offers, with the form as it stands.

func (*AgentSettingsService) SavePreferences added in v0.3.0

func (s *AgentSettingsService) SavePreferences(input AgentPreferencesInput) (*AgentSettingsView, error)

SavePreferences replaces everything on the page that is not a provider.

func (*AgentSettingsService) SaveProvider added in v0.3.0

SaveProvider adds a model service, or changes the one input.ID names.

func (*AgentSettingsService) TestProvider added in v0.3.0

func (s *AgentSettingsService) TestProvider(input AgentProviderInput) AgentProbe

TestProvider sends the service one small request carrying a tool, with the form as it stands. Nothing is saved.

type AgentSettingsView added in v0.3.0

type AgentSettingsView struct {
	Providers []AgentProviderView `json:"providers"`
	// Default is the provider a new conversation runs on; empty is the first.
	Default   string `json:"default"`
	Effort    string `json:"effort"`
	Writes    string `json:"writes"`
	BodyBytes int    `json:"bodyBytes"`
	// BodyLimits are the caps the page offers for BodyBytes.
	BodyLimits []int `json:"bodyLimits"`
	// Retention is how many days a conversation is kept; zero keeps none.
	Retention int `json:"retention"`
	// Retentions are the choices the page offers for Retention.
	Retentions []int `json:"retentions"`
	// Consented names the providers the person agreed to send data to.
	Consented []string `json:"consented"`
}

AgentSettingsView is the assistant's set-up as the settings page shows it.

type AutoClaimInput added in v0.0.5

type AutoClaimInput struct {
	Stream    string `json:"stream"`
	Group     string `json:"group"`
	Consumer  string `json:"consumer"`
	MinIdleMs int64  `json:"minIdleMs"`
	// Start is where to resume from when walking a long list. Empty starts at
	// the beginning.
	Start string `json:"start"`
	Count int    `json:"count"`
}

AutoClaimInput moves whatever has been idle too long, without naming ids.

type AzureServiceBusEntityInput added in v0.1.0

type AzureServiceBusEntityInput struct {
	Name string `json:"name"`
	// Kind is "queue" or "topic" and is fixed once the entity exists: the two
	// are different objects, so changing it would mean deleting one and
	// losing whatever it held. The driver refuses rather than doing that.
	Kind string `json:"kind"`

	// The delivery half, which belongs to a queue. A topic carries none of it:
	// its subscriptions do, because that is where the messages end up.
	LockDurationSec    int  `json:"lockDurationSec"`
	MaxDeliveryCount   int  `json:"maxDeliveryCount"`
	DeadLetterOnExpiry bool `json:"deadLetterOnExpiry"`

	TTLSec              int `json:"ttlSec"`
	AutoDeleteOnIdleSec int `json:"autoDeleteOnIdleSec"`
	MaxSizeMB           int `json:"maxSizeMb"`

	// Fixed at creation: the service refuses all three in an update.
	RequiresSession            bool `json:"requiresSession"`
	RequiresDuplicateDetection bool `json:"requiresDuplicateDetection"`
	Partitioned                bool `json:"partitioned"`

	// ForwardTo hands every arriving message to another entity, and
	// ForwardDeadLettersTo does the same for what this one gives up on. Empty
	// removes the forwarding, which is the only way to.
	ForwardTo            string `json:"forwardTo"`
	ForwardDeadLettersTo string `json:"forwardDeadLettersTo"`
}

AzureServiceBusEntityInput is a queue or a topic as its form collects it.

Deliberately not TopicService.Create's shape. That one takes a broker address, two queue counts and a permission string - RocketMQ's vocabulary, of which a Service Bus entity has none. What it has instead is a delivery contract: how long a receiver holds a message, how many times it may be tried, how long it lives, and where it goes when it is given up on.

Every duration is zero when the form left it alone, which on an edit means "keep what is stored".

type AzureServiceBusRuleInput added in v0.1.0

type AzureServiceBusRuleInput struct {
	Topic        string `json:"topic"`
	Subscription string `json:"subscription"`
	// Name is what deletes it: one subscription may have several rules, and
	// nothing else tells them apart.
	Name string `json:"name"`

	// Kind is "sql", "correlation", "true" or "false". Empty means true,
	// which is what the service's own $Default rule is.
	Kind string `json:"kind"`

	// Expression is the SQL filter's text, on a sql rule.
	Expression string `json:"expression"`
	// Correlation is the message fields a correlation rule compares by
	// equality. A field left out matches anything.
	Correlation map[string]string `json:"correlation"`

	// Action is a SQL statement run on a matching message before it is copied
	// in - the half of a rule that changes the message rather than selecting
	// it. Optional on every kind.
	Action string `json:"action"`
}

AzureServiceBusRuleInput is a rule as the routing form collects it.

A rule is what decides which of a topic's messages reach one subscription, and it is an object rather than a field: it has a name, several may sit on one subscription, and each is a filter of one of three kinds plus an optional action that rewrites the message on the way in.

type AzureServiceBusSendInput added in v0.1.0

type AzureServiceBusSendInput struct {
	// Entity is a queue or a topic. A subscription cannot be sent to: it
	// receives what its topic copies into it.
	Entity string `json:"entity"`
	Body   string `json:"body"`
	// Count sends the same message more than once. One when left at zero.
	Count int `json:"count"`

	Subject       string `json:"subject"`
	CorrelationID string `json:"correlationId"`
	ContentType   string `json:"contentType"`
	SessionID     string `json:"sessionId"`
	PartitionKey  string `json:"partitionKey"`

	Properties map[string]string `json:"properties"`

	// DelaySec schedules the message for later instead of sending it now. It
	// becomes a real scheduled message: it sits in the entity until its time
	// comes, which the messages page shows and no consumer is offered.
	DelaySec int `json:"delaySec"`
	// TTLSec overrides the entity's own time to live for these messages only.
	TTLSec int `json:"ttlSec"`
}

AzureServiceBusSendInput is a send as the Service Bus console collects it.

Deliberately not MessageService.Send's shape. That one takes a topic, tags, keys and a delay level - RocketMQ's vocabulary - and a Service Bus message carries rather more: a subject, a correlation id, a session or partition key, a content type, and a table of named properties.

Those last two are not decoration here. A subscription's rules select on them: a SQL filter reads the properties by name and a correlation filter matches the subject and correlation id by equality, so a console that could not set them would make the routing page untestable from the app.

type AzureServiceBusSendResult added in v0.1.0

type AzureServiceBusSendResult struct {
	Sent int `json:"sent"`
	// SequenceNumbers are the scheduled messages' handles, which do address
	// something: cancelling a scheduled message takes one. Empty on an
	// immediate send.
	SequenceNumbers []int64 `json:"sequenceNumbers"`
}

AzureServiceBusSendResult is what the send did.

No message id, and its absence is the family: Service Bus's MessageId is the sender's own field, nothing assigns one and nothing indexes it. What addresses a message is its sequence number, and the service reports one only for a scheduled send - an immediate message is given its sequence on arrival and the sender is never told.

type AzureServiceBusService added in v0.1.0

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

AzureServiceBusService is the renderer's entry point for the operations only Azure Service Bus has. Listing and describing entities go through the canonical services; what is here is the rest.

func (*AzureServiceBusService) CancelScheduled added in v0.1.0

func (s *AzureServiceBusService) CancelScheduled(
	connID int, entity string, sequences []int64,
) error

CancelScheduled takes back messages that have not been enqueued yet.

func (*AzureServiceBusService) CreateEntity added in v0.1.0

func (s *AzureServiceBusService) CreateEntity(connID int, input AzureServiceBusEntityInput) error

CreateEntity declares a queue or a topic in the connection's namespace.

func (*AzureServiceBusService) CreateRule added in v0.1.0

func (s *AzureServiceBusService) CreateRule(connID int, input AzureServiceBusRuleInput) error

CreateRule declares a rule on a subscription.

func (*AzureServiceBusService) CreateSubscription added in v0.1.0

func (s *AzureServiceBusService) CreateSubscription(
	connID int, input AzureServiceBusSubscriptionInput,
) error

CreateSubscription declares a subscription on a topic.

func (*AzureServiceBusService) RemoveEntity added in v0.1.0

func (s *AzureServiceBusService) RemoveEntity(connID int, name string) error

RemoveEntity deletes a queue or a topic, and everything it was holding. A topic takes every subscription on it, and their backlogs with them.

func (*AzureServiceBusService) RemoveRule added in v0.1.0

func (s *AzureServiceBusService) RemoveRule(connID int, topic, subscription, name string) error

RemoveRule deletes one rule by name.

Deleting the last one leaves a subscription nothing can reach: it stays Active, its backlog stays empty because nothing arrives, and only the subscriptions board's status says so.

func (*AzureServiceBusService) RemoveSubscription added in v0.1.0

func (s *AzureServiceBusService) RemoveSubscription(connID int, topic, name string) error

RemoveSubscription deletes a subscription and everything it had not delivered. Those messages were never the topic's to hand out again.

func (*AzureServiceBusService) Send added in v0.1.0

Send publishes to one entity and reports how many the service accepted.

Accepted is not delivered. A queue holds what is sent to it; a topic holds nothing, copying the message into every subscription whose rules let it through and discarding it if none do - and reporting success either way.

func (*AzureServiceBusService) UpdateEntity added in v0.1.0

func (s *AzureServiceBusService) UpdateEntity(connID int, input AzureServiceBusEntityInput) error

UpdateEntity changes an existing entity's settings. Sessions, duplicate detection and partitioning are fixed at creation and are not among them.

func (*AzureServiceBusService) UpdateSubscription added in v0.1.0

func (s *AzureServiceBusService) UpdateSubscription(
	connID int, input AzureServiceBusSubscriptionInput,
) error

UpdateSubscription changes what a subscription lets be changed. The topic and sessions are fixed at creation and are not among them.

type AzureServiceBusSubscriptionInput added in v0.1.0

type AzureServiceBusSubscriptionInput struct {
	// Topic is required on a create and fixed afterwards: a subscription reads
	// exactly one topic, chosen when it is made.
	Topic string `json:"topic"`
	Name  string `json:"name"`

	LockDurationSec     int `json:"lockDurationSec"`
	MaxDeliveryCount    int `json:"maxDeliveryCount"`
	TTLSec              int `json:"ttlSec"`
	AutoDeleteOnIdleSec int `json:"autoDeleteOnIdleSec"`

	DeadLetterOnExpiry bool `json:"deadLetterOnExpiry"`
	// DeadLetterOnRuleError moves a message aside when a rule's expression
	// fails to evaluate. Without it such a message is discarded silently.
	DeadLetterOnRuleError bool `json:"deadLetterOnRuleError"`

	// RequiresSession is fixed at creation: the service refuses it in an
	// update, so the form only offers it on a create.
	RequiresSession bool `json:"requiresSession"`

	ForwardTo            string `json:"forwardTo"`
	ForwardDeadLettersTo string `json:"forwardDeadLettersTo"`
}

AzureServiceBusSubscriptionInput is a subscription as its form collects it.

Deliberately not ConsumerService.Create's shape. That one takes a cluster, a broker address, a consume mode and a retry count - RocketMQ's vocabulary, of which a Service Bus subscription has none. What it has is the same delivery contract a queue has, because on this family a subscription is where the messages actually are.

What is not here is what reaches it: a new subscription comes with a $Default rule matching everything, and narrowing that is the routing page's job. A rule is an object with a name, so putting one in this form would hide a second write inside the first.

type BindingInput added in v0.0.2

type BindingInput struct {
	Vhost           string            `json:"vhost"`
	Source          string            `json:"source"`
	Destination     string            `json:"destination"`
	DestinationKind string            `json:"destinationKind"`
	RoutingKey      string            `json:"routingKey"`
	Arguments       map[string]string `json:"arguments"`
	// PropertiesKey identifies an existing binding for deletion. It comes from
	// the listing; a delete without it is refused rather than guessed at.
	PropertiesKey string `json:"propertiesKey"`
}

BindingInput describes one route.

type ClaimInput added in v0.0.5

type ClaimInput struct {
	Stream string `json:"stream"`
	Group  string `json:"group"`
	// Consumer is the new owner. It need not exist yet: claiming creates it,
	// which is how a replacement worker takes over from a dead one.
	Consumer string   `json:"consumer"`
	IDs      []string `json:"ids"`
	// MinIdleMs refuses to move anything touched more recently than this. Zero
	// moves regardless, which is a choice rather than a default.
	MinIdleMs int64 `json:"minIdleMs"`
}

ClaimInput moves named entries to another consumer.

type ClusterService

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

ClusterService exposes cluster topology and health to the frontend.

The service returns canonical nodes and the bridge passes them through. Broker role, CommitLog usage and the rest of RocketMQ's runtime detail travel in each node's attribute map.

func (*ClusterService) BrokerDetail

func (s *ClusterService) BrokerDetail(connID int, brokerAddr string) (*model.Node, error)

BrokerDetail returns runtime statistics for a single broker.

func (*ClusterService) Brokers

func (s *ClusterService) Brokers(connID int) ([]*model.Node, error)

Brokers returns every known broker node.

func (*ClusterService) DirectoryConfig

func (s *ClusterService) DirectoryConfig(connID int) (map[string]string, error)

DirectoryConfig returns the name servers' effective settings.

func (*ClusterService) Info

func (s *ClusterService) Info(connID int) (*ClusterView, error)

Info returns the full cluster overview.

func (*ClusterService) MaintenanceTasks

func (s *ClusterService) MaintenanceTasks() []MaintenanceTaskView

MaintenanceTasks lists the housekeeping jobs a node can be asked to run, and which of them destroy message data.

The renderer offers only what this returns, so a task cannot be triggered by name from the frontend without appearing here first.

func (*ClusterService) NodeConfig

func (s *ClusterService) NodeConfig(connID int, brokerAddr string) (map[string]string, error)

NodeConfig returns one broker's effective settings, as the broker reports them rather than as its config file reads.

func (*ClusterService) RunMaintenance

func (s *ClusterService) RunMaintenance(connID int, brokerAddr string, task string) error

RunMaintenance asks one broker to run a housekeeping job now.

func (*ClusterService) SetBrokerWritable

func (s *ClusterService) SetBrokerWritable(connID int, brokerName string, writable bool) (int, error)

SetBrokerWritable takes a broker out of the write path, or puts it back, and returns how many destinations the change touched.

type ClusterView

type ClusterView struct {
	Overview model.ClusterOverview `json:"overview"`
	Nodes    []*model.Node         `json:"nodes"`

	// Directory is the tier the cluster is reached through - RocketMQ name
	// servers. Empty for a family that has none, which the page reads as
	// "there is no such tier" rather than as "none are up".
	Directory []*model.Node `json:"directory"`
}

ClusterView is the cluster page's snapshot: the header counters and the nodes behind them, in one round trip.

type ConnectionInput

type ConnectionInput struct {
	Name       string              `json:"name"`
	Group      string              `json:"group"`
	Kind       model.MQKind        `json:"kind"`
	Endpoints  string              `json:"endpoints"`
	TimeoutSec int                 `json:"timeoutSec"`
	Auth       model.AuthMechanism `json:"authMechanism"`
	Options    map[string]string   `json:"options"`
	Secrets    map[string]string   `json:"secrets"`
	Remark     string              `json:"remark"`

	// CredentialsMode says what to do with secrets the form left blank:
	// preserve what is stored, replace it with what was typed, or clear it.
	CredentialsMode string `json:"credentialsMode"`
}

ConnectionInput carries a connection form submission.

Secrets is write-only: it carries what the user just typed, and nothing ever sends one back.

type ConnectionService

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

ConnectionService exposes connection management to the frontend.

func (*ConnectionService) Add

Add stores a new connection and returns it with credentials redacted.

func (*ConnectionService) Connect

func (s *ConnectionService) Connect(id int) error

Connect opens the client for a connection.

func (*ConnectionService) ConnectDefault

func (s *ConnectionService) ConnectDefault() error

ConnectDefault opens the client for the default connection.

func (*ConnectionService) Disconnect

func (s *ConnectionService) Disconnect(id int) error

Disconnect closes the client for a connection.

func (*ConnectionService) List

func (s *ConnectionService) List() []*ConnectionView

List returns every configured connection with credentials redacted.

func (*ConnectionService) Probe

func (s *ConnectionService) Probe(id int, input ConnectionInput) error

Probe tests a form submission without storing it.

The id is the connection being edited, or zero for a new one; it exists only so a form whose password field shows "already set" can be tested with the stored credential rather than an empty one.

func (*ConnectionService) Remove

func (s *ConnectionService) Remove(id int) error

Remove deletes a connection.

func (*ConnectionService) Scopes added in v0.0.9

func (s *ConnectionService) Scopes(connID int) ([]*model.Scope, error)

Scopes lists what this connection could be re-pointed at, for a family whose scope is a naming convention rather than a broker object.

func (*ConnectionService) SetDefault

func (s *ConnectionService) SetDefault(id int) error

SetDefault marks a connection as the default one.

func (*ConnectionService) SetScope added in v0.0.9

func (s *ConnectionService) SetScope(connID int, name string) (*ConnectionView, error)

* SetScope re-points a connection at another scope and redials it. * * The option key comes from the driver descriptor rather than from the * renderer, so the shell asks for "this scope" and never has to know that * RocketMQ spells it `namespace`. * * Validated before it is stored, against the live connection. Storing a name * the driver would refuse leaves a profile that no longer opens at all, and * the switcher is gated on being connected - so the user would have no way * back to a working one.

func (*ConnectionService) Test

func (s *ConnectionService) Test(id int) (string, error)

Test probes a connection and reports the resulting status.

func (*ConnectionService) Update

func (s *ConnectionService) Update(id int, input ConnectionInput) (*ConnectionView, error)

Update applies a connection form submission, resolving the credentials mode against the currently stored secrets.

type ConnectionView

type ConnectionView struct {
	ID                int                    `json:"id"`
	Name              string                 `json:"name"`
	Group             string                 `json:"group"`
	Kind              model.MQKind           `json:"kind"`
	Endpoints         string                 `json:"endpoints"`
	TimeoutSec        int                    `json:"timeoutSec"`
	AuthMechanism     model.AuthMechanism    `json:"authMechanism"`
	Options           map[string]string      `json:"options"`
	SecretsConfigured []string               `json:"secretsConfigured"`
	Status            model.ConnectionStatus `json:"status"`
	LastCheck         string                 `json:"lastCheck"`
	IsDefault         bool                   `json:"isDefault"`
	Remark            string                 `json:"remark"`
}

ConnectionView is the connection shape sent to the frontend.

Stored credentials never leave the Go process. The renderer decides what to render from SecretsConfigured, which lists the keys that hold a value - a list rather than a pair of booleans, because how many credentials a connection has is the driver's business, not this struct's.

type ConsumerInput

type ConsumerInput struct {
	Group       string `json:"group"`
	BrokerAddr  string `json:"brokerAddr"`
	ConsumeMode string `json:"consumeMode"`
	MaxRetry    int    `json:"maxRetry"`
}

ConsumerInput carries a consumer group form submission.

type ConsumerService

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

ConsumerService exposes subscription operations to the frontend.

It speaks the canonical model. Consume mode, retry limits and the subscription and client lists travel in the attribute map, whose keys the frontend's rocketmq module reads.

func (*ConsumerService) Clients

func (s *ConsumerService) Clients(connID int, group string) ([]*model.SubscriptionClient, error)

Clients reports what each connected consumer in a group is doing: the queues it holds and how fast it is getting through them.

It is a separate call rather than part of Detail because it costs one round trip per connected client, and a group list should not pay that.

func (*ConsumerService) CloneOffset

func (s *ConsumerService) CloneOffset(connID int, request model.CloneOffsetRequest) error

CloneOffset copies one consumer group's read position onto another, which is how a replacement group starts where the old one is instead of replaying everything it already handled.

func (*ConsumerService) Create

func (s *ConsumerService) Create(connID int, input ConsumerInput) error

Create adds a consumer group on the target broker.

func (*ConsumerService) List

func (s *ConsumerService) List(connID int) ([]*model.Subscription, error)

List returns every consumer group.

func (*ConsumerService) Remove

func (s *ConsumerService) Remove(connID int, group string, brokerAddr string) error

Remove deletes a consumer group.

func (*ConsumerService) ResetOffset

func (s *ConsumerService) ResetOffset(connID int, request model.ResetOffsetRequest) error

ResetOffset moves a consumer group's read position.

func (*ConsumerService) SetQueueOffset

func (s *ConsumerService) SetQueueOffset(connID int, input QueueOffsetInput) error

SetQueueOffset writes one queue's committed offset for a group.

func (*ConsumerService) Stats

func (s *ConsumerService) Stats(connID int, group string) (map[string]interface{}, error)

Stats returns the per-queue consume progress of a group.

func (*ConsumerService) Update

func (s *ConsumerService) Update(connID int, input ConsumerInput) error

Update changes an existing consumer group.

type DefinitionsPreview added in v0.0.2

type DefinitionsPreview struct {
	// Path is empty when the user cancelled the dialog.
	Path     string         `json:"path"`
	Document string         `json:"document"`
	Counts   map[string]int `json:"counts"`
}

DefinitionsPreview is a chosen file, read and counted but not applied.

type DriverInfo

type DriverInfo struct {
	Kind        model.MQKind `json:"kind"`
	DefaultPort string       `json:"defaultPort"`
}

DriverInfo is one registered family.

type DriverService

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

DriverService tells the frontend which broker families exist, what their connection forms look like, and what a live connection can actually do.

It is what the renderer boots from: the navigation, the connection form and every gated control are derived from these three answers rather than hardcoded for one family.

func (*DriverService) Capabilities

func (s *DriverService) Capabilities(connID int) (*model.Capabilities, error)

Capabilities returns what one live connection can do.

An unopened connection reports nothing supported rather than an error: the renderer asks on every page load, including before anything is connected, and an error there would be noise rather than information.

func (*DriverService) Descriptor

func (s *DriverService) Descriptor(kind model.MQKind) (*model.DriverDescriptor, error)

Descriptor returns a family's connection form and best-case capabilities. It answers without a connection, because the form is drawn before anything is dialled.

func (*DriverService) List

func (s *DriverService) List() []DriverInfo

List returns every family a driver is compiled in for.

type EntryInput added in v0.0.5

type EntryInput struct {
	Stream string              `json:"stream"`
	Fields []model.StreamField `json:"fields"`
	// ID is an explicit entry id. Empty lets the server assign one, which is
	// what almost every producer does.
	ID string `json:"id"`
	// Count writes the same entry more than once, for filling a stream to try
	// a consumer against.
	Count int `json:"count"`
}

EntryInput is an entry as the send console collects it.

The fields are a list rather than an object because XADD takes an ordered one and the order is the producer's. A JSON object would arrive with whatever order the renderer's serialiser chose.

type ExchangeInput added in v0.0.2

type ExchangeInput struct {
	Vhost      string `json:"vhost"`
	Name       string `json:"name"`
	Type       string `json:"type"`
	Transient  bool   `json:"transient"`
	AutoDelete bool   `json:"autoDelete"`
	Arguments  string `json:"arguments"`
}

ExchangeInput is an exchange declaration as the form collects it.

type GooglePubSubPublishInput added in v0.1.0

type GooglePubSubPublishInput struct {
	Topic string `json:"topic"`
	Body  string `json:"body"`
	// Count sends the same body more than once. One when left at zero.
	Count int `json:"count"`
	// Attributes are the publisher's own, and the only thing a subscription
	// filter can select on - so a send meant for a filtered subscription has
	// to set them.
	Attributes map[string]string `json:"attributes"`
	// OrderingKey groups messages that must arrive in order relative to each
	// other. It only has an effect on a subscription created with ordering on.
	OrderingKey string `json:"orderingKey"`
}

GooglePubSubPublishInput is a send as the Pub/Sub console collects it.

Deliberately not MessageService.Send's shape. That one takes a topic, tags, keys and a delay level - RocketMQ's vocabulary, of which a Pub/Sub message has only the topic. There is no tag and no delay anywhere in the service.

type GooglePubSubPublishResult added in v0.1.0

type GooglePubSubPublishResult struct {
	Sent int `json:"sent"`
	// MessageID is the first message's. It addresses nothing - no Pub/Sub call
	// takes a message id - and is shown so a page can name what it produced.
	MessageID string `json:"messageId"`
}

GooglePubSubPublishResult is what the send did.

type GooglePubSubService added in v0.1.0

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

GooglePubSubService is the renderer's entry point for the operations only Google Pub/Sub has. Listing and describing topics go through the canonical services; what is here is the rest.

func (*GooglePubSubService) CreateSnapshot added in v0.1.0

func (s *GooglePubSubService) CreateSnapshot(connID int, name, subscription string) error

CreateSnapshot takes a restore point from one subscription.

func (*GooglePubSubService) CreateSubscription added in v0.1.0

func (s *GooglePubSubService) CreateSubscription(
	connID int, input GooglePubSubSubscriptionInput,
) error

CreateSubscription declares a subscription on a topic.

func (*GooglePubSubService) CreateTopic added in v0.1.0

func (s *GooglePubSubService) CreateTopic(connID int, input GooglePubSubTopicInput) error

CreateTopic declares a topic in the connection's project.

func (*GooglePubSubService) DeadLetterQueues added in v0.1.0

func (s *GooglePubSubService) DeadLetterQueues(connID int) ([]*model.DeadLetterQueue, error)

DeadLetterQueues finds the topics subscriptions give up into, and which subscriptions point at each of them.

A dead-letter topic in Pub/Sub is an ordinary topic with a subscription's policy aimed at it. Nothing marks one, so this is a walk backwards through the topology - and because the policy belongs to the subscription rather than to the topic, every source names both. A target every one of whose sources sits outside the connection's name prefix is not found, because the walk starts from what the prefix let through.

func (*GooglePubSubService) ListSnapshots added in v0.1.0

func (s *GooglePubSubService) ListSnapshots(connID int) ([]GooglePubSubSnapshot, error)

ListSnapshots is every restore point in the project.

func (*GooglePubSubService) Publish added in v0.1.0

Publish sends to one topic and reports how many the service accepted.

Accepted is not delivered. A topic stores nothing: the publish reaches whatever subscriptions exist at that instant and is discarded if none do, and the service reports success either way.

func (*GooglePubSubService) RemoveSnapshot added in v0.1.0

func (s *GooglePubSubService) RemoveSnapshot(connID int, name string) error

RemoveSnapshot deletes a restore point, and with it the reason the topic was holding everything it could restore.

func (*GooglePubSubService) RemoveSubscription added in v0.1.0

func (s *GooglePubSubService) RemoveSubscription(connID int, name string) error

RemoveSubscription deletes a subscription and everything it had not acknowledged. Those messages were never the topic's to hand out again.

func (*GooglePubSubService) RemoveTopic added in v0.1.0

func (s *GooglePubSubService) RemoveTopic(connID int, name string) error

RemoveTopic deletes a topic. Its subscriptions survive it, pointing at _deleted-topic_ and unable to receive anything ever again.

func (*GooglePubSubService) SeekToSnapshot added in v0.1.0

func (s *GooglePubSubService) SeekToSnapshot(connID int, subscription, snapshot string) error

SeekToSnapshot moves a subscription to a restore point.

The other half of Seek - moving to a moment in time - goes through the canonical consumer service, and is degraded against an emulator because the emulator answers it Unimplemented.

func (*GooglePubSubService) UpdateSubscription added in v0.1.0

func (s *GooglePubSubService) UpdateSubscription(
	connID int, input GooglePubSubSubscriptionInput,
) error

UpdateSubscription changes what a subscription lets be changed. The topic, the filter and message ordering are fixed at creation and are not among them.

func (*GooglePubSubService) UpdateTopic added in v0.1.0

func (s *GooglePubSubService) UpdateTopic(connID int, input GooglePubSubTopicInput) error

UpdateTopic changes an existing topic's settings. Labels are replaced wholesale, so a form editing them sends the complete set.

type GooglePubSubSnapshot added in v0.1.0

type GooglePubSubSnapshot struct {
	Name string `json:"name"`
	// Topic is what the subscription it was taken from reads. A snapshot can
	// only be sought to from a subscription on the same topic.
	Topic string `json:"topic"`
	// ExpiresAtMs is when the service will delete it. A snapshot lives seven
	// days, and until then the topic keeps everything it could restore.
	ExpiresAtMs int64 `json:"expiresAtMs"`
}

GooglePubSubSnapshot is a restore point taken from one subscription.

type GooglePubSubSubscriptionInput added in v0.1.0

type GooglePubSubSubscriptionInput struct {
	Name string `json:"name"`
	// Topic is required on a create and ignored on an update: a subscription
	// reads exactly one topic, chosen when it is made.
	Topic string `json:"topic"`

	AckDeadlineSec int  `json:"ackDeadlineSec"`
	RetentionSec   int  `json:"retentionSec"`
	RetainAcked    bool `json:"retainAcked"`
	ExactlyOnce    bool `json:"exactlyOnce"`

	// Filter and Ordering are fixed at creation. They are sent on an update
	// too and ignored there, so a form can round-trip one object.
	Filter   string `json:"filter"`
	Ordering bool   `json:"ordering"`

	// PushEndpoint makes this a push subscription, which Pub/Sub POSTs to
	// rather than holding for a reader.
	PushEndpoint string `json:"pushEndpoint"`

	// DeadLetterTopic is another topic's name; the driver resolves its path.
	// Empty on an update removes the policy, which is the only way to.
	DeadLetterTopic string `json:"deadLetterTopic"`
	MaxAttempts     int    `json:"maxAttempts"`

	RetryMinBackoffSec int `json:"retryMinBackoffSec"`
	RetryMaxBackoffSec int `json:"retryMaxBackoffSec"`

	// Labels are set at creation only: the emulator refuses them in an update
	// mask, and a control that fails against the reference environment is
	// worse than one that is not offered.
	Labels map[string]string `json:"labels"`
}

GooglePubSubSubscriptionInput is a subscription as its form collects it.

Deliberately not ConsumerService.Create's shape. That one takes a cluster, a broker address, a consume mode and a retry count - RocketMQ's vocabulary, of which a Pub/Sub subscription has none. What it has instead is the whole of the delivery configuration, because on this family that belongs to the subscription rather than to the topic it reads.

Every duration is zero when the form left it alone, which on an edit means "keep what is stored": the update mask is built from what is set, so an omitted setting survives.

type GooglePubSubTopicInput added in v0.1.0

type GooglePubSubTopicInput struct {
	Name string `json:"name"`

	// RetentionSec keeps published messages available for a subscription to
	// seek back into. Zero leaves it alone, which on an edit means "keep what
	// is stored" and on a create takes the service's default.
	RetentionSec int `json:"retentionSec"`

	// Labels replace the topic's whole set rather than merging into it, which
	// is the API's own behaviour: the update mask names the field, not one key.
	Labels map[string]string `json:"labels"`
}

GooglePubSubTopicInput is a topic as the topic form collects it.

Deliberately not TopicService.Create's shape. That one takes a broker address, two queue counts and a permission string - RocketMQ's vocabulary, of which a Pub/Sub topic has none. What a topic has instead is almost nothing, because everything about delivery belongs to the subscription.

type GroupInput added in v0.0.5

type GroupInput struct {
	Stream string `json:"stream"`
	Group  string `json:"group"`
	// StartID is where the group begins reading: "0" for everything the stream
	// still holds, "$" for only what arrives next. Empty means "$", which is
	// the answer that cannot flood a consumer with history.
	StartID string `json:"startId"`
}

GroupInput is a consumer group as the form collects it.

The stream is a field rather than part of the name because a group's name is unique only within its stream: two streams may each hold a "settle-group" and they are unrelated objects.

type IBMMQDestinationInput added in v0.1.0

type IBMMQDestinationInput struct {
	Name string `json:"name"`
	// Kind is "queue" or "topic", and it decides which interface the create
	// goes through: a queue is a REST resource and a topic is MQSC.
	Kind string `json:"kind"`

	// QueueType is local, alias, remote or model. Only a local queue stores
	// anything; the rest resolve somewhere else.
	QueueType string `json:"queueType"`
	// MaxDepth caps how many messages a local queue will hold. Zero leaves the
	// queue manager's own default, which is 5000 on a fresh installation.
	MaxDepth int `json:"maxDepth"`

	// TopicString is what publishers name, and it is required on a topic. It
	// is not the object's name: the object is where that string's settings are
	// attached, and two objects covering overlapping strings is ordinary.
	TopicString string `json:"topicString"`

	Description string `json:"description"`
}

IBMMQDestinationInput is a queue or a topic as the form collects it.

Deliberately not TopicService.Create's shape. That one takes a broker address, two queue counts and a permission string - RocketMQ's vocabulary, of which neither an MQ queue nor an MQ topic has any.

type IBMMQPublishInput added in v0.1.0

type IBMMQPublishInput struct {
	// Queue, not a topic: the messaging REST API has no topic resource at all,
	// so publishing needs an MQ client and this console cannot offer it.
	Queue string `json:"queue"`
	Body  string `json:"body"`
	// ContentType reaches the message descriptor's format. It has to be a
	// character type - the server refuses anything else outright.
	ContentType string `json:"contentType"`
	// CorrelationID is 48 hexadecimal characters or empty.
	CorrelationID string `json:"correlationId"`
	// Persistent decides whether the queue manager writes the message to its
	// log, and so whether it survives a restart.
	Persistent bool `json:"persistent"`
	// ExpirySeconds discards the message if nothing has read it by then. Zero
	// is MQ's own unlimited.
	ExpirySeconds int `json:"expirySeconds"`
	// Properties are attached under their own names, and are what a receiving
	// application reads back as message properties.
	Properties map[string]string `json:"properties"`
	// Count sends the same body more than once. Each copy is its own request.
	Count int `json:"count"`
}

IBMMQPublishInput is a send as the IBM MQ console collects it.

Deliberately not MessageService.Send's shape. That one takes a topic, tags, keys and a delay level; an MQ message has a descriptor instead - a correlation identifier, a persistence, an expiry and whatever properties the sender attached - and nothing anywhere in the queue manager holds a message back until later.

type IBMMQPublishResult added in v0.1.0

type IBMMQPublishResult struct {
	Sent int `json:"sent"`
	// MessageID is the first message's, as the queue manager assigned it. It
	// is the handle the browse lists, so it is worth handing straight back.
	MessageID string `json:"messageId"`
}

IBMMQPublishResult is what the send did.

type IBMMQService added in v0.1.0

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

IBMMQService is the renderer's entry point for the operations only IBM MQ has. Listing and describing queues and topics go through the canonical services; what is here is the rest.

func (*IBMMQService) Channels added in v0.1.0

func (s *IBMMQService) Channels(connID int) ([]*model.Channel, error)

Channels lists every channel definition and what is running on it.

Definitions rather than connections, and the difference is the page: a channel is listed whether or not anything is using it, because it is what decides whether anything may - so a queue manager whose applications are all idle still has rows here, which is exactly when somebody is looking for why they cannot connect.

func (*IBMMQService) CreateDestination added in v0.1.0

func (s *IBMMQService) CreateDestination(connID int, input IBMMQDestinationInput) error

CreateDestination declares a queue or a topic on the queue manager.

func (*IBMMQService) DeadLetterQueues added in v0.1.0

func (s *IBMMQService) DeadLetterQueues(connID int) ([]*model.DeadLetterQueue, error)

DeadLetterQueues lists the queues something else dead-letters into.

Found by walking every queue's configuration backwards rather than by looking up a name: nothing marks a dead-letter queue on this family, and what makes one is the queue manager's DEADQ attribute or another queue's backout queue pointing at it.

func (*IBMMQService) Publish added in v0.1.0

func (s *IBMMQService) Publish(connID int, input IBMMQPublishInput) (*IBMMQPublishResult, error)

Publish sends to one queue and reports what the queue manager took.

func (*IBMMQService) QueueManager added in v0.1.0

func (s *IBMMQService) QueueManager(connID int) (string, error)

QueueManager is which queue manager this connection speaks to.

func (*IBMMQService) RemoveDestination added in v0.1.0

func (s *IBMMQService) RemoveDestination(connID int, name string, purge bool) error

RemoveDestination deletes a queue or a topic.

purge decides what happens to a queue that is not empty: without it the queue manager refuses, with it the messages go too and there is no undo. A queue an application has open is refused either way.

type IdentityInput added in v0.0.2

type IdentityInput struct {
	Name string   `json:"name"`
	Tags []string `json:"tags"`
	// Password empty keeps whatever is stored.
	Password string `json:"password"`
	// WithoutPassword asks for a user that cannot authenticate with one. It is
	// the opposite instruction from an empty password, not the same one.
	WithoutPassword bool `json:"withoutPassword"`
}

IdentityInput creates or updates a user.

type KafkaService added in v0.0.3

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

KafkaService exposes what only Kafka has.

It is one service rather than several because it is one family's surface: splitting topic administration, quotas and reassignment into three would put three names in the bindings for what a reader thinks of as "the Kafka pages".

Reading topics, groups and brokers is not here. Those are destinations, subscriptions and nodes, and the canonical services already answer them; a second read path would be two sources for one number.

func (*KafkaService) AccessControl added in v0.0.3

func (s *KafkaService) AccessControl(connID int) (*AccessView, error)

AccessControl reports the cluster's ACLs and the users it stores.

func (*KafkaService) AlterQuota added in v0.0.3

func (s *KafkaService) AlterQuota(
	connID int, entity []model.QuotaEntity, set map[string]float64, remove []string,
) error

AlterQuota sets the limits in set and removes the keys in remove.

func (*KafkaService) AlterTopicConfigs added in v0.0.3

func (s *KafkaService) AlterTopicConfigs(connID int, name string, configs map[string]string) error

AlterTopicConfigs changes only the settings it is given. An empty value puts a setting back to the cluster default rather than setting it to nothing.

func (*KafkaService) CancelReassignment added in v0.0.3

func (s *KafkaService) CancelReassignment(connID int, topic string, partition int32) error

CancelReassignment stops a move in flight, leaving the partition wherever it has got to.

func (*KafkaService) CloneGroupOffsets added in v0.0.3

func (s *KafkaService) CloneGroupOffsets(connID int, from, to, topic string) error

CloneGroupOffsets copies one group's positions onto another, which is how a replacement consumer group starts where the old one is instead of replaying everything it already handled.

func (*KafkaService) CreateTopic added in v0.0.3

func (s *KafkaService) CreateTopic(connID int, input KafkaTopicInput) error

CreateTopic declares a topic.

func (*KafkaService) DeleteGroup added in v0.0.3

func (s *KafkaService) DeleteGroup(connID int, group string) error

DeleteGroup removes a consumer group and the offsets it holds.

func (*KafkaService) DeleteGroupOffsets added in v0.0.3

func (s *KafkaService) DeleteGroupOffsets(connID int, group string, topics []string) error

DeleteGroupOffsets forgets a group's position on some topics without deleting the group.

func (*KafkaService) DeleteTopic added in v0.0.3

func (s *KafkaService) DeleteTopic(connID int, name string) error

DeleteTopic removes a topic and everything in it.

It returns once the cluster agrees the topic is gone rather than once the delete is accepted, so a board that re-reads on success does not list what was just deleted.

func (*KafkaService) DropOldestRecords added in v0.0.3

func (s *KafkaService) DropOldestRecords(connID int, name string, limit int) (int, error)

DropOldestRecords takes a bounded batch off the head of each partition and returns how many it actually removed - which is not always what was asked for, because a partition holding less gives up only what it has.

func (*KafkaService) ElectPreferredLeaders added in v0.0.3

func (s *KafkaService) ElectPreferredLeaders(connID int) error

ElectPreferredLeaders puts each partition's leadership back on the first broker in its replica list, which is where Kafka put it when the topic was created and where a broker restart moves it away from.

func (*KafkaService) LogDirs added in v0.0.3

func (s *KafkaService) LogDirs(connID int) (*LogDirView, error)

LogDirs reports where a cluster's disk has gone.

func (*KafkaService) PutAccessRule added in v0.0.3

func (s *KafkaService) PutAccessRule(connID int, rule model.AccessRule) error

PutAccessRule writes every policy a subject should have.

func (*KafkaService) PutPrincipal added in v0.0.3

func (s *KafkaService) PutPrincipal(connID int, spec model.AccessPrincipalSpec) error

PutPrincipal creates or updates a SCRAM user. The password is write-only: Kafka stores it salted and cannot be asked for it again.

func (*KafkaService) Quotas added in v0.0.3

func (s *KafkaService) Quotas(connID int) (*QuotaView, error)

Quotas reports the limits attached to clients rather than to topics.

func (*KafkaService) Reassign added in v0.0.3

func (s *KafkaService) Reassign(connID int, topic string, partition int32, brokers []int32) error

Reassign rewrites where one partition's replicas live. The order matters: the first broker becomes the preferred leader.

func (*KafkaService) Reassignments added in v0.0.3

func (s *KafkaService) Reassignments(connID int) ([]*model.PartitionReassignment, error)

Reassignments reports the partitions being moved between brokers right now.

func (*KafkaService) RemoveAccessRule added in v0.0.3

func (s *KafkaService) RemoveAccessRule(connID int, subject string) error

RemoveAccessRule deletes every rule belonging to a principal.

func (*KafkaService) RemovePrincipal added in v0.0.3

func (s *KafkaService) RemovePrincipal(connID int, name string) error

RemovePrincipal deletes a user's password for every mechanism it has.

func (*KafkaService) RemoveQuota added in v0.0.3

func (s *KafkaService) RemoveQuota(connID int, entity []model.QuotaEntity, keys []string) error

RemoveQuota clears every limit on an entity, which is how a quota stops existing.

func (*KafkaService) ResetGroupOffsets added in v0.0.3

func (s *KafkaService) ResetGroupOffsets(connID int, input OffsetResetInput) error

ResetGroupOffsets writes a consumer group's committed offsets.

Kafka refuses this while the group has live members. That refusal reaches the user as-is: the fix is to stop the consumers, and saying so is more use than a reset a running consumer would overwrite moments later.

func (*KafkaService) SendRecord added in v0.0.3

func (s *KafkaService) SendRecord(connID int, input RecordInput) (*kafkadriver.RecordResult, error)

SendRecord publishes and reports the partition and offset it landed on.

func (*KafkaService) Transactions added in v0.0.3

func (s *KafkaService) Transactions(connID int) (*TransactionView, error)

Transactions reports the transactional producers the cluster knows about.

func (*KafkaService) TruncateTopic added in v0.0.3

func (s *KafkaService) TruncateTopic(connID int, name string) error

TruncateTopic empties a topic without deleting it.

The offsets do not restart: a consumer that was at 900 stays at 900 and is simply caught up, which is what makes this safe on a topic something reads.

type KafkaTopicInput added in v0.0.3

type KafkaTopicInput struct {
	Name string `json:"name"`

	// Partitions and ReplicationFactor are fixed at creation. Zero means "let
	// the broker use its own default", which is what an operator who left the
	// field alone meant.
	Partitions        int `json:"partitions"`
	ReplicationFactor int `json:"replicationFactor"`

	// Configs are Kafka's own setting names - cleanup.policy, retention.ms -
	// passed through as given. This app does not curate the list: a cluster
	// knows settings this build has never heard of, and refusing them would
	// make the form less capable than kafka-topics.sh.
	Configs map[string]string `json:"configs"`
}

KafkaTopicInput is a topic declaration as the Kafka form collects it.

Deliberately not TopicService.Create's shape. That one takes a broker address, a read queue count, a write queue count and a permission string, which is RocketMQ's vocabulary: a Kafka topic has none of those, and a form that filled them in with placeholders would be lying about what it sent.

type KinesisPublishInput added in v0.1.0

type KinesisPublishInput struct {
	Stream string `json:"stream"`
	Body   string `json:"body"`
	// PartitionKey is required. Kinesis hashes it into the 128-bit key space
	// and the shard whose range covers the hash takes the record, so it is
	// what decides where a record lands and the only ordering guarantee the
	// service makes is between records sharing one.
	PartitionKey string `json:"partitionKey"`
	// ExplicitHashKey overrides that hash with one the sender chooses, which
	// is the only way to aim a record at a named shard. Blank is the ordinary
	// case.
	ExplicitHashKey string `json:"explicitHashKey"`
	// Count sends the same body more than once. One when left at zero. Each
	// copy gets its own partition key suffix unless a hash key aims them all
	// at one shard.
	Count int `json:"count"`
}

KinesisPublishInput is a send as the Kinesis console collects it.

Deliberately not MessageService.Send's shape. That one takes a topic, tags, keys and a delay level - RocketMQ's vocabulary, of which a Kinesis record has the destination and the partition key. There is no header table, no tag and nothing anywhere in the service that holds a record back.

type KinesisPublishResult added in v0.1.0

type KinesisPublishResult struct {
	Sent int `json:"sent"`
	// SequenceNumber and ShardID are the first record's, and both are given
	// because neither addresses a record on its own.
	SequenceNumber string `json:"sequenceNumber"`
	ShardID        string `json:"shardId"`
	// Failed counts records the service refused individually. A send that
	// raised no error can still have refused most of its batch.
	Failed int `json:"failed"`
}

KinesisPublishResult is what the send did.

type KinesisService added in v0.1.0

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

KinesisService is the renderer's entry point for the operations only Amazon Kinesis has. Listing and describing streams go through the canonical services; what is here is the rest.

func (*KinesisService) CreateStream added in v0.1.0

func (s *KinesisService) CreateStream(connID int, input KinesisStreamInput) error

CreateStream declares a stream in the connection's region.

func (*KinesisService) DeregisterConsumer added in v0.1.0

func (s *KinesisService) DeregisterConsumer(connID int, stream, name string) error

DeregisterConsumer removes a registration.

The stream is required as well as the name: a consumer name is unique only within its stream, and every call that names one takes the stream too.

func (*KinesisService) Publish added in v0.1.0

func (s *KinesisService) Publish(connID int, input KinesisPublishInput) (*KinesisPublishResult, error)

Publish sends to one stream and reports what the service took.

func (*KinesisService) RegisterConsumer added in v0.1.0

func (s *KinesisService) RegisterConsumer(connID int, stream, name string) error

RegisterConsumer registers an enhanced fan-out consumer on a stream.

Registering is not subscribing. It reserves the name and the dedicated two megabytes a second of read throughput this consumer gets on every shard; an application then subscribes against the ARN. Nothing here reads on its behalf, and the registration outlives whatever does.

func (*KinesisService) RemoveStream added in v0.1.0

func (s *KinesisService) RemoveStream(connID int, name string) error

RemoveStream deletes a stream and every record in it.

A stream with registered consumers is refused rather than cascaded: an enhanced fan-out consumer is an application somebody stood up, and removing it as a side effect would be a bigger action than the one asked for.

func (*KinesisService) Shards added in v0.1.0

func (s *KinesisService) Shards(connID int, stream string) ([]*model.Shard, error)

Shards lists a stream's shards, open and closed.

Closed ones are included on purpose. A shard split or merged yesterday takes no more writes and still holds every record written to it until retention expires, so leaving it out would hide both those records and the reason the stream reports fewer open shards than the page lists rows.

func (*KinesisService) UpdateStream added in v0.1.0

func (s *KinesisService) UpdateStream(connID int, input KinesisStreamInput) error

UpdateStream changes an existing stream's capacity mode, shard count or retention.

Not one call: each of the three is its own asynchronous operation and each is refused while the stream is settling from the last, so this returns when the last of them has been accepted rather than when the stream is done.

type KinesisStreamInput added in v0.1.0

type KinesisStreamInput struct {
	Name string `json:"name"`
	// OnDemand hands the capacity to AWS. It is the one field that decides
	// whether Shards means anything: CreateStream refuses a shard count beside
	// an on-demand mode, and UpdateShardCount refuses an on-demand stream.
	OnDemand bool `json:"onDemand"`
	// Shards is the target for a provisioned stream. On an edit the service
	// reaches it by splitting and merging, which leaves the old shards closed
	// and still holding their records.
	Shards int `json:"shards"`
	// RetentionHours is between 24 and 8760. Zero on an edit means "keep what
	// is stored", which is what lets a resize leave the retention alone.
	RetentionHours int `json:"retentionHours"`
}

KinesisStreamInput is a stream as the stream form collects it.

Deliberately not TopicService.Create's shape. That one takes a broker address, two queue counts and a permission string - RocketMQ's vocabulary, of which a Kinesis stream has none.

type LogDirView added in v0.0.3

type LogDirView struct {
	Dirs []*model.LogDirSummary `json:"dirs"`
	// Largest is the biggest partitions across the cluster, which is what an
	// operator opens this for.
	Largest []*model.LogDirPartition `json:"largest"`

	// Total is the occupied bytes across every directory that answered, and
	// Failed is how many did not. A directory that cannot be described is
	// counted separately rather than as zero: a disk that will not answer must
	// not make a cluster look smaller than it is.
	Total  int64 `json:"total"`
	Failed int   `json:"failed"`
}

LogDirView is the cluster page's storage tab in one round trip.

type MQTTFilterInput added in v0.0.5

type MQTTFilterInput struct {
	Pattern string `json:"pattern"`
	QoS     byte   `json:"qos"`
}

MQTTFilterInput is one filter and the QoS to subscribe at.

type MQTTPublishInput added in v0.0.5

type MQTTPublishInput struct {
	Topic   string `json:"topic"`
	Payload string `json:"payload"`

	// QoS decides what an acknowledgement can mean. At 0 there is none at all,
	// and the result says so rather than reporting a delivery.
	QoS byte `json:"qos"`
	// Retain keeps this as the topic's last known value, replayed to whoever
	// subscribes next. It is the only stored state MQTT has.
	Retain bool `json:"retain"`
	// Count sends the same message more than once, for filling a board.
	Count int `json:"count"`

	// Everything below is MQTT 5.0 only, and refused rather than dropped on a
	// 3.1.1 connection.
	ContentType     string            `json:"contentType"`
	ResponseTopic   string            `json:"responseTopic"`
	CorrelationData string            `json:"correlationData"`
	MessageExpiry   uint32            `json:"messageExpiry"`
	UserProperties  map[string]string `json:"userProperties"`
}

MQTTPublishInput is a publish as the MQTT send console collects it.

Deliberately not MessageService.Publish's shape. That one carries an exchange, a routing key, a mandatory flag and a priority, which are AMQP's vocabulary and have no MQTT meaning - and it has nowhere to put QoS, the retain flag, or the 5.0 properties, which are most of what an MQTT publish is. A form that filled the first set in with placeholders would be lying about what it sent.

type MQTTService added in v0.0.5

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

MQTTService exposes what only MQTT has.

It is one service rather than several because it is one family's surface, the same reason KafkaService is one.

Reading retained topics and the broker's nodes is not here. Those are destinations and nodes, and the canonical services already answer them; a second read path would be two sources for one number.

Connected clients are here despite being a canonical model, because there is no canonical service to put them on: client inspection has never had one, and RabbitMQ exposes its own the same way. Adding a shared service for two families to use would be inventing a seam neither asked for.

func (*MQTTService) BrokerSubscriptions added in v0.0.5

func (s *MQTTService) BrokerSubscriptions(
	ctx context.Context, connID int,
) ([]*mqttdriver.ClientSubscription, error)

BrokerSubscriptions is every filter the broker is holding, across clients.

func (*MQTTService) ClientSubscriptions added in v0.0.5

func (s *MQTTService) ClientSubscriptions(
	ctx context.Context, connID int, clientID string,
) ([]*mqttdriver.ClientSubscription, error)

ClientSubscriptions is the topic filters one client holds.

func (*MQTTService) Clients added in v0.0.5

func (s *MQTTService) Clients(
	ctx context.Context, connID int,
) ([]*model.ClientConnection, error)

Clients is who the broker is holding a session for.

func (*MQTTService) KickClient added in v0.0.5

func (s *MQTTService) KickClient(ctx context.Context, connID int, clientID string) error

KickClient ends one client's session. MQTT carries no reason on a disconnect, so there is none to pass.

func (*MQTTService) KickUser added in v0.0.5

func (s *MQTTService) KickUser(ctx context.Context, connID int, username string) error

KickUser ends every session a username holds.

func (*MQTTService) PollSubscription added in v0.0.5

func (s *MQTTService) PollSubscription(
	ctx context.Context, connID int, id string, after int64, limit int,
) (*model.LiveBatch, error)

PollSubscription drains what arrived after the caller's last sequence.

func (*MQTTService) Publish added in v0.0.5

func (s *MQTTService) Publish(
	ctx context.Context, connID int, input MQTTPublishInput,
) (*mqttdriver.PublishResult, error)

Publish sends a message with everything MQTT can carry.

func (*MQTTService) StartSubscription added in v0.0.5

func (s *MQTTService) StartSubscription(
	ctx context.Context, connID int, input MQTTSubscribeInput,
) (*model.LiveSubscription, error)

StartSubscription opens a live stream and starts buffering it.

The stream lives on the connection, not on this call: the renderer polls it afterwards and has to stop it when its panel closes, because the subscription is real on the broker until it does.

func (*MQTTService) StopSubscription added in v0.0.5

func (s *MQTTService) StopSubscription(ctx context.Context, connID int, id string) error

StopSubscription ends a stream and unsubscribes on the broker.

func (*MQTTService) Subscriptions added in v0.0.5

func (s *MQTTService) Subscriptions(
	ctx context.Context, connID int,
) ([]*model.LiveSubscription, error)

Subscriptions is what this connection is currently streaming.

type MQTTSubscribeInput added in v0.0.5

type MQTTSubscribeInput struct {
	// Filters are MQTT topic filters, with + and # as the protocol spells
	// them. They are not translated into a neutral form: the two wildcards
	// mean different things and a family-neutral pattern would lose that.
	Filters []MQTTFilterInput `json:"filters"`
	// Buffer bounds what is held between two polls. Zero takes the driver's
	// default.
	Buffer int `json:"buffer"`
}

MQTTSubscribeInput asks for a live stream.

type MaintenanceTaskView

type MaintenanceTaskView struct {
	Task string `json:"task"`
	// Destructive marks a task that removes message data rather than only
	// reclaiming what is already unreachable, so the UI can confirm it harder.
	Destructive bool `json:"destructive"`
}

MaintenanceTaskView is one offerable housekeeping job.

type MessageQuery

type MessageQuery struct {
	Topic      string `json:"topic"`
	Key        string `json:"key"`
	Tag        string `json:"tag"`
	MaxResults int    `json:"maxResults"`
	StartTime  int64  `json:"startTime"`
	EndTime    int64  `json:"endTime"`

	// Filters carries what only one family can narrow by, keyed by names that
	// family's driver and its frontend module agree on - a RabbitMQ routing
	// key or header, a Kafka header. Tag stays its own field because the
	// RocketMQ form has always sent it there.
	Filters map[string]string `json:"filters"`
}

MessageQuery carries the message search form.

type MessageService

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

MessageService exposes message browse and publish to the frontend.

func (*MessageService) ByID

func (s *MessageService) ByID(connID int, topic string, messageID string) (*model.MessageItem, error)

ByID returns a single message by its ID.

func (*MessageService) DLQ

func (s *MessageService) DLQ(connID int, group string, maxResults int) ([]*model.MessageItem, error)

DLQ returns the dead letter messages of a consumer group.

func (*MessageService) Producers

func (s *MessageService) Producers(connID int, group string, topic string) ([]*model.ProducerClient, error)

Producers lists the publishers connected under a producer group.

func (*MessageService) Query

func (s *MessageService) Query(connID int, query MessageQuery) ([]*model.MessageItem, error)

Query searches a topic by key, tag and time range.

A non-positive MaxResults is passed through rather than filled in here: the page size is an application setting, and the service is what holds it.

func (*MessageService) Replay

func (s *MessageService) Replay(connID int, input ReplayInput) (*model.ReplayResult, error)

Replay asks one connected consumer to handle a message again and returns what its own handler reported.

func (*MessageService) Resend

func (s *MessageService) Resend(connID int, input ResendInput) (string, error)

Resend pushes a message back to a consumer client and returns the new ID.

func (*MessageService) Retry

func (s *MessageService) Retry(connID int, group string, maxResults int) ([]*model.MessageItem, error)

Retry returns the retry messages of a consumer group.

func (*MessageService) Send

func (s *MessageService) Send(connID int, input SendInput) (string, error)

Send produces a message and returns its ID.

func (*MessageService) Tail

func (s *MessageService) Tail(
	connID int,
	topic string,
	cursor model.TailCursor,
	limit int,
) (*model.TailBatch, error)

Tail returns what a topic has received since the cursor, and the cursor to pass next time. The renderer drives the interval; Go holds nothing open.

func (*MessageService) Track

func (s *MessageService) Track(connID int, topic string, messageID string) ([]*model.MessageTrackItem, error)

Track returns the per-group consume status of a message.

type MoveInput added in v0.0.2

type MoveInput struct {
	Vhost string `json:"vhost"`
	From  string `json:"from"`
	// ToExchange empty is the default exchange, which routes by queue name.
	ToExchange string `json:"toExchange"`
	// ToRoutingKey empty means each message keeps its own.
	ToRoutingKey string `json:"toRoutingKey"`
	Limit        int    `json:"limit"`
}

MoveInput drains one queue into an exchange.

type NATSConsumerInput added in v0.0.6

type NATSConsumerInput struct {
	// Stream is not optional. Two streams may both have a consumer called
	// "worker", so a name alone does not identify one.
	Stream string `json:"stream"`
	Name   string `json:"name"`
	// Durable keeps the consumer and its position when nothing is using it.
	// An ephemeral one is cleaned up, which is what makes this a choice rather
	// than a default.
	Durable bool `json:"durable"`

	// DeliverPolicy is where a new consumer starts. It cannot be changed
	// afterwards - the server refuses - which is why this driver offers no
	// offset reset.
	DeliverPolicy string `json:"deliverPolicy"`
	AckPolicy     string `json:"ackPolicy"`
	AckWait       string `json:"ackWait"`
	MaxDeliver    string `json:"maxDeliver"`
	MaxAckPending string `json:"maxAckPending"`
	// FilterSubject narrows what this consumer takes from the stream. Several
	// may be given, separated however the form separated them.
	FilterSubject string `json:"filterSubject"`
	ReplayPolicy  string `json:"replayPolicy"`

	// DeliverSubject makes it a push consumer: the server sends to that
	// subject instead of waiting to be asked. Empty is a pull consumer, which
	// is the ordinary case.
	DeliverSubject string `json:"deliverSubject"`
	DeliverGroup   string `json:"deliverGroup"`
}

NATSConsumerInput is a consumer as the NATS dialog collects it.

The name carries the family because every bridge type shares one Go package and ConsumerService already has a ConsumerInput of its own - which is the RocketMQ-shaped one this exists instead of.

Deliberately not ConsumerService.Create's shape. That collects a group name, a broker address, a consume mode and a retry count - RocketMQ's vocabulary - and has nowhere for the stream a JetStream consumer lives on, which is half of its address.

type NATSPublishInput added in v0.0.6

type NATSPublishInput struct {
	Subject string            `json:"subject"`
	Payload string            `json:"payload"`
	Headers map[string]string `json:"headers"`
	// Count sends the same message more than once, for filling a board.
	Count int `json:"count"`

	// Persist waits for a stream to say it stored the message. Without it the
	// send is core NATS: it reaches whoever is listening at that instant and
	// the server says nothing back.
	Persist bool `json:"persist"`
	// ExpectStream refuses the send unless that stream is the one capturing
	// the subject, which is the guard against a typo landing somewhere else.
	ExpectStream string `json:"expectStream"`
	// DeduplicationID is Nats-Msg-Id, honoured inside the stream's duplicate
	// window.
	DeduplicationID string `json:"deduplicationId"`
	// ReplyTimeoutMs turns the send into a request and waits that long.
	ReplyTimeoutMs int `json:"replyTimeoutMs"`
}

NATSPublishInput is a publish as the NATS send console collects it.

Deliberately not MessageService.Publish's shape. That one carries an exchange, a routing key, a mandatory flag and a priority - AMQP's vocabulary - and has nowhere for a subject's headers, for the choice between a core send and a stored one, or for a reply timeout, which are most of what a NATS publish is.

type NATSService added in v0.0.6

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

NATSService exposes what only NATS has.

It is one service rather than several because it is one family's surface, the same reason MQTTService and KafkaService are one each.

Reading streams is not here. A stream is a destination and TopicService already answers the whole read side; a second read path would be two sources for one number. What is here is the writing, which the canonical service cannot express: its create collects a broker address, a read queue, a write queue and a permission mask, and a JetStream stream has none of those.

func (*NATSService) Accounts added in v0.0.6

func (s *NATSService) Accounts(connID int) ([]*model.Namespace, error)

Accounts lists the accounts on the cluster.

On this service rather than a canonical one because there is no canonical namespace service: RabbitMQ's vhosts are read through its own, for the same reason. What an account carries is nothing like what a vhost does, and a shared service would have to be the union of two families' vocabularies.

func (*NATSService) Census added in v0.0.6

func (s *NATSService) Census(connID int) (*model.BrokerCensus, error)

Census counts what the account holds.

func (*NATSService) CloseConnection added in v0.0.6

func (s *NATSService) CloseConnection(connID int, name, reason string) error

CloseConnection disconnects one client.

The name is the server holding it and its client id, joined - neither half addresses a connection on its own, because a client id counts within one server and two servers in a cluster each have a client 7.

func (*NATSService) CloseUserConnections added in v0.0.6

func (s *NATSService) CloseUserConnections(connID int, user, reason string) error

CloseUserConnections closes every connection one identity holds, which is how an application with several instances is actually evicted.

func (*NATSService) Connections added in v0.0.6

func (s *NATSService) Connections(connID int, account string) ([]*model.ClientConnection, error)

Connections lists the sockets open against the cluster.

Here rather than on a canonical service because there is none: client inspection has never had one, and MQTT and RabbitMQ each expose their own for the same reason. Adding a shared service for three families to use would be inventing a seam none of them asked for.

func (*NATSService) CreateConsumer added in v0.0.6

func (s *NATSService) CreateConsumer(connID int, input NATSConsumerInput) error

CreateConsumer declares a consumer that does not exist yet.

func (*NATSService) CreateStream added in v0.0.6

func (s *NATSService) CreateStream(connID int, input StreamInput) error

CreateStream declares a stream that does not exist yet.

Separate from UpdateStream rather than one idempotent call, because the two mistakes they prevent are different: a create that quietly became an update would rewrite another application's subjects, and an update that quietly became a create would hide a stream somebody had deleted underneath the page.

func (*NATSService) DeleteConsumer added in v0.0.6

func (s *NATSService) DeleteConsumer(connID int, stream, name string) error

DeleteConsumer removes a consumer and the position it held.

func (*NATSService) DeleteMessages added in v0.0.6

func (s *NATSService) DeleteMessages(connID int, stream string, sequences []string) (*model.TrimResult, error)

DeleteMessages removes messages by sequence.

func (*NATSService) DeleteStream added in v0.0.6

func (s *NATSService) DeleteStream(connID int, name string) error

DeleteStream removes a stream and every message in it.

func (*NATSService) Health added in v0.0.6

func (s *NATSService) Health(connID int) (*model.BrokerHealth, error)

Health runs the server's own checks.

Three of them rather than one, because /healthz answers a different question per set of parameters: a server can be up and serving core NATS perfectly while its JetStream assets are still being recovered, and an operator needs to know which part is unhealthy.

func (*NATSService) PollSubscription added in v0.0.6

func (s *NATSService) PollSubscription(connID int, id string, after int64, limit int) (*model.LiveBatch, error)

PollSubscription drains what has arrived since the caller's cursor.

func (*NATSService) Publish added in v0.0.6

func (s *NATSService) Publish(connID int, input NATSPublishInput) (*natsdriver.PublishResult, error)

Publish sends a message and reports what the server said, which depends on how much was asked of it.

func (*NATSService) PurgeStream added in v0.0.6

func (s *NATSService) PurgeStream(connID int, input PurgeInput) (*model.TrimResult, error)

PurgeStream discards messages from a stream and reports how many went.

The count is the report rather than a formality: it is the only way to tell a bound that already held from one that matched nothing at all, and those look identical on the page.

func (*NATSService) StartSubscription added in v0.0.6

func (s *NATSService) StartSubscription(connID int, input NATSSubscribeInput) (*model.LiveSubscription, error)

StartSubscription begins following one or more subjects.

func (*NATSService) StopSubscription added in v0.0.6

func (s *NATSService) StopSubscription(connID int, id string) error

StopSubscription ends one. Not optional: it lives on the server until it is stopped.

func (*NATSService) Subscriptions added in v0.0.6

func (s *NATSService) Subscriptions(connID int) ([]*model.LiveSubscription, error)

Subscriptions is what is running.

func (*NATSService) UpdateConsumer added in v0.0.6

func (s *NATSService) UpdateConsumer(connID int, input NATSConsumerInput) error

UpdateConsumer rewrites an existing consumer's configuration.

Not its position: the server refuses to change where a consumer starts once it exists, and the only way to move one is to delete it and make another - which changes its identity and drops what it had acknowledged.

func (*NATSService) UpdateStream added in v0.0.6

func (s *NATSService) UpdateStream(connID int, input StreamInput) error

UpdateStream rewrites an existing stream's configuration.

Some fields cannot change - storage, and the retention policy of a stream that already holds messages. The server refuses those itself and says which, which is why nothing here pre-empts it: a rule copied into the client is a rule that goes stale a release later.

func (*NATSService) Usage added in v0.0.6

func (s *NATSService) Usage(connID int) (*natsdriver.AccountUsage, error)

Usage reads the account's JetStream meters, limits included.

The limits travel with the usage because a meter needs both, and -1 is how the server spells "no cap" - a bar drawn against -1 can never move, so the page has to be able to tell that from a limit of zero.

type NATSSubscribeInput added in v0.0.6

type NATSSubscribeInput struct {
	// Subjects are patterns, so wildcards are the point here rather than the
	// mistake they are on a publish.
	Subjects []string `json:"subjects"`
	// QueueGroup shares the messages between everything subscribed under that
	// name instead of each receiving all of them. It is offered because
	// watching a subject a service is already consuming is otherwise a way to
	// take its traffic.
	QueueGroup string `json:"queueGroup"`
	// Buffer is how many messages to hold between polls. Zero takes the
	// driver's default.
	Buffer int `json:"buffer"`
}

NATSSubscribeInput is a live subscription as the workbench asks for one.

type NSQChannelInput added in v0.1.0

type NSQChannelInput struct {
	Topic   string `json:"topic"`
	Channel string `json:"channel"`
}

NSQChannelInput names a channel, which takes two fields because a channel belongs to a topic: "analytics" under two topics is two channels with nothing in common.

type NSQPublishInput added in v0.1.0

type NSQPublishInput struct {
	Topic string `json:"topic"`
	Body  string `json:"body"`
	// Count sends the same body more than once. One when left at zero.
	Count int `json:"count"`
	// DelaySec holds the message back from the channels. nsqd caps it at its
	// --max-req-timeout, one hour by default.
	DelaySec int `json:"delaySec"`
	// Node is host:port. Empty means the first nsqd in the connection.
	Node string `json:"node"`
}

NSQPublishInput is a send as the NSQ console collects it.

Deliberately not MessageService.Send's shape. That one takes a topic, tags, keys and a delay level - RocketMQ's vocabulary, of which an NSQ message has only the topic and the delay. What it cannot carry is the one field that matters here: which nsqd takes the message, because the daemon that took it is the one holding it.

type NSQPublishResult added in v0.1.0

type NSQPublishResult struct {
	Sent int    `json:"sent"`
	Node string `json:"node"`
}

NSQPublishResult is what the send did, and where it went.

type NSQService added in v0.1.0

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

NSQService is the renderer's entry point for the operations only NSQ has. Topics, channels and publishing all go through the canonical services; what is here is the rest.

func (*NSQService) Connections added in v0.1.0

func (s *NSQService) Connections(connID int) ([]*model.ClientConnection, error)

Connections lists every consumer holding a subscription open on the cluster.

Consumers only. A client appears in the stats of the channel it subscribed to and nowhere else, so a connection that has not subscribed yet and a producer are both absent - which is why the page is titled for what it shows rather than for every socket the daemons hold.

func (*NSQService) CreateChannel added in v0.1.0

func (s *NSQService) CreateChannel(connID int, input NSQChannelInput) error

CreateChannel declares a channel on every nsqd carrying its topic.

There is no position to start it from. What it gets is whatever nsqd is still holding: nothing, on a topic that already has a channel, and the topic's own queue on one that had none to copy into.

func (*NSQService) CreateTopic added in v0.1.0

func (s *NSQService) CreateTopic(connID int, name string) error

CreateTopic declares a topic on every nsqd in the connection.

Not TopicService.Create, whose input is a broker address, two queue counts and a permission string - RocketMQ's vocabulary, of which an NSQ topic has none. A name is the whole of what one is.

func (*NSQService) EmptyChannel added in v0.1.0

func (s *NSQService) EmptyChannel(connID int, input NSQChannelInput) error

EmptyChannel discards one channel's backlog and leaves the rest of the topic alone, which is what separates it from emptying the topic.

func (*NSQService) EmptyTopic added in v0.1.0

func (s *NSQService) EmptyTopic(connID int, name string) error

EmptyTopic discards what the topic and every channel under it are holding.

func (*NSQService) Nodes added in v0.1.0

func (s *NSQService) Nodes(connID int) ([]string, error)

Nodes lists the daemons the send console can address.

func (*NSQService) Publish added in v0.1.0

func (s *NSQService) Publish(connID int, input NSQPublishInput) (*NSQPublishResult, error)

Publish sends through one nsqd and reports which one took the messages.

func (*NSQService) RemoveChannel added in v0.1.0

func (s *NSQService) RemoveChannel(connID int, input NSQChannelInput) error

RemoveChannel deletes a channel and its backlog, in the discovery tier as well as on every nsqd. There is no undo.

func (*NSQService) RemoveTopic added in v0.1.0

func (s *NSQService) RemoveTopic(connID int, name string) error

RemoveTopic deletes a topic, its channels and its registration in the discovery tier. There is no undo.

func (*NSQService) SetChannelPaused added in v0.1.0

func (s *NSQService) SetChannelPaused(connID int, input NSQChannelInput, paused bool) error

SetChannelPaused stops or resumes delivery to one channel's consumers. The other channels under the topic keep running.

func (*NSQService) SetTopicPaused added in v0.1.0

func (s *NSQService) SetTopicPaused(connID int, name string, paused bool) error

SetTopicPaused stops or resumes delivery into a topic's channels.

A boolean rather than two methods, because it is one control with two positions and the page reads the current state back off the topic listing.

type NamespaceInput added in v0.0.2

type NamespaceInput struct {
	Name             string   `json:"name"`
	Description      string   `json:"description"`
	Tags             []string `json:"tags"`
	DefaultQueueType string   `json:"defaultQueueType"`
	Tracing          bool     `json:"tracing"`
}

NamespaceInput creates or updates a virtual host.

type OffsetResetInput added in v0.0.3

type OffsetResetInput struct {
	Group string `json:"group"`
	Topic string `json:"topic"`

	// Partitions narrows the reset. Empty means every partition of the topic.
	Partitions []int32 `json:"partitions"`

	// Target is earliest, latest, timestamp, offset or shift.
	Target string `json:"target"`
	// Timestamp is milliseconds, for the timestamp target.
	Timestamp int64 `json:"timestamp"`
	// Value is the offset for the offset target and the signed delta for shift.
	Value int64 `json:"value"`
}

OffsetResetInput is an offset reset as the form collects it.

Deliberately not ConsumerService's ResetOffset, which takes a group, a topic and a timestamp: that is one of Kafka's five targets and the form offers all five, because "start again", "skip everything" and "go back to when the incident started" are different requests.

type PendingQueryInput added in v0.0.5

type PendingQueryInput struct {
	Stream string `json:"stream"`
	Group  string `json:"group"`
	// Consumer narrows to one consumer's share. Empty is all of them.
	Consumer string `json:"consumer"`
	// MinIdleMs narrows to entries nothing has touched for at least this long,
	// which is how the ones worth acting on are found.
	MinIdleMs int64 `json:"minIdleMs"`
	Count     int   `json:"count"`
}

PendingQueryInput narrows a pending listing as the board collects it.

type PermissionInput added in v0.0.2

type PermissionInput struct {
	Vhost     string `json:"vhost"`
	Identity  string `json:"identity"`
	Configure string `json:"configure"`
	Write     string `json:"write"`
	Read      string `json:"read"`
}

PermissionInput grants rights inside one namespace. The three patterns are regular expressions: empty permits nothing, ".*" permits everything.

type PolicyInput

type PolicyInput struct {
	Resource  string   `json:"resource"`
	Actions   []string `json:"actions"`
	Effect    string   `json:"effect"`
	SourceIPs []string `json:"sourceIps"`
}

PolicyInput is one rule row of an access-rule form.

type PrincipalInput

type PrincipalInput struct {
	Name   string `json:"name"`
	Secret string `json:"secret"`
	Type   string `json:"type"`
	Status string `json:"status"`
}

PrincipalInput carries a principal form submission. The secret is write-only: the broker stores it hashed and nothing sends it back.

type PublishInput added in v0.0.2

type PublishInput struct {
	Vhost string `json:"vhost"`
	// Exchange empty is the default exchange, which routes by queue name.
	Exchange      string            `json:"exchange"`
	RoutingKey    string            `json:"routingKey"`
	Body          string            `json:"body"`
	Persistent    bool              `json:"persistent"`
	Mandatory     bool              `json:"mandatory"`
	Headers       map[string]string `json:"headers"`
	ContentType   string            `json:"contentType"`
	CorrelationID string            `json:"correlationId"`
	ReplyTo       string            `json:"replyTo"`
	MessageID     string            `json:"messageId"`
	Type          string            `json:"type"`
	AppID         string            `json:"appId"`
	Expiration    string            `json:"expiration"`
	Priority      int               `json:"priority"`
	Count         int               `json:"count"`
}

PublishInput is the send console's form.

type PulsarGrantInput added in v0.0.5

type PulsarGrantInput struct {
	// Namespace is "tenant/namespace". Blank means the connection's own.
	Namespace string `json:"namespace"`
	// Topic narrows the grant to one topic. Blank grants the namespace.
	Topic string `json:"topic"`
	Role  string `json:"role"`

	Configure bool `json:"configure"`
	Write     bool `json:"write"`
	Read      bool `json:"read"`
}

PulsarGrantInput is a grant as the Tokens board collects it.

Configure is namespace-only: functions, sinks and packages are deployed into a namespace and not into a topic, so a topic grant is produce and consume.

type PulsarNamespaceInput added in v0.0.5

type PulsarNamespaceInput struct {
	// Name may be bare or already tenant-qualified. A bare one is created
	// under the tenant this connection is scoped to.
	Name string `json:"name"`
}

PulsarNamespaceInput creates a namespace.

Only a name, because that is all Pulsar takes: a namespace is created empty and its policies are set afterwards, one call each. A form that collected them here would have to either apply them in a second round the user cannot see fail, or pretend the create carried them.

type PulsarPublishInput added in v0.0.5

type PulsarPublishInput struct {
	// Topic is a full URL, which is how a Pulsar topic is addressed.
	Topic string `json:"topic"`
	// Key is what the broker partitions and compacts by.
	Key string `json:"key"`
	// OrderingKey orders delivery independently of the key, which is how a
	// Key_Shared subscription keeps related messages on one consumer without
	// forcing them onto one partition.
	OrderingKey string            `json:"orderingKey"`
	Properties  map[string]string `json:"properties"`
	Body        string            `json:"body"`
	// DeliverAfterMs holds the message back. Milliseconds because that is what
	// crosses a JSON bridge without a unit anybody has to remember; the driver
	// takes a duration.
	DeliverAfterMs int64 `json:"deliverAfterMs"`
	// EventTimeMs is when the producer says the event happened, as opposed to
	// when the broker stores it. Zero leaves it unset rather than stamping
	// 1970.
	EventTimeMs int64 `json:"eventTimeMs"`
	// Count sends the same message more than once, which makes a repeat
	// deliberate rather than a button pressed several times.
	Count int `json:"count"`
}

PulsarPublishInput is a send as the Pulsar console collects it.

Deliberately not model.PublishRequest, which is AMQP: an exchange, a routing key and a mandatory flag, none of which this family has. What Pulsar does have - an ordering key, an event time, a delivery delay and arbitrary properties - has no field there.

type PulsarPublishResult added in v0.0.5

type PulsarPublishResult struct {
	// MessageIDs are in send order, in Pulsar's printed form, so each can be
	// pasted straight into the browse box.
	MessageIDs []string `json:"messageIds"`
}

PulsarPublishResult is what the broker acknowledged.

type PulsarService added in v0.0.5

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

PulsarService exposes what only Pulsar has.

It is one service rather than several because it is one family's surface: splitting tenants, the send console and schema into three would put three names in the bindings for what a reader thinks of as "the Pulsar pages".

Reading topics, subscriptions, namespaces and brokers is not here. Those are destinations, subscriptions, namespaces and nodes, and the canonical services already answer them; a second read path would be two sources for one number.

func (*PulsarService) Clusters added in v0.0.5

func (s *PulsarService) Clusters(connID int) ([]string, error)

Clusters is what the tenant form offers for its allowed-cluster list.

func (*PulsarService) CreateNamespace added in v0.0.5

func (s *PulsarService) CreateNamespace(connID int, input PulsarNamespaceInput) error

CreateNamespace adds one under the profile's tenant.

func (*PulsarService) CreateSubscription added in v0.0.5

func (s *PulsarService) CreateSubscription(
	connID int, topic, subscription, startAt string,
) error

CreateSubscription adds one to a topic.

startAt is "earliest" or "latest". Earliest is the default because a subscription created at the latest position silently discards whatever is already on the topic, which is the opposite of why one is created ahead of the consumer that will use it.

func (*PulsarService) CreateTopic added in v0.0.5

func (s *PulsarService) CreateTopic(connID int, input PulsarTopicInput) error

CreateTopic declares a topic.

func (*PulsarService) DeadLetterQueues added in v0.0.5

func (s *PulsarService) DeadLetterQueues(
	connID int, namespace string,
) ([]*model.DeadLetterQueue, error)

DeadLetterQueues finds the topics dead letters land in, and the subscription each of them came from.

A Pulsar dead-letter topic is a naming convention in the client libraries, not a broker object, so this walks the namespace for names that follow it. One whose origin topic is gone is reported without a source rather than dropped: it holds a backlog nothing will drain, which is the row most worth seeing.

func (*PulsarService) DeleteNamespace added in v0.0.5

func (s *PulsarService) DeleteNamespace(connID int, name string) error

DeleteNamespace removes one. Pulsar refuses while it still holds topics, and that refusal reaches the user rather than being forced through.

func (*PulsarService) DeleteSubscription added in v0.0.5

func (s *PulsarService) DeleteSubscription(connID int, topic, subscription string) error

DeleteSubscription removes one. Pulsar refuses while a consumer is attached, and that refusal reaches the user.

func (*PulsarService) DeleteTopic added in v0.0.5

func (s *PulsarService) DeleteTopic(connID int, namespace, name string) error

DeleteTopic removes one. Pulsar refuses while a producer or consumer is still attached, and that refusal reaches the user.

func (*PulsarService) Grant added in v0.0.5

func (s *PulsarService) Grant(connID int, input PulsarGrantInput) error

Grant gives a role access to a namespace, or to one topic within it.

func (*PulsarService) NamespacePermissions added in v0.0.5

func (s *PulsarService) NamespacePermissions(
	connID int, namespace string,
) ([]*model.NamespacePermission, error)

NamespacePermissions is every role granted access to a namespace.

Roles rather than users: Pulsar authorises the subject of a token and keeps no directory of them, so a grant may name a role that does not exist yet and will be honoured when a token carrying it turns up.

func (*PulsarService) Namespaces added in v0.0.5

func (s *PulsarService) Namespaces(connID int) ([]*model.Namespace, error)

Namespaces returns every namespace under the profile's tenant, with the limits that are actually set on it.

func (*PulsarService) Producers added in v0.0.5

func (s *PulsarService) Producers(connID int, topic string) ([]*model.ProducerClient, error)

Producers is who is currently publishing to a topic. Pulsar reports them per topic rather than per producer group, which is the better question of the two and the only one it can answer.

func (*PulsarService) Publish added in v0.0.5

func (s *PulsarService) Publish(connID int, input PulsarPublishInput) (*PulsarPublishResult, error)

Publish sends one or more messages.

func (*PulsarService) RaisePartitions added in v0.0.5

func (s *PulsarService) RaisePartitions(connID int, input PulsarTopicInput) error

RaisePartitions adds partitions to a partitioned topic. Pulsar cannot remove them, and cannot partition a topic that was created without partitions.

func (*PulsarService) RemoveNamespaceLimit added in v0.0.5

func (s *PulsarService) RemoveNamespaceLimit(connID int, name, limit string) error

RemoveNamespaceLimit hands a limit back to the broker's own default. Not the same as setting zero: zero producers is a namespace nothing can publish to.

func (*PulsarService) RemoveTenant added in v0.0.5

func (s *PulsarService) RemoveTenant(connID int, name string) error

RemoveTenant deletes one. Pulsar refuses while it still holds namespaces, and that refusal reaches the user rather than being forced through.

func (*PulsarService) RevokeNamespace added in v0.0.5

func (s *PulsarService) RevokeNamespace(connID int, namespace, role string) error

RevokeNamespace takes a role's access to a whole namespace away.

func (*PulsarService) RevokeTopic added in v0.0.5

func (s *PulsarService) RevokeTopic(connID int, topic, role string) error

RevokeTopic takes a role's access to one topic away. Narrower than the namespace revoke and a different endpoint, so the two are separate calls rather than one with a scope argument.

func (*PulsarService) SaveTenant added in v0.0.5

func (s *PulsarService) SaveTenant(connID int, input PulsarTenantInput) error

SaveTenant creates a tenant or updates the one already there.

func (*PulsarService) SetNamespaceLimit added in v0.0.5

func (s *PulsarService) SetNamespaceLimit(connID int, name, limit string, value int) error

SetNamespaceLimit caps a namespace as a whole.

func (*PulsarService) SubscriptionClients added in v0.0.5

func (s *PulsarService) SubscriptionClients(
	connID int, topic, subscription string,
) ([]*model.SubscriptionClient, error)

SubscriptionClients is who is attached, as the broker reports them. No round trip to any consumer: Pulsar carries their permits and rates in the topic's own stats.

func (*PulsarService) SubscriptionStats added in v0.0.5

func (s *PulsarService) SubscriptionStats(
	connID int, topic, subscription string,
) (map[string]interface{}, error)

SubscriptionStats is one subscription's figures.

Topic-scoped, which ConsumerService.Stats is not: it builds a ref with an empty namespace, and a Pulsar subscription has no identity without the topic it belongs to.

func (*PulsarService) Tenants added in v0.0.5

func (s *PulsarService) Tenants(connID int) ([]*PulsarTenantView, error)

Tenants lists every tenant on the cluster.

func (*PulsarService) TopicDetail added in v0.0.5

func (s *PulsarService) TopicDetail(
	connID int, namespace, name string,
) (*model.Destination, error)

TopicDetail is one topic in one namespace.

func (*PulsarService) TopicPermissions added in v0.0.5

func (s *PulsarService) TopicPermissions(connID int) ([]*model.TopicPermission, error)

TopicPermissions is every per-topic grant in the connection's namespace.

func (*PulsarService) TopicStats added in v0.0.5

func (s *PulsarService) TopicStats(
	connID int, namespace, name string,
) (map[string]interface{}, error)

TopicStats is the per-partition breakdown the detail panel draws.

func (*PulsarService) Topics added in v0.0.5

func (s *PulsarService) Topics(
	connID int, namespace string, includeInternal bool,
) ([]*model.Destination, error)

Topics returns every topic in one namespace.

Namespace-scoped, which TopicService is not: a Pulsar topic is addressed as tenant/namespace/name, and the canonical service's Detail builds a ref with no namespace in it at all.

type PulsarTenantInput added in v0.0.5

type PulsarTenantInput struct {
	Name string `json:"name"`
	// AdminRoles are the roles allowed to administer this tenant's namespaces.
	AdminRoles []string `json:"adminRoles"`
	// AllowedClusters bounds where the tenant's namespaces may live. Empty
	// means the cluster this connection is pointed at, which is what an
	// operator who left the field alone meant.
	AllowedClusters []string `json:"allowedClusters"`
}

PulsarTenantInput is a tenant as the form collects it.

type PulsarTenantView added in v0.0.5

type PulsarTenantView struct {
	Name            string   `json:"name"`
	AdminRoles      []string `json:"adminRoles"`
	AllowedClusters []string `json:"allowedClusters"`
	// Namespaces is -1 when this credential could not list them, which happens
	// for every tenant but its own on a connection that is not a superuser.
	Namespaces int `json:"namespaces"`
}

PulsarTenantView is a tenant as the tenants board draws it.

type PulsarTopicInput added in v0.0.5

type PulsarTopicInput struct {
	// Namespace is "tenant/namespace". Blank means the one this connection is
	// scoped to, which is what the form's cascade starts on.
	Namespace string `json:"namespace"`
	Name      string `json:"name"`

	// Partitions of 0 is a non-partitioned topic, which is a different object
	// from one with a single partition - the second is addressed as
	// name-partition-0 and can grow, the first can never be partitioned.
	Partitions int `json:"partitions"`

	// Persistent chooses the storage. A non-persistent topic keeps nothing on
	// disk: a message nobody is connected to receive is dropped.
	Persistent bool `json:"persistent"`
}

PulsarTopicInput is a topic declaration as the Pulsar form collects it.

Deliberately not TopicService.Create's shape. That one takes a broker address, a read queue count, a write queue count and a permission string, which is RocketMQ's vocabulary: a Pulsar topic has none of those. It has a namespace, a name, a partition count and a storage kind.

type PurgeInput added in v0.0.6

type PurgeInput struct {
	Stream   string `json:"stream"`
	Strategy string `json:"strategy"`
	// Keep is how many of the newest messages to leave, for the keep strategy.
	// Zero empties the stream, which is the only purge JetStream has - there
	// is no separate command, and offering one under another name would be two
	// controls for one thing.
	Keep int64 `json:"keep"`
	// Sequence is the lowest sequence to keep, for the sequence strategy.
	// Everything below it goes, and the message at it survives.
	Sequence string `json:"sequence"`
}

PurgeInput is a trim as the dialog collects it.

The strategy is a string rather than two methods because it is one command with two ways of naming a bound, and a page that had to pick an endpoint before the user picked a strategy would be the wrong shape.

type QueueInput added in v0.0.2

type QueueInput struct {
	Vhost      string `json:"vhost"`
	Name       string `json:"name"`
	QueueType  string `json:"queueType"`
	Durable    bool   `json:"durable"`
	AutoDelete bool   `json:"autoDelete"`
	// Arguments is the declaration bag as JSON, so a number stays a number.
	// RabbitMQ rejects a float where it wants an integer, and a string where
	// it wants either.
	Arguments string `json:"arguments"`
}

QueueInput is a queue declaration as the form collects it.

Nothing like TopicInput, and it should not be: a RocketMQ topic is read and write queue counts and a permission bitmask, a RabbitMQ queue is a type, a lifetime and a bag of arguments the broker validates itself.

type QueueOffsetInput

type QueueOffsetInput struct {
	Group   string `json:"group"`
	Topic   string `json:"topic"`
	Broker  string `json:"broker"`
	QueueID int    `json:"queueId"`
	Offset  int64  `json:"offset"`
}

QueueOffsetInput carries a per-queue offset form submission.

type QuotaView added in v0.0.3

type QuotaView struct {
	Quotas []*model.ClientQuota `json:"quotas"`

	// EntityTypes and Limits are what a quota may be built from. The entity
	// types are a closed set because Kafka's are; the limits are the four
	// worth naming rather than all there are, because a cluster knows keys
	// this build has never heard of.
	EntityTypes []string `json:"entityTypes"`
	Limits      []string `json:"limits"`
}

QuotaView is the quotas page in one answer.

type RabbitMQService added in v0.0.2

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

RabbitMQService exposes what only RabbitMQ has.

It is one service rather than several because it is one family's surface: splitting virtual hosts, policies and the broker census into three would put three names in the bindings for what a reader thinks of as "the RabbitMQ pages".

func (*RabbitMQService) Census added in v0.0.2

func (s *RabbitMQService) Census(connID int) (*model.BrokerCensus, error)

Census returns the broker's running totals: object counts, queued depth and message rates for the whole cluster.

Nil means nothing is connected, which the overview renders as its own state rather than as an error.

func (*RabbitMQService) ClientChannels added in v0.0.2

func (s *RabbitMQService) ClientChannels(connID int, namespace string) ([]*model.ClientChannel, error)

ClientChannels returns the channels multiplexed inside those connections.

func (*RabbitMQService) ClientConnections added in v0.0.2

func (s *RabbitMQService) ClientConnections(connID int, namespace string) ([]*model.ClientConnection, error)

ClientConnections returns the transport connections open against the broker.

func (*RabbitMQService) CloseClientConnection added in v0.0.2

func (s *RabbitMQService) CloseClientConnection(connID int, name, reason string) error

CloseClientConnection disconnects one connection. The reason reaches the client being disconnected and the broker's log.

func (*RabbitMQService) CloseUserConnections added in v0.0.2

func (s *RabbitMQService) CloseUserConnections(connID int, username, reason string) error

CloseUserConnections disconnects every connection one user holds, which is how an application running several instances is evicted.

func (*RabbitMQService) DeadLetterQueues added in v0.0.2

func (s *RabbitMQService) DeadLetterQueues(connID int, namespace string) ([]*model.DeadLetterQueue, error)

DeadLetterQueues finds the queues dead letters land in, and the queues that feed each one.

func (*RabbitMQService) DeclareBinding added in v0.0.2

func (s *RabbitMQService) DeclareBinding(connID int, input BindingInput) error

DeclareBinding routes an exchange to a queue or to another exchange.

func (*RabbitMQService) DeclareExchange added in v0.0.2

func (s *RabbitMQService) DeclareExchange(connID int, input ExchangeInput) error

DeclareExchange creates an exchange.

func (*RabbitMQService) DeclareQueue added in v0.0.2

func (s *RabbitMQService) DeclareQueue(connID int, input QueueInput) error

DeclareQueue creates a queue.

func (*RabbitMQService) Definitions added in v0.0.2

func (s *RabbitMQService) Definitions(connID int, vhost string) (*model.Definitions, error)

Definitions returns the broker's topology as one document, with a count of what it holds. An empty vhost exports the whole broker.

func (*RabbitMQService) DeleteBinding added in v0.0.2

func (s *RabbitMQService) DeleteBinding(connID int, input BindingInput) error

DeleteBinding removes one binding.

func (*RabbitMQService) DeleteExchange added in v0.0.2

func (s *RabbitMQService) DeleteExchange(connID int, vhost, name string) error

DeleteExchange removes an exchange, and its bindings with it.

func (*RabbitMQService) DeleteFederationUpstream added in v0.0.2

func (s *RabbitMQService) DeleteFederationUpstream(connID int, vhost, name string) error

DeleteFederationUpstream removes an upstream, stopping its links.

func (*RabbitMQService) DeleteIdentity added in v0.0.2

func (s *RabbitMQService) DeleteIdentity(connID int, name string) error

DeleteIdentity removes a user, its permissions and its open connections.

func (*RabbitMQService) DeleteNamespace added in v0.0.2

func (s *RabbitMQService) DeleteNamespace(connID int, name string) error

DeleteNamespace removes a virtual host and everything inside it.

func (*RabbitMQService) DeletePolicy added in v0.0.2

func (s *RabbitMQService) DeletePolicy(connID int, vhost, name string, operator bool) error

DeletePolicy removes one. Every destination it applied to reverts at once.

func (*RabbitMQService) DeleteQueue added in v0.0.2

func (s *RabbitMQService) DeleteQueue(connID int, vhost, name string, ifUnused, ifEmpty bool) error

DeleteQueue removes a queue and everything in it.

ifUnused and ifEmpty are the broker's own preconditions. They are checked where the delete happens, which is the only place they can be checked without a race.

func (*RabbitMQService) DeleteRuntimeParameter added in v0.0.2

func (s *RabbitMQService) DeleteRuntimeParameter(connID int, component, vhost, name string) error

DeleteRuntimeParameter removes one component's stored configuration.

func (*RabbitMQService) DeleteShovel added in v0.0.2

func (s *RabbitMQService) DeleteShovel(connID int, vhost, name string) error

DeleteShovel removes a shovel, stopping it.

func (*RabbitMQService) DropMessages added in v0.0.2

func (s *RabbitMQService) DropMessages(connID int, vhost, name string, limit int) (int, error)

DropMessages discards a bounded batch from the head of a queue and reports how many are gone. There is no undo.

func (*RabbitMQService) ExportDefinitionsToFile added in v0.0.2

func (s *RabbitMQService) ExportDefinitionsToFile(connID int, vhost string) (string, error)

ExportDefinitionsToFile prompts for a destination and writes the document there. It returns the written path, or an empty string when the user cancels.

The dialog is here rather than in the renderer because that is where the application's window lives; the same pattern serves the settings export.

func (*RabbitMQService) FederationUpstreams added in v0.0.2

func (s *RabbitMQService) FederationUpstreams(connID int) ([]*model.FederationUpstream, error)

FederationUpstreams returns the brokers this one federates from, with their links' state.

func (*RabbitMQService) Health added in v0.0.2

func (s *RabbitMQService) Health(connID int) (*model.BrokerHealth, error)

Health runs the broker's own checks, and reads its feature flags and the deprecated features it still allows.

func (*RabbitMQService) Identities added in v0.0.2

func (s *RabbitMQService) Identities(connID int) ([]*model.Identity, error)

Identities returns every user with its per-namespace permissions.

func (*RabbitMQService) ImportDefinitions added in v0.0.2

func (s *RabbitMQService) ImportDefinitions(connID int, vhost, document string) error

ImportDefinitions applies a document. An empty vhost applies it broker-wide.

func (*RabbitMQService) MatchingPolicies added in v0.0.2

func (s *RabbitMQService) MatchingPolicies(connID int, vhost, name, kind string) ([]*model.Policy, error)

MatchingPolicies asks the broker which policies actually apply to one destination. Only the highest-priority match does, and they do not merge.

func (*RabbitMQService) MoveMessages added in v0.0.2

func (s *RabbitMQService) MoveMessages(connID int, input MoveInput) (int, error)

MoveMessages returns how many reached the target, which is meaningful even when the call also returns an error: that count already moved.

func (*RabbitMQService) Namespaces added in v0.0.2

func (s *RabbitMQService) Namespaces(connID int) ([]*model.Namespace, error)

Namespaces returns every virtual host with its limits.

func (*RabbitMQService) Policies added in v0.0.2

func (s *RabbitMQService) Policies(connID int) ([]*model.Policy, error)

Policies returns both user and operator policies, marked apart.

func (*RabbitMQService) Publish added in v0.0.2

func (s *RabbitMQService) Publish(connID int, input PublishInput) (*model.PublishResult, error)

Publish sends a message and reports how many the broker kept and how many it handed back as unroutable. Those are two different facts.

func (*RabbitMQService) PurgeQueue added in v0.0.2

func (s *RabbitMQService) PurgeQueue(connID int, vhost, name string) error

PurgeQueue drops everything a queue is holding. There is no undo.

func (*RabbitMQService) ReadDefinitionsFile added in v0.0.2

func (s *RabbitMQService) ReadDefinitionsFile() (*DefinitionsPreview, error)

ReadDefinitionsFile prompts for a file and reports what is in it.

Reading and applying are separate steps on purpose: the document is opaque, and a count of what it will create is the only review anyone can actually perform before it lands on a cluster.

func (*RabbitMQService) RebalanceQueues added in v0.0.2

func (s *RabbitMQService) RebalanceQueues(connID int) error

RebalanceQueues spreads quorum queue leaders back across the nodes.

func (*RabbitMQService) RevokePermission added in v0.0.2

func (s *RabbitMQService) RevokePermission(connID int, vhost, identity string) error

RevokePermission removes the permission record entirely, which stops the identity connecting to that virtual host at all - not the same as granting nothing.

func (*RabbitMQService) RevokeTopicPermission added in v0.0.2

func (s *RabbitMQService) RevokeTopicPermission(connID int, vhost, identity string) error

RevokeTopicPermission lifts the narrowing, leaving the namespace permissions alone.

func (*RabbitMQService) RuntimeParameters added in v0.0.2

func (s *RabbitMQService) RuntimeParameters(connID int) ([]*model.RuntimeParameter, error)

RuntimeParameters returns the component configuration the broker stores for its plugins - shovels and federation upstreams live here.

func (*RabbitMQService) SaveIdentity added in v0.0.2

func (s *RabbitMQService) SaveIdentity(connID int, input IdentityInput) error

SaveIdentity creates a user or updates one.

func (*RabbitMQService) SaveNamespace added in v0.0.2

func (s *RabbitMQService) SaveNamespace(connID int, input NamespaceInput) error

SaveNamespace creates a virtual host, or updates one that already exists.

func (*RabbitMQService) SavePolicy added in v0.0.2

func (s *RabbitMQService) SavePolicy(connID int, input RabbitPolicyInput) error

SavePolicy creates a policy or replaces one of the same name.

func (*RabbitMQService) SetNamespaceLimit added in v0.0.2

func (s *RabbitMQService) SetNamespaceLimit(connID int, name, limit string, value int) error

SetNamespaceLimit caps a virtual host. A negative value lifts the cap, which is not the same as a cap of zero - zero forbids everything.

func (*RabbitMQService) SetPermission added in v0.0.2

func (s *RabbitMQService) SetPermission(connID int, input PermissionInput) error

SetPermission grants an identity rights inside one namespace.

func (*RabbitMQService) SetTopicPermission added in v0.0.2

func (s *RabbitMQService) SetTopicPermission(connID int, input TopicPermissionInput) error

SetTopicPermission narrows write and read on one topic exchange.

func (*RabbitMQService) Shovels added in v0.0.2

func (s *RabbitMQService) Shovels(connID int) ([]*model.Shovel, error)

Shovels returns every shovel with the state the broker reports for it. The URIs come back with their passwords removed.

func (*RabbitMQService) StreamClients added in v0.0.2

func (s *RabbitMQService) StreamClients(connID int, vhost, name string) (*model.StreamClients, error)

StreamClients returns who is attached to a stream over the stream protocol, which is nobody the AMQP consumer list would ever mention.

func (*RabbitMQService) TopicPermissions added in v0.0.2

func (s *RabbitMQService) TopicPermissions(connID int) ([]*model.TopicPermission, error)

TopicPermissions returns the per-exchange narrowing on top of the namespace permissions.

type RabbitPolicyInput added in v0.0.2

type RabbitPolicyInput struct {
	Vhost    string `json:"vhost"`
	Name     string `json:"name"`
	Pattern  string `json:"pattern"`
	ApplyTo  string `json:"applyTo"`
	Priority int    `json:"priority"`
	// Definition as JSON, so an integer stays an integer.
	Definition string `json:"definition"`
	Operator   bool   `json:"operator"`
}

RabbitPolicyInput creates a policy or replaces one of the same name.

Qualified because "policy" means two different things across the families this bridge serves: RocketMQ's PolicyInput is an ACL rule, and this is a pattern that applies settings to destinations.

type RecordInput added in v0.0.3

type RecordInput struct {
	Topic string `json:"topic"`

	// Partition pins the record. -1 lets the key decide, which is what
	// ordering by key depends on.
	Partition int32 `json:"partition"`

	// HasKey separates a record with no key from one with an empty key. Kafka
	// treats them differently: the first is spread across partitions, the
	// second is pinned like any other.
	HasKey bool   `json:"hasKey"`
	Key    string `json:"key"`

	Value   string            `json:"value"`
	Headers map[string]string `json:"headers"`
	// Timestamp in milliseconds. Zero stamps it now.
	Timestamp int64 `json:"timestamp"`

	// Acks is none, leader or all.
	Acks  string `json:"acks"`
	Count int    `json:"count"`
}

RecordInput is a Kafka publish as the send console collects it.

Deliberately not MessageService's PublishInput. That one carries an exchange, a routing key, mandatory, persistent, a TTL and a priority - AMQP's, none of which Kafka has. A Kafka record has a partition it can be pinned to, a key that decides the partition when it is not, and an acknowledgement level that decides what a confirmation is worth.

type RedisStreamService added in v0.0.5

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

RedisStreamService exposes what only Redis Streams has.

It is one service rather than several because it is one family's surface: splitting trimming, the pending list and the server's own figures into three would put three names in the bindings for what a reader thinks of as "the Redis pages".

func (*RedisStreamService) AckEntries added in v0.0.5

func (s *RedisStreamService) AckEntries(connID int, stream string, group string, ids []string) (*model.AckResult, error)

AckEntries settles entries so they stop being owed, and reports how many were actually owed - which is not how many were named.

func (*RedisStreamService) AclCategories added in v0.0.5

func (s *RedisStreamService) AclCategories(connID int) ([]string, error)

AclCategories are the command groups rules are written in terms of. They differ by server version, so the form offers what the server reports.

func (*RedisStreamService) AclUsers added in v0.0.5

func (s *RedisStreamService) AclUsers(connID int) ([]*model.AclUser, error)

AclUsers lists the principals the server authenticates.

func (*RedisStreamService) AddEntry added in v0.0.5

func (s *RedisStreamService) AddEntry(connID int, input EntryInput) (*model.StreamAddResult, error)

AddEntry writes to a stream and returns the ids the server assigned.

The ids rather than a count: an id is the only handle on an entry, so a console that reported "sent 5" would leave the user unable to find any of them.

func (*RedisStreamService) AutoClaim added in v0.0.5

func (s *RedisStreamService) AutoClaim(connID int, input AutoClaimInput) (*model.ClaimResult, error)

AutoClaim moves whatever has been idle too long and reports what it found gone as well as what it moved.

func (*RedisStreamService) ClaimEntries added in v0.0.5

func (s *RedisStreamService) ClaimEntries(connID int, input ClaimInput) (*model.ClaimResult, error)

ClaimEntries moves named entries to another consumer.

func (*RedisStreamService) ClientConnections added in v0.0.5

func (s *RedisStreamService) ClientConnections(connID int) ([]*model.ClientConnection, error)

ClientConnections lists what is connected to the server.

func (*RedisStreamService) CloseClient added in v0.0.5

func (s *RedisStreamService) CloseClient(connID int, id string) error

CloseClient disconnects one client.

It takes the connection's id rather than its address: Redis kills by either, and an address is reused the moment its port is - so a client that reconnected between the page being drawn and the button being pressed would be killed in place of the one the operator meant.

func (*RedisStreamService) CloseUserClients added in v0.0.5

func (s *RedisStreamService) CloseUserClients(connID int, username string) error

CloseUserClients disconnects every connection one identity holds.

func (*RedisStreamService) CreateGroup added in v0.0.5

func (s *RedisStreamService) CreateGroup(connID int, input GroupInput) error

CreateGroup declares a consumer group on a stream.

func (*RedisStreamService) DeleteEntries added in v0.0.5

func (s *RedisStreamService) DeleteEntries(connID int, stream string, ids []string) (*model.TrimResult, error)

DeleteEntries removes named entries and reports how many were there to remove, which is not the same as how many were asked for.

func (*RedisStreamService) DeleteGroup added in v0.0.5

func (s *RedisStreamService) DeleteGroup(connID int, stream string, group string) error

DeleteGroup destroys a consumer group and the pending entries it holds.

func (*RedisStreamService) GroupConsumers added in v0.0.5

func (s *RedisStreamService) GroupConsumers(connID int, stream string, group string) ([]*model.GroupConsumer, error)

GroupConsumers lists a group's members and how long each has been quiet.

func (*RedisStreamService) PendingEntries added in v0.0.5

func (s *RedisStreamService) PendingEntries(connID int, input PendingQueryInput) ([]*model.PendingEntry, error)

PendingEntries walks a group's pending list.

func (*RedisStreamService) PendingSummary added in v0.0.5

func (s *RedisStreamService) PendingSummary(connID int, stream string, group string) (*model.PendingSummary, error)

PendingSummary returns a group's pending list at a glance.

func (*RedisStreamService) RemoveAclUser added in v0.0.5

func (s *RedisStreamService) RemoveAclUser(connID int, name string) error

RemoveAclUser deletes a user. Redis closes whatever was authenticated as it.

func (*RedisStreamService) SaveAclUser added in v0.0.5

func (s *RedisStreamService) SaveAclUser(connID int, input AclUserInput) error

SaveAclUser creates or replaces a user.

Replaces: the server's own SETUSER is additive, so an edit that removed a key pattern would leave it in place and the form would be lying about what it saved.

func (*RedisStreamService) SetGroupPosition added in v0.0.5

func (s *RedisStreamService) SetGroupPosition(connID int, stream string, group string, position string) error

SetGroupPosition moves a consumer group to an entry id, to "0" for the beginning of what the stream still holds, or to "$" for whatever arrives next.

func (*RedisStreamService) SlowLog added in v0.0.5

func (s *RedisStreamService) SlowLog(connID int, address string, limit int) ([]*model.SlowLogEntry, error)

SlowLog reads the record a server keeps of its slowest commands.

It is not on ClusterService because no other family has one: what a node is running with is a shared question, what has been slow on it is Redis's.

func (*RedisStreamService) Trim added in v0.0.5

func (s *RedisStreamService) Trim(connID int, input TrimInput) (*model.TrimResult, error)

Trim discards entries from the head of a stream and reports how many went.

type ReplayInput

type ReplayInput struct {
	ConsumerGroup string `json:"consumerGroup"`
	ClientID      string `json:"clientId"`
	Topic         string `json:"topic"`
	MessageID     string `json:"messageId"`
}

ReplayInput carries a replay-to-one-consumer request.

type ResendInput

type ResendInput struct {
	ConsumerGroup string `json:"consumerGroup"`
	ClientID      string `json:"clientId"`
	Topic         string `json:"topic"`
	MessageID     string `json:"messageId"`
}

ResendInput identifies a message to push back to a consumer group.

type RoutingService

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

RoutingService exposes exchanges and bindings to the frontend.

It is the one bridge service with no canonical page behind it: routing has no counterpart in any other family, so the driver that has it contributes a page and this feeds it.

func (*RoutingService) Bindings

func (s *RoutingService) Bindings(connID int, namespace string) ([]*model.Binding, error)

Bindings returns the routes in a namespace.

func (*RoutingService) Exchanges

func (s *RoutingService) Exchanges(connID int, namespace string) ([]*model.Destination, error)

Exchanges returns the exchanges in a namespace.

type SQSPublishInput added in v0.1.0

type SQSPublishInput struct {
	Queue string `json:"queue"`
	Body  string `json:"body"`
	// Count sends the same body more than once. One when left at zero.
	Count int `json:"count"`
	// DelaySec holds the message back from consumers, up to 900. A FIFO queue
	// takes none: its delay is a queue setting.
	DelaySec int `json:"delaySec"`
	// Attributes are the producer's own, sent as SQS string attributes.
	Attributes map[string]string `json:"attributes"`
	// GroupID is required on a FIFO queue and refused on a standard one.
	GroupID string `json:"groupId"`
	// DeduplicationID is what SQS deduplicates a FIFO message by for five
	// minutes. Blank lets the driver generate one, which is what keeps a
	// repeat of ten from arriving as one message.
	DeduplicationID string `json:"deduplicationId"`
}

SQSPublishInput is a send as the SQS console collects it.

Deliberately not MessageService.Send's shape. That one takes a topic, tags, keys and a delay level - RocketMQ's vocabulary, of which an SQS message has the destination and a delay in real seconds. What it cannot carry is the table of named attributes an SQS message puts beside its body, or the two fields a FIFO queue requires.

type SQSPublishResult added in v0.1.0

type SQSPublishResult struct {
	Sent int `json:"sent"`
	// MessageID is the first message's. It addresses nothing - no SQS call
	// takes a message id - and is shown so a page can name what it produced.
	MessageID string `json:"messageId"`
}

SQSPublishResult is what the send did.

type SQSQueueInput added in v0.1.0

type SQSQueueInput struct {
	Name string `json:"name"`
	// FIFO is fixed at creation and has to match the .fifo suffix. It is sent
	// so a mismatch is refused with a message naming the field the user
	// actually filled in, rather than the attribute the service names.
	FIFO bool `json:"fifo"`

	VisibilityTimeoutSec int `json:"visibilityTimeoutSec"`
	DelaySec             int `json:"delaySec"`
	RetentionSec         int `json:"retentionSec"`
	MaxMessageBytes      int `json:"maxMessageBytes"`
	ReceiveWaitSec       int `json:"receiveWaitSec"`

	// DeadLetterQueue is another queue's name; the driver resolves its ARN.
	// Empty leaves the queue without a redrive policy.
	DeadLetterQueue string `json:"deadLetterQueue"`
	MaxReceiveCount int    `json:"maxReceiveCount"`

	// FIFO only. Ignored on a standard queue, where SQS refuses each of them
	// by an attribute name the form never drew.
	ContentBasedDeduplication bool   `json:"contentBasedDeduplication"`
	DeduplicationScope        string `json:"deduplicationScope"`
	FifoThroughputLimit       string `json:"fifoThroughputLimit"`
}

SQSQueueInput is a queue as the queue form collects it.

Deliberately not TopicService.Create's shape. That one takes a broker address, two queue counts and a permission string - RocketMQ's vocabulary, of which an SQS queue has none. What a queue has instead is a set of durations the service enforces, and a redrive policy naming another queue.

Every duration is zero when the form left it alone, which on an edit means "keep what is stored" rather than "set it to zero": SQS replaces exactly the attributes it is given, so an omitted one survives.

type SQSService added in v0.1.0

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

SQSService is the renderer's entry point for the operations only Amazon SQS has. Listing and describing queues go through the canonical services; what is here is the rest.

func (*SQSService) CreateQueue added in v0.1.0

func (s *SQSService) CreateQueue(connID int, input SQSQueueInput) error

CreateQueue declares a queue in the connection's region.

func (*SQSService) DeadLetterQueues added in v0.1.0

func (s *SQSService) DeadLetterQueues(connID int) ([]*model.DeadLetterQueue, error)

DeadLetterQueues finds the queues other queues redrive into, and which queues point at each of them.

A dead-letter queue in SQS is an ordinary queue with a redrive policy aimed at it. Nothing marks one, so this is a walk backwards through the topology - and a queue every one of whose sources sits outside the connection's queue prefix is not found, because the walk starts from what the prefix let through.

func (*SQSService) Publish added in v0.1.0

func (s *SQSService) Publish(connID int, input SQSPublishInput) (*SQSPublishResult, error)

Publish sends to one queue and reports how many the service accepted.

func (*SQSService) PurgeQueue added in v0.1.0

func (s *SQSService) PurgeQueue(connID int, name string) error

PurgeQueue discards everything the queue holds.

The call returning is not the queue being empty: SQS purges asynchronously, may also delete anything sent in the following minute, and may keep delivering what was sent before it for about as long.

func (*SQSService) RemoveQueue added in v0.1.0

func (s *SQSService) RemoveQueue(connID int, name string) error

RemoveQueue deletes a queue and everything in it. There is no undo, and SQS refuses the name for 60 seconds afterwards.

func (*SQSService) UpdateQueue added in v0.1.0

func (s *SQSService) UpdateQueue(connID int, input SQSQueueInput) error

UpdateQueue changes an existing queue's settings. Whether a queue is FIFO is not among them: that is fixed at creation and spelled in its name.

type SendInput

type SendInput struct {
	Topic      string `json:"topic"`
	Tags       string `json:"tags"`
	Keys       string `json:"keys"`
	Body       string `json:"body"`
	DelayLevel int    `json:"delayLevel"`
}

SendInput carries a produced message.

type SettingsInput

type SettingsInput struct {
	model.AppSettings
	GlobalCredentialsMode string `json:"globalCredentialsMode"`
}

SettingsInput carries a settings form submission.

type SettingsService

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

SettingsService exposes application settings to the frontend.

func (*SettingsService) ClearCache

func (s *SettingsService) ClearCache() error

ClearCache drops cached broker and topic metadata.

func (*SettingsService) Get

func (s *SettingsService) Get() *SettingsView

Get returns the current settings with credentials redacted.

func (*SettingsService) Reset

func (s *SettingsService) Reset() (*SettingsView, error)

Reset restores the default settings.

func (*SettingsService) Update

func (s *SettingsService) Update(input SettingsInput) (*SettingsView, error)

Update applies a settings form submission, resolving the global credentials mode against the currently stored secrets.

type SettingsView

type SettingsView struct {
	model.AppSettings
	GlobalAccessKeyConfigured bool `json:"globalAccessKeyConfigured"`
	GlobalSecretKeyConfigured bool `json:"globalSecretKeyConfigured"`
}

SettingsView is the settings shape sent to the frontend, with the global ACL credentials replaced by whether they are configured.

type ShellPage

type ShellPage struct {
	ID    string `json:"id"`
	Label string `json:"label"`
}

ShellPage is one destination in the active tab's sidebar.

type ShellService

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

ShellService receives what the renderer is currently showing.

The tray menu is the only consumer, and it needs this because a page label only exists in the renderer's i18n bundles: reporting the pages already translated is what keeps six protocols' navigation out of the Go process.

func NewShellService

func NewShellService() (*ShellService, func(func(active string, page string, pages []ShellPage)))

NewShellService creates the service the renderer reports its view to, and the function that registers its single consumer.

The registrar is returned rather than exposed as a method because every exported method here becomes a renderer binding, and registration is Go-side wiring: the consumer is the tray, which is built after the services are.

func (*ShellService) ReportSession

func (s *ShellService) ReportSession(active string, page string, pages []ShellPage)

ReportSession records the tab in front, the page it shows, and the pages that tab's protocol offers, in sidebar order. An empty active tab means the shell is showing something that sits beside the tabs.

type SolacePublishInput added in v0.1.0

type SolacePublishInput struct {
	// Target is "queue" or "topic". A queue send names one endpoint; a topic
	// send is matched against every subscription in the Message VPN and lands
	// on nothing when none match.
	Target      string `json:"target"`
	Destination string `json:"destination"`
	Body        string `json:"body"`
	ContentType string `json:"contentType"`

	// DeliveryMode is "persistent", "non-persistent" or "direct". Empty is
	// persistent.
	DeliveryMode string `json:"deliveryMode"`
	// TimeToLiveMs discards the message if nothing takes it by then. Zero is
	// the broker's own unlimited.
	TimeToLiveMs int `json:"timeToLiveMs"`
	// DMQEligible decides whether a message given up on is moved to the
	// queue's dead message queue or discarded. The broker's default is off,
	// which is why a queue configured to dead-letter can still discard.
	DMQEligible   bool              `json:"dmqEligible"`
	CorrelationID string            `json:"correlationId"`
	ReplyTo       string            `json:"replyTo"`
	Properties    map[string]string `json:"properties"`
	// Count sends the same body more than once. Each copy is its own request.
	Count int `json:"count"`
}

SolacePublishInput is a send as the Solace console collects it.

Deliberately not MessageService.Send's shape. That one takes a topic, tags, keys and a delay level; a Solace message has a delivery mode, a time to live and a dead-message flag instead, and it can go to a queue by name or to a topic to be matched - which are two different things and not one field with two spellings.

type SolacePublishResult added in v0.1.0

type SolacePublishResult struct {
	Sent int `json:"sent"`
}

SolacePublishResult is what the send did.

There is no message id, and that is the interface rather than an omission: the broker answers a successful send with an empty body and no identifier. The id a browse lists is the queue's own sequence number, assigned when the message is spooled and never told to the publisher.

type SolaceQueueInput added in v0.1.0

type SolaceQueueInput struct {
	Name string `json:"name"`

	// AccessType is "exclusive" or "non-exclusive", and it is the setting most
	// likely to be wrong: exclusive hands every message to one consumer and
	// keeps the rest waiting as standbys, which looks like a broken fan-out
	// rather than like a configuration choice.
	AccessType string `json:"accessType"`
	// Permission is what a client bound to this queue may do to it - read,
	// consume, modify its topics, or delete it.
	Permission string `json:"permission"`

	// Owner is the client username the queue belongs to. Empty leaves it
	// unowned, which is what a queue created by an administrator usually is.
	Owner string `json:"owner"`

	// DeadMsgQueue is where undelivered messages go. Naming one also turns off
	// respectDmqEligible, because otherwise only a message its publisher
	// marked eligible is ever moved - and nothing this app sends is marked.
	DeadMsgQueue string `json:"deadMsgQueue"`
	// MaxRedeliveryCount is how many attempts before that happens. Zero is the
	// broker's own unlimited.
	MaxRedeliveryCount int `json:"maxRedeliveryCount"`

	// MaxSpoolUsageMb caps what the queue may hold, in megabytes. Zero leaves
	// the broker's own default.
	MaxSpoolUsageMb int `json:"maxSpoolUsageMb"`
}

SolaceQueueInput is a queue as the form collects it.

Deliberately not TopicService.Create's shape. That one takes a broker address, two queue counts and a permission string - RocketMQ's vocabulary, of which a Solace queue has none.

type SolaceService added in v0.1.0

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

SolaceService is the renderer's entry point for the operations only Solace has. Listing and describing queues go through the canonical services; what is here is the rest.

func (*SolaceService) Clients added in v0.1.0

func (s *SolaceService) Clients(connID int) ([]*model.ClientConnection, error)

Clients lists what is holding a session open on this Message VPN.

The broker's own machinery is in the list rather than filtered out of it: a client named with a leading "#" is the broker talking to itself, and it is marked so a reader counting applications can leave it out. Hiding them would hide connections that hold real resources.

func (*SolaceService) CreateQueue added in v0.1.0

func (s *SolaceService) CreateQueue(connID int, input SolaceQueueInput) error

CreateQueue declares a queue in this connection's Message VPN.

func (*SolaceService) CreateTopicEndpoint added in v0.1.0

func (s *SolaceService) CreateTopicEndpoint(connID int, name string) error

CreateTopicEndpoint declares an endpoint whose name is its subscription.

No other field: a topic endpoint has no exchange type and nothing to decide beyond the topic it is called after.

func (*SolaceService) DeadMsgQueues added in v0.1.0

func (s *SolaceService) DeadMsgQueues(connID int) ([]*model.DeadLetterQueue, error)

DeadMsgQueues lists the queues something else dead-letters into.

Found by walking every endpoint's configuration backwards rather than by looking up a name: nothing marks a dead message queue on this family, and what makes one is another queue's or topic endpoint's pointer. A target with no depth is one the Message VPN does not hold - which is the ordinary state of the pointer every endpoint ships with, and what makes a message given up on disappear rather than move.

func (*SolaceService) MsgVPN added in v0.1.0

func (s *SolaceService) MsgVPN(connID int) (string, error)

MsgVPN is which Message VPN this connection reads.

func (*SolaceService) Publish added in v0.1.0

func (s *SolaceService) Publish(connID int, input SolacePublishInput) (*SolacePublishResult, error)

Publish sends to one queue or one topic and reports what the broker took.

func (*SolaceService) RemoveQueue added in v0.1.0

func (s *SolaceService) RemoveQueue(connID int, name string) error

RemoveQueue deletes a queue and whatever it was holding.

No purge flag: SEMP has no precondition to ask for, and it deletes a full queue as readily as an empty one. The confirmation on the board says so rather than this offering a guard the broker does not have.

func (*SolaceService) RemoveTopicEndpoint added in v0.1.0

func (s *SolaceService) RemoveTopicEndpoint(connID int, name string) error

RemoveTopicEndpoint deletes one, and whatever it was holding.

func (*SolaceService) Subscribe added in v0.1.0

func (s *SolaceService) Subscribe(connID int, queue, topic string) error

Subscribe adds a topic subscription to a queue.

Two arguments rather than a binding, because there is no exchange between a topic and a queue here: the source, the routing key and the handle are all the one topic string.

Nothing already spooled moves. A subscription added now attracts what is published from now on.

func (*SolaceService) Unsubscribe added in v0.1.0

func (s *SolaceService) Unsubscribe(connID int, queue, topic string) error

Unsubscribe drops a topic subscription from a queue. What it already brought stays where it is.

type StreamInput added in v0.0.6

type StreamInput struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	// Subjects is the list the stream captures, however the form separated it.
	// A mirror has none.
	Subjects string `json:"subjects"`
	// Retention is limits, interest or workqueue. Work queue is the one where
	// reading the stream changes what it holds.
	Retention string `json:"retention"`
	Storage   string `json:"storage"`
	Discard   string `json:"discard"`
	Replicas  int    `json:"replicas"`

	MaxMsgs           string `json:"maxMsgs"`
	MaxBytes          string `json:"maxBytes"`
	MaxMsgsPerSubject string `json:"maxMsgsPerSubject"`
	MaxMsgSize        string `json:"maxMsgSize"`
	// MaxAge and DuplicateWindow are Go durations - "24h", "2m" - because that
	// is what the server reports and what an operator writes.
	MaxAge          string `json:"maxAge"`
	DuplicateWindow string `json:"duplicateWindow"`

	Compression string `json:"compression"`
	DenyDelete  bool   `json:"denyDelete"`
	DenyPurge   bool   `json:"denyPurge"`
	AllowRollup bool   `json:"allowRollup"`
}

StreamInput is a stream as the dialog collects it.

Deliberately not TopicService.Create's shape. Every field there is RocketMQ's vocabulary and none of it has a JetStream meaning, and there is nowhere in it to put a subject list, a retention policy, or a limit - which is most of what declaring a stream is.

The limits are strings rather than numbers so that "not set" and "set to zero" stay different. -1 is how the server spells no limit, 0 means a stream that can hold nothing, and a numeric field that arrived empty would have to pick one of those for the user.

type SystemService

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

SystemService exposes application-level operations that need the desktop shell: version reporting, external links and file dialogs. The update lifecycle is UpdateService's.

func (*SystemService) DataDirectory

func (s *SystemService) DataDirectory() string

DataDirectory reports where the app keeps its files. The settings page draws the real path rather than one per platform for the reader to pick from.

func (*SystemService) ExportConfig

func (s *SystemService) ExportConfig() (string, error)

ExportConfig prompts for a destination and writes the full configuration. It returns the written path, or an empty string when the user cancels.

func (*SystemService) ImportConfig

func (s *SystemService) ImportConfig() (string, error)

ImportConfig prompts for a config file and applies it. It returns the source path, or an empty string when the user cancels.

func (*SystemService) OpenExternal

func (s *SystemService) OpenExternal(rawURL string) error

OpenExternal opens an allow-listed HTTPS URL in the user's browser.

func (*SystemService) RevealDataDirectory

func (s *SystemService) RevealDataDirectory() error

RevealDataDirectory opens the data directory in the platform's file manager. The directory is the app's own, never a path from the renderer.

func (*SystemService) Version

func (s *SystemService) Version() string

Version returns the running application version.

type TopicInput

type TopicInput struct {
	Topic      string `json:"topic"`
	BrokerAddr string `json:"brokerAddr"`
	ReadQueue  int    `json:"readQueue"`
	WriteQueue int    `json:"writeQueue"`
	Perm       string `json:"perm"`
}

TopicInput carries a topic form submission.

type TopicPermissionInput added in v0.0.2

type TopicPermissionInput struct {
	Vhost    string `json:"vhost"`
	Identity string `json:"identity"`
	Exchange string `json:"exchange"`
	Write    string `json:"write"`
	Read     string `json:"read"`
}

TopicPermissionInput narrows write and read on one topic exchange.

type TopicService

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

TopicService exposes destination operations to the frontend.

It speaks the canonical model. What RocketMQ has and another family does not - queue counts, permissions, the route table - travels in the destination's attribute map, whose keys the frontend's rocketmq module reads.

func (*TopicService) Create

func (s *TopicService) Create(connID int, input TopicInput) error

Create adds a topic on the target broker.

func (*TopicService) Detail

func (s *TopicService) Detail(connID int, topicName string) (*model.Destination, error)

Detail returns one topic with the fields only a per-topic lookup can fill: its route table, and the outbound rate that costs one request per group.

func (*TopicService) List

func (s *TopicService) List(connID int) ([]*model.Destination, error)

List returns the user-visible topics.

func (*TopicService) ListAll

func (s *TopicService) ListAll(connID int) ([]*model.Destination, error)

ListAll returns every topic, including system topics.

func (*TopicService) Remove

func (s *TopicService) Remove(connID int, topicName string, clusterName string) error

Remove deletes a topic from the cluster.

func (*TopicService) Stats

func (s *TopicService) Stats(connID int, topicName string) (map[string]interface{}, error)

Stats returns the per-queue statistics for a topic.

func (*TopicService) Update

func (s *TopicService) Update(connID int, input TopicInput) error

Update changes the configuration of an existing topic.

type TransactionView added in v0.0.3

type TransactionView struct {
	Transactions []*model.Transaction `json:"transactions"`

	// Holding is how many of them are keeping a partition's readers back. The
	// tab draws it as its badge: on a healthy cluster this is zero however
	// many transactions are listed.
	Holding int `json:"holding"`
}

TransactionView is the cluster page's transactions tab.

type TrimInput added in v0.0.5

type TrimInput struct {
	Stream   string `json:"stream"`
	Strategy string `json:"strategy"`
	// MaxLen is how many of the newest entries to keep, for the maxlen
	// strategy. Zero empties the stream and keeps the key, its groups and
	// their positions.
	MaxLen int64 `json:"maxLen"`
	// MinID is the lowest entry id to keep, for the minid strategy.
	MinID string `json:"minId"`
	// Approx lets the server stop at a node boundary. The stream then keeps at
	// least what was asked and possibly a little more, never less.
	Approx bool `json:"approx"`
}

TrimInput is a trim as the dialog collects it.

The strategy is a string rather than two methods because it is one command with two ways of naming a bound, and a page that had to pick an endpoint before the user picked a strategy would be the wrong shape.

type UpdateService

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

UpdateService exposes the update lifecycle to the renderer.

func NewUpdateService

func NewUpdateService(manager *update.Manager) *UpdateService

NewUpdateService wraps a manager for the renderer.

func (*UpdateService) Cancel

func (s *UpdateService) Cancel()

Cancel stops a download in flight.

func (*UpdateService) Check

func (s *UpdateService) Check() (update.State, error)

Check asks GitHub now, whatever the policy says. Pressing the button is the one case that reports every outcome, including "you are up to date".

func (*UpdateService) Download

func (s *UpdateService) Download() error

Download fetches and verifies the package for the newest release.

func (*UpdateService) Install

func (s *UpdateService) Install() error

Install applies the downloaded package and quits, having arranged for the application to start again once this process is gone.

func (*UpdateService) Skip

func (s *UpdateService) Skip(version string)

Skip stops a release from being announced again.

func (*UpdateService) State

func (s *UpdateService) State() update.State

State returns everything the update panel draws.

type WindowService

type WindowService struct{}

WindowService keeps the native window chrome in step with the renderer theme.

Everything else about the window - minimise, maximise, close - is driven from the frontend through the Wails window runtime and needs no binding here.

func (*WindowService) SetAppearance

func (s *WindowService) SetAppearance(dark bool)

SetAppearance applies the light or dark window background colour.

func (*WindowService) SetTitleBarHeight

func (s *WindowService) SetTitleBarHeight(height float64)

SetTitleBarHeight re-centres the macOS window buttons in a title bar the renderer has scaled. The buttons are native and keep their own size, so only the bar's height changes with the UI scale. No-op off macOS.

Jump to

Keyboard shortcuts

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