cmd

package
v0.0.0-...-e105d0e Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	USAGE     = "Usage"
	CORECMD   = "Core commands"
	HELPCMD   = "Help topics"
	OTHERCMD  = "Other commands"
	FLAGS     = "Flags"
	IFLAGS    = "Inherited flags"
	ARGUMENTS = "Arguments"
	EXAMPLES  = "Examples"
	ENVS      = "Environment variables"
	LEARN     = "Learn more"
	FEEDBACK  = "Feedback"
)
View Source
const Description = `` /* 1583-byte string literal not displayed */

Variables

View Source
var (
	ErrClientConfigNotFound = errors.New(heredoc.Doc(`
		gateway client config not found.

		Run "gateway config init" to initialize a new client config or
		Run "gateway help environment" for more information.
	`))
	ErrClientConfigHostNotFound = errors.New(heredoc.Doc(`
		gateway client config "host" not found.

		Pass gateway server host with "--host" flag or 
		set host in gateway config.

		Run "gateway config <subcommand>" or
		"gateway help environment" for more information.
	`))
	ErrClientNotAuthorized = errors.New(heredoc.Doc(`
		gateway auth error. gateway requires an auth header.
		
		Run "gateway help auth" for more information.
	`))
)

Functions

func ConfigCommand

func ConfigCommand() *cobra.Command

func GenEncryptionKeyCommand

func GenEncryptionKeyCommand() *cobra.Command

func New

func New(cliConfig *Config) *cobra.Command

func RunMigrations

func RunMigrations(logger *slog.Logger, config database.Config) error

func RunRollback

func RunRollback(logger *slog.Logger, config database.Config) error

func Serve

func Serve(cfg *config.Config) *api.API

func ServerCommand

func ServerCommand() *cobra.Command

func SetHelp

func SetHelp(cmd *cobra.Command)

SetHelp sets a custom help and usage function. It allows to group commands in different sections based on cobra commands annotations.

Types

type Config

type Config struct {
	Host string `yaml:"host" mapstructure:"host" json:"host,omitempty" default:"http://localhost:8080"`
}

func LoadConfig

func LoadConfig() (*Config, error)

Jump to

Keyboard shortcuts

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