cmd

package
v1.49.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 39 Imported by: 2

Documentation

Overview

Package cmd defines various public and internal commands.

Index

Constants

View Source
const PresharedKeyFlag = "grpc-preshared-key"

Variables

View Source
var ErrParsing = errors.New("parsing error")

Functions

func BoldBlue added in v1.36.0

func BoldBlue(name string) string

func BuildRootCommand added in v1.47.1

func BuildRootCommand() (*cobra.Command, error)

BuildRootCommand creates and configures the complete SpiceDB CLI command structure

func DeprecatedRunE added in v1.30.0

func DeprecatedRunE(fn cobrautil.CobraRunFunc, newCmd string) cobrautil.CobraRunFunc

DeprecatedRunE wraps the RunFunc with a warning log statement.

func HeadRevision added in v1.5.0

func HeadRevision(engine string) (string, error)

HeadRevision returns the latest migration revision for a given engine

func NewDatastoreCommand added in v1.16.0

func NewDatastoreCommand(programName string) (*cobra.Command, error)

func NewGCDatastoreCommand added in v1.16.0

func NewGCDatastoreCommand(programName string, cfg *datastore.Config) *cobra.Command

func NewHeadCommand added in v1.5.0

func NewHeadCommand(programName string) *cobra.Command

func NewLSPCommand added in v1.31.0

func NewLSPCommand(programName string, config *LSPConfig) *cobra.Command

func NewMigrateCommand added in v1.5.0

func NewMigrateCommand(programName string) *cobra.Command

func NewPostgresFDWCommand added in v1.49.0

func NewPostgresFDWCommand(programName string, config *PostgresFDWConfig) *cobra.Command

func NewRepairDatastoreCommand added in v1.28.0

func NewRepairDatastoreCommand(programName string, cfg *datastore.Config) *cobra.Command

func NewRootCommand added in v1.5.0

func NewRootCommand(programName string) *cobra.Command

func NewServeCommand added in v1.5.0

func NewServeCommand(programName string, config *server.Config) *cobra.Command

func NewTestingCommand added in v1.5.0

func NewTestingCommand(programName string, config *testserver.Config) *cobra.Command

func NewVersionCommand added in v1.5.0

func NewVersionCommand(programName string) *cobra.Command

func RegisterDatastoreRootFlags added in v1.16.0

func RegisterDatastoreRootFlags(_ *cobra.Command)

func RegisterHeadFlags added in v1.5.0

func RegisterHeadFlags(cmd *cobra.Command)

func RegisterLSPFlags added in v1.31.0

func RegisterLSPFlags(cmd *cobra.Command, config *LSPConfig) error

func RegisterMigrateFlags added in v1.5.0

func RegisterMigrateFlags(cmd *cobra.Command)

func RegisterPostgresFDWFlags added in v1.49.0

func RegisterPostgresFDWFlags(cmd *cobra.Command, config *PostgresFDWConfig) error

func RegisterRootFlags added in v1.5.0

func RegisterRootFlags(cmd *cobra.Command) error

func RegisterServeFlags added in v1.5.0

func RegisterServeFlags(cmd *cobra.Command, config *server.Config) error

func RegisterTestingFlags added in v1.5.0

func RegisterTestingFlags(cmd *cobra.Command, config *testserver.Config)

func RegisterVersionFlags added in v1.5.0

func RegisterVersionFlags(cmd *cobra.Command)

func SignalContextWithGracePeriod

func SignalContextWithGracePeriod(ctx context.Context, gracePeriod time.Duration) context.Context

SignalContextWithGracePeriod creates a new context that will be cancelled when an interrupt/SIGTERM signal is received and the provided grace period subsequently finishes.

Types

type LSPConfig added in v1.31.0

type LSPConfig struct {
	// Addr is the address to listen on to serve the language server protocol.
	Addr string

	Stdio bool
}

LSPConfig is the configuration for the LSP command.

func (*LSPConfig) Complete added in v1.31.0

func (c *LSPConfig) Complete(ctx context.Context) (*lsp.Server, error)

Complete adapts the LSPConfig into a usable LSP server.

type PostgresFDWConfig added in v1.49.0

type PostgresFDWConfig struct {
	// SpiceDB connection config
	SpiceDBEndpoint          string
	SecureSpiceDBAccessToken string
	SpiceDBInsecure          bool

	// Postgres FDW server config
	PostgresEndpoint    string
	PostgresUsername    string // Username that Postgres will use to connect to the FDW proxy
	SecureAccessToken   string // Password that Postgres will use to authenticate to the FDW proxy
	ShutdownGracePeriod time.Duration
}

PostgresFDWConfig is the configuration for the Postgres FDW command.

func (*PostgresFDWConfig) Complete added in v1.49.0

Complete adapts the PostgresFDWConfig into a runnable Postgres FDW server.

type RunnablePostgresFDWServer added in v1.49.0

type RunnablePostgresFDWServer interface {
	Run(ctx context.Context) error
	Close() error
}

RunnablePostgresFDWServer is a Postgres FDW server ready to run

Directories

Path Synopsis
Code generated by github.com/ecordell/optgen.
Code generated by github.com/ecordell/optgen.
Code generated by github.com/ecordell/optgen.
Code generated by github.com/ecordell/optgen.
Code generated by github.com/ecordell/optgen.
Code generated by github.com/ecordell/optgen.
Code generated by github.com/ecordell/optgen.
Code generated by github.com/ecordell/optgen.

Jump to

Keyboard shortcuts

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