Documentation
¶
Overview ¶
Package console is a lightweight, server-rendered web UI for inspecting and managing a doze-aws Stack — an "AWS console, but local and better". It is itself just another client of the gateway (in-process), so it never bypasses the real API. HTMX (vendored, embedded) drives partial updates; there is no SPA build step and the whole thing ships inside the Go binary.
Index ¶
- func PresignURL(host, bucket, key string, ttl time.Duration) string
- func QueueARN(name string) string
- type Bucket
- type BucketConfig
- type BucketProps
- type Bus
- type Console
- type CreateFunctionOpts
- type EBArchive
- type EBReplay
- type FlowDiagram
- type FlowEdge
- type FlowGraph
- type FlowNode
- type Function
- type GSI
- type GSICreate
- type InvokeResult
- type Item
- type KV
- type Key
- type LambdaRuntimeState
- type Mapping
- type MoveTask
- type MsgAttr
- type MsgSummary
- type Neighbor
- type Neighborhood
- type NotifyRule
- type ObjVersion
- type Object
- type ObjectMeta
- type Options
- type Parameter
- type QueryOpts
- type Queue
- type Recorder
- type Rule
- type SQSCreateOpts
- type SQSMessage
- type Secret
- type SendOpts
- type Subscription
- type Table
- type TableCreateOpts
- type Target
- type Topic
- type TrafficEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PresignURL ¶
PresignURL builds a share link the gateway accepts: doze-aws parses the SigV4 presigned form without verifying the signature, but DOES enforce the expiry — so the link genuinely stops working when it says it will.
Types ¶
type BucketConfig ¶
type BucketProps ¶
type BucketProps struct {
Name string
ARN string
Region string
Versioning string // Enabled | Suspended | Disabled
ObjectLock bool
Tags []KV
Configs []BucketConfig // which optional configs exist, with raw payloads
}
BucketProps is everything the bucket Properties tab shows.
type Console ¶
type Console struct {
// contains filtered or unexported fields
}
Console is the web-UI http.Handler. Mount it under a path prefix (default "/_console") alongside the AWS gateway.
type CreateFunctionOpts ¶
type CreateFunctionOpts struct {
Name string
Runtime string
Handler string
Code string // local path (the _local_ extension)
Timeout int
Memory int
Env map[string]string
}
CreateFunctionOpts is the create-function form's payload.
type FlowDiagram ¶
type FlowDiagram struct {
Label string
Nodes []FlowNode // local coordinates within this card's SVG
Edges []FlowEdge // edges internal to this flow
W, H int
}
FlowDiagram is one independent connected flow, rendered as its own card with a self-contained SVG (local coordinates).
type FlowGraph ¶
type FlowGraph struct {
Diagrams []FlowDiagram // one per independent flow
Unwired []FlowNode // unconnected resources (chips)
NodeCount int
Conns int
Flows int
}
type InvokeResult ¶
type InvokeResult struct {
Payload string
FnError string
Logs string
Duration string
Status int
Async bool
}
InvokeResult is one playground invocation's outcome.
type Item ¶
type Item struct {
PK string
SK string
Preview string // truncated single-line JSON of the non-key attributes
Attrs map[string]string // per-attribute display values (feeds real columns)
JSON string // full pretty plain-JSON
KeyJSON string // the primary-key AV map as JSON (for DeleteItem)
}
Item is one scanned row prepared for display.
type LambdaRuntimeState ¶
type LambdaRuntimeState struct {
Warm bool
Runners int
IdleSecs int
SleepAt int64 // unix seconds the warm pool will scale to zero; 0 = no countdown
}
LambdaRuntimeState is a function's live process state (doze extension).
func (LambdaRuntimeState) Counting ¶
func (s LambdaRuntimeState) Counting() bool
Counting reports whether a live sleep countdown is running.
func (LambdaRuntimeState) IdleLabel ¶
func (s LambdaRuntimeState) IdleLabel() string
IdleLabel renders the idle window compactly, e.g. "10m", "1h", "45s".
func (LambdaRuntimeState) SleepLabel ¶
func (s LambdaRuntimeState) SleepLabel() string
SleepLabel renders the initial countdown for the server-side render; the client then ticks it every second.
func (LambdaRuntimeState) SleepLeft ¶
func (s LambdaRuntimeState) SleepLeft() int
SleepLeft is the seconds remaining until the process sleeps, from the server's clock. The client re-bases this against its own clock the moment it receives it, so a skewed browser clock can't drift the countdown.
type MoveTask ¶
type MoveTask struct {
Status string // RUNNING | COMPLETED | FAILED | CANCELLED
Dest string
Moved int64
Failure string
}
MoveTask is one redrive task's progress.
type MsgAttr ¶
type MsgAttr struct{ Name, Type, Value string }
MsgAttr is one user message attribute (metadata alongside the body).
type MsgSummary ¶
type MsgSummary struct {
Kind string // chip label: "s3 event", "sns · orders", "eb event", "json", "text"
Svc string // service color for the chip; "" = neutral
Line string // the one-line summary
Note string // envelope/meta context shown in the expanded view
BodyHTML template.HTML // pretty, syntax-lit body for the expanded view
Raw string // the display body as plain text (copy target)
}
MsgSummary is the display form of a message body. The console generates the AWS event shapes it delivers (S3 notifications, SNS envelopes, EventBridge events), so it can recognize them and lead with what happened instead of a wall of wire JSON.
type Neighbor ¶
type Neighbor struct {
Svc string
Name string
Kind string // the edge kind (sub / target / esm / redrive / dlq / dest / notify)
URL string
}
Neighbor is one adjacent resource in a Connections view.
type Neighborhood ¶
type Neighborhood struct {
Upstream []Neighbor // edges INTO this node
Downstream []Neighbor // edges OUT of this node
}
Neighborhood is a resource's 1-hop wiring: what feeds it and where it drains.
type NotifyRule ¶
type NotifyRule struct {
Kind string // sqs | sns | lambda
Name string // destination resource name
Events []string
Prefix string
Suffix string
}
NotifyRule is one editable bucket-notification wiring.
type ObjVersion ¶
type ObjVersion struct {
VersionID string
IsLatest bool
DeleteMarker bool
Size int64
LastModified string
}
ObjVersion is one entry in an object's version history.
type ObjectMeta ¶
type ObjectMeta struct {
Key string
Size string
SizeBytes int64
ContentType string
ETag string
LastModified string
StorageClass string
IsImage bool
IsText bool
}
ObjectMeta is the metadata surfaced in the object detail drawer.
type Options ¶
type Options struct {
// Peers resolves each AWS service to an endpoint the console reads and writes
// through. Embedded: peers.InProcess over the stack's service handlers. Module
// topology: peers.FromEnv() (per-service unix sockets). The console routes
// each request to the owning service via gateway.Route, so one console fronts
// either topology unchanged.
Peers peers.Directory
// Recorder, if set, feeds the Traffic surface. Wrap the gateway with
// NewRecorder for external SDK/CLI calls and pass that recorder here. Leave
// nil in topologies where the console doesn't sit in the external request
// path (the Traffic surface then reports capture off).
Recorder *Recorder
// Prefix is the URL path the console is mounted under; defaults to
// "/_console".
Prefix string
}
Options configures the console.
type QueryOpts ¶
type QueryOpts struct {
Index string // GSI name, or "" for the base table
PKValue string
SKOp string // "", "=", "<", "<=", ">", ">=", "begins_with", "between"
SKValue string
SKValue2 string // for "between"
Filter string // optional FilterExpression on non-key attributes
FilterVals map[string]any // :binding → typed AttributeValue for the filter
FilterNames map[string]string // #alias → attribute name for the filter
Limit int
Cursor string // opaque pagination cursor (ExclusiveStartKey)
}
QueryOpts describes a key-based query against the base table or a GSI.
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
Recorder is gateway middleware that keeps a ring buffer of the most recent AWS API calls an external SDK/CLI made against the endpoint. The console's own in-process client bypasses it (it talks to the raw gateway), so the tail only shows the app's traffic — the answer to "what did my app just do?".
func NewRecorder ¶
NewRecorder wraps the AWS gateway handler with traffic capture.
func (*Recorder) Clear ¶
func (rec *Recorder) Clear()
Clear empties the ring. Seq keeps counting up so live-poll hashes stay monotonic across a clear.
func (*Recorder) Entries ¶
func (rec *Recorder) Entries(sinceSeq int64) []TrafficEntry
Entries returns recorded calls, newest first, with Seq > sinceSeq.
func (*Recorder) Get ¶
func (rec *Recorder) Get(seq int64) (TrafficEntry, bool)
Get returns the entry with the given sequence number, if it is still in the ring (the inspector drawer loads entries by seq).
type SQSCreateOpts ¶
type SQSCreateOpts struct {
Name string
FIFO bool
ContentBasedDedup bool // FIFO: dedup by body hash instead of explicit IDs
VisibilityTimeout string // seconds
RetentionSeconds string
DelaySeconds string
DLQName string // existing queue name for the redrive policy
MaxReceiveCount string
}
SQSCreateOpts carries the console create dialog's full option set.
type SQSMessage ¶
type SQSMessage struct {
MessageID string
ReceiptHandle string
Body string
SentAt string
GroupID string // FIFO: MessageGroupId
DedupID string // FIFO: MessageDeduplicationId
SeqNo string // FIFO: SequenceNumber
Receives string // ApproximateReceiveCount (real receives; peeks don't count)
Attrs []MsgAttr
Sum MsgSummary // display form, filled by the handler before render
}
type SendOpts ¶
type SendOpts struct {
GroupID string // FIFO: required group
DedupID string // FIFO: explicit dedup ID; blank auto-generates one
Delay string // standard queues: per-message DelaySeconds
Attrs []MsgAttr // message attributes (metadata)
}
SendOpts carries everything a message can be published with.
type Subscription ¶
type TableCreateOpts ¶
type TableCreateOpts struct {
Name string
HashKey, HashType string
RangeKey, RangeType string
GSIs []GSICreate
TTLAttr string // enable TTL on this attribute after creation
}
TableCreateOpts is the full create-table request the console form builds.
type Topic ¶
type Topic struct {
Name string
ARN string
Subs int
SubList []Subscription // the subscriptions behind Subs — BuildGraph reuses them
}
type TrafficEntry ¶
type TrafficEntry struct {
Seq int64
At time.Time
Service string
Action string
Resource string
Status int
Millis float64
ReqBody string // captured for JSON/query bodies (bounded); redacted
RespBody string // first 8KB of a text response; redacted
RespCT string // response Content-Type
Method string
Path string // path + query, for replay
Host string
CT string // Content-Type
Target string // X-Amz-Target
}
TrafficEntry is one recorded call.
func (TrafficEntry) Curl ¶
func (e TrafficEntry) Curl() string
Curl renders the entry as a replayable curl command. The body is the recorder's redacted copy, so masked secrets stay masked in the repro.
Source Files
¶
- client.go
- client_ddb.go
- client_eb.go
- client_flow.go
- client_lambda.go
- client_s3x.go
- client_sec.go
- client_sns.go
- client_tags.go
- console.go
- handlers.go
- handlers_create.go
- handlers_ddb.go
- handlers_eb.go
- handlers_lambda.go
- handlers_s3b.go
- handlers_sec.go
- handlers_sns.go
- handlers_surfaces.go
- handlers_tags.go
- icons.go
- ssmtree.go
- static.go
- summarize.go
- traffic.go
- valueworkspace.go