command

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 7 Imported by: 79

Documentation

Overview

Package command implements the root command for any microservice.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

Types

type Command

type Command interface {
	// CobraCommand returns the actual cobra command for the root command.
	CobraCommand() *cobra.Command
	// DaemonCommand returns the daemon sub command.
	DaemonCommand() daemon.Command
	// Execute represents the cobra run method.
	Execute(cmd *cobra.Command, args []string)
	// VersionCommand returns the version sub command.
	VersionCommand() version.Command
}

Command represents the root command for any microservice.

func New

func New(config Config) (Command, error)

New creates a new root command.

type Config

type Config struct {
	Logger        micrologger.Logger
	ServerFactory daemon.ServerFactory

	Description    string
	GitCommit      string
	Name           string
	Source         string
	Version        string
	VersionBundles []versionbundle.Bundle
	Viper          *viper.Viper
}

Config represents the configuration used to create a new root command.

Directories

Path Synopsis
Package daemon implements the daemon command for any microservice.
Package daemon implements the daemon command for any microservice.
Package version implements the version command for any microservice.
Package version implements the version command for any microservice.

Jump to

Keyboard shortcuts

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