output

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package output formats command results for human and machine consumers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnonKeys added in v0.5.0

func AnonKeys(w io.Writer, keys []apiclient.AnonKey)

AnonKeys renders a project's anon keys. The key value is the publishable JWT for the frontend/SDK Authorization header, so it is printed in full.

func Database

func Database(w io.Writer, database *apiclient.Database, showConnectionString bool)

Database renders one database.

func DatabaseCreated

func DatabaseCreated(w io.Writer, database *apiclient.Database, showConnectionString bool)

DatabaseCreated renders a newly created database.

func Databases

func Databases(w io.Writer, page *apiclient.PaginatedDatabases, showConnectionString bool, commandPrefix ...string)

Databases renders one database list page.

func FormatTimeAgo

func FormatTimeAgo(t time.Time) string

FormatTimeAgo returns a compact relative timestamp or "-".

func FormatTimestamp

func FormatTimestamp(t time.Time) string

FormatTimestamp returns a local RFC3339 timestamp or "-".

func Frontend

func Frontend(w io.Writer, fe *apiclient.Frontend)

Frontend renders one frontend detail view.

func FrontendCustomDomain

func FrontendCustomDomain(w io.Writer, domain *apiclient.FrontendCustomDomainResponse)

FrontendCustomDomain renders one custom domain detail view.

func FrontendCustomDomains

func FrontendCustomDomains(w io.Writer, entries []FrontendCustomDomainEntry)

FrontendCustomDomains renders custom domains configured for frontends.

func Frontends

func Frontends(w io.Writer, page *apiclient.PaginatedFrontends, commandPrefix ...string)

Frontends renders one frontend list page.

func Function

func Function(w io.Writer, fn *apiclient.Function)

Function renders one function.

func FunctionRuntimes

func FunctionRuntimes(w io.Writer, runtimes []apiclient.FunctionRuntimeOption)

FunctionRuntimes renders function runtime options.

func Functions

func Functions(w io.Writer, page *apiclient.PaginatedFunctions, commandPrefix ...string)

Functions renders one function list page.

func LocalModeDockerUnavailable

func LocalModeDockerUnavailable(w io.Writer)

LocalModeDockerUnavailable renders Docker setup guidance for local mode.

func LocalModeNotRunning

func LocalModeNotRunning(w io.Writer)

LocalModeNotRunning renders the local-mode status when the stack is stopped.

func LocalModeStatus

func LocalModeStatus(w io.Writer, details LocalModeStatusDetails)

LocalModeStatus renders local-mode service status and metadata.

func LogEvents

func LogEvents(w io.Writer, events []apiclient.LogEvent)

LogEvents renders function log events.

func LogSearchEvents added in v0.0.4

func LogSearchEvents(w io.Writer, events []apiclient.LogSearchEvent)

LogSearchEvents renders function log search events.

func Note

func Note(w io.Writer, format string, args ...any)

Note prints an informational note line.

func PrintLogStreamEvent added in v0.0.4

func PrintLogStreamEvent(w io.Writer, event *api.ProjectLogStreamEvent)

PrintLogStreamEvent renders one parsed project log stream event.

func PrintSearchLogs added in v0.0.4

func PrintSearchLogs(w io.Writer, fetch SearchLogsFetcher) error

PrintSearchLogs renders paginated searched log events from fetch until the response signals no more pages or the cursor cannot be advanced.

func PrintSearchLogsSkipping added in v0.0.4

func PrintSearchLogsSkipping(w io.Writer, fetch SearchLogsFetcher, skip map[string]struct{}) error

PrintSearchLogsSkipping renders paginated searched log events, excluding IDs already present in skip.

func Project

func Project(w io.Writer, project *apiclient.Project)

Project renders one project.

func ProjectConfigApplyReport added in v0.0.5

func ProjectConfigApplyReport(w io.Writer, result *apiclient.ProjectConfigApplyResult)

ProjectConfigApplyReport renders the server's config apply (or dry-run) report: per-section action counts, per-entry errors and notices, and prominent warnings for skipped and missing resources.

func ProjectConfigValidationErrors added in v0.0.5

func ProjectConfigValidationErrors(w io.Writer, errs []apiclient.ProjectConfigValidationError)

ProjectConfigValidationErrors renders the server's 422 validation error list, one line per entry.

func Projects

func Projects(w io.Writer, cfg *config.Config, page *apiclient.PaginatedProjects)

Projects renders one project list page.

func Scheduler

func Scheduler(w io.Writer, scheduler *apiclient.FunctionScheduler)

Scheduler renders one scheduler.

func Schedulers

Schedulers renders schedulers configured for a function.

func StorageBucket

func StorageBucket(w io.Writer, bucket *apiclient.StorageBucket)

StorageBucket renders one bucket detail view.

func StorageBuckets

func StorageBuckets(w io.Writer, buckets []apiclient.StorageBucket)

StorageBuckets renders one bucket list.

func StorageObject

func StorageObject(w io.Writer, bucketName string, object *apiclient.StorageObject)

StorageObject renders one object detail view.

func StorageObjects

func StorageObjects(w io.Writer, bucketName string, page *apiclient.StorageListResponse, commandPrefix ...string)

StorageObjects renders one cursor page of objects.

func StoragePolicies

func StoragePolicies(w io.Writer, bucketName string, policies []apiclient.StoragePolicy)

StoragePolicies renders one policy list.

func StoragePolicy

func StoragePolicy(w io.Writer, bucketName string, policy *apiclient.StoragePolicy)

StoragePolicy renders one policy detail view.

func StorageStats

func StorageStats(w io.Writer, stats *apiclient.StorageStats)

StorageStats renders aggregate project storage usage.

func Success

func Success(w io.Writer, format string, args ...any)

Success prints a check-marked success line.

func Truncate

func Truncate(value string, maxLen int) string

Truncate shortens value to maxLen using an ellipsis when practical.

func Variable

func Variable(w io.Writer, variable *apiclient.Variable)

Variable renders one project variable.

func Variables

func Variables(w io.Writer, page *apiclient.PaginatedVariables, commandPrefix ...string)

Variables renders one variable list page.

func Warning

func Warning(w io.Writer, format string, args ...any)

Warning prints a warning line.

Types

type FrontendCustomDomainEntry

type FrontendCustomDomainEntry struct {
	FrontendName string
	FrontendID   string
	Domain       apiclient.FrontendCustomDomainResponse
}

FrontendCustomDomainEntry contains one frontend custom domain row.

type LocalModeServiceStatus

type LocalModeServiceStatus struct {
	Name    string
	Running bool
}

LocalModeServiceStatus is one local-mode service status row.

type LocalModeStatusDetails

type LocalModeStatusDetails struct {
	Services    []LocalModeServiceStatus
	ProjectID   string
	UserID      string
	APIURL      string
	AnonKey     string
	ServiceKey  string
	DatabaseURL string
	PSQLCommand string
}

LocalModeStatusDetails contains the data rendered by `volcano status`.

type SearchLogsFetcher added in v0.0.4

type SearchLogsFetcher func(cursor string) (*apiclient.LogSearchResponse, error)

SearchLogsFetcher fetches one page of searched log events. An empty cursor requests the first page.

Jump to

Keyboard shortcuts

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