cli

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRootCommand

func NewRootCommand(build BuildInfo) *cobra.Command

func OutputModeHelp

func OutputModeHelp() string

func Render

func Render(w io.Writer, output OutputMode, result any) error

func SupportedOutputModeStrings

func SupportedOutputModeStrings() []string

Types

type BuildInfo

type BuildInfo struct {
	Version     string
	Commit      string
	Date        string
	Development bool
}

type CSVOutput

type CSVOutput interface {
	CSVRows() any
}

type JSONOutput

type JSONOutput interface {
	JSONValue() any
}

type MultiTableOutput

type MultiTableOutput interface {
	TableBlocks() []TableBlock
}

type NDJSONOutput

type NDJSONOutput interface {
	NDJSONRows() any
}

type Options

type Options struct {
	// 선택. 비어 있으면 MWOSA_CONFIG 또는 OS 기본 config 경로를 따른다.
	Config string

	// 필수. 명령 결과를 출력할 형식이다.
	Output OutputMode

	// 선택. 비어 있으면 provider router 가 요청에 맞는 provider 를 고른다.
	Provider string

	// 선택. 비어 있으면 provider router 의 기본 우선순위를 따른다.
	PreferProvider string

	// 필수. provider routing 과 storage query 에 사용할 시장 ID 다.
	Market string

	// 필수. 로컬 SQLite database 경로다.
	Database string

	ProviderAuthDatabase string
	ProviderConfig       provider.Config
	ConfigState          appconfig.Resolved

	Development bool
	// contains filtered or unexported fields
}

func (Options) Validate

func (opts Options) Validate() error

type OutputMode

type OutputMode string
const (
	DefaultOutputMode OutputMode = OutputModeTable

	OutputModeTable  OutputMode = "table"
	OutputModeJSON   OutputMode = "json"
	OutputModeNDJSON OutputMode = "ndjson"
	OutputModeCSV    OutputMode = "csv"
)

func ParseOutputMode

func ParseOutputMode(value string) (OutputMode, error)

func (*OutputMode) Set

func (m *OutputMode) Set(value string) error

func (OutputMode) String

func (m OutputMode) String() string

func (OutputMode) Type

func (m OutputMode) Type() string

type TableBlock

type TableBlock struct {
	Title  string
	Header []string
	Rows   [][]string
}

type TableOutput

type TableOutput interface {
	TableRows() (header []string, rows [][]string)
}

Jump to

Keyboard shortcuts

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