MCPcopy Create free account
hub / github.com/DoNewsCode/core / getHandler

Function getHandler

config/module.go:232–241  ·  view source on GitHub ↗
(style string)

Source from the content-addressed store, hash-verified

230}
231
232func getHandler(style string) (handler, error) {
233 switch style {
234 case "json":
235 return rewriteHandler{codec: json.NewCodec(json.WithIndent(" "))}, nil
236 case "yaml":
237 return appendHandler{codec: yaml.Codec{}}, nil
238 default:
239 return nil, fmt.Errorf("unsupported config style %s", style)
240 }
241}
242
243type handler interface {
244 flags() int

Callers 1

ProvideCommandMethod · 0.85

Calls 2

NewCodecFunction · 0.92
WithIndentFunction · 0.92

Tested by

no test coverage detected