MCPcopy Create free account
hub / github.com/goadesign/goa / NewFlagData

Function NewFlagData

codegen/cli/cli.go:334–347  ·  view source on GitHub ↗

NewFlagData creates a new FlagData from the given argument attributes. svcn is the service name en is the endpoint name name is the flag name typeName is the flag type description is the flag description required determines if the flag is required example is an example value for the flag

(svcn, en, name, typeName, description string, required bool, example, def any)

Source from the content-addressed store, hash-verified

332// required determines if the flag is required
333// example is an example value for the flag
334func NewFlagData(svcn, en, name, typeName, description string, required bool, example, def any) *FlagData {
335 ex := jsonExample(example)
336 fn := goifyTerms(svcn, en, name)
337 return &FlagData{
338 Name: codegen.KebabCase(name),
339 VarName: codegen.Goify(name, false),
340 Type: flagType(typeName),
341 FullName: fn,
342 Description: description,
343 Required: required,
344 Example: ex,
345 Default: def,
346 }
347}
348
349// FieldLoadCode returns the code used in the build payload function that
350// initializes one of the payload object fields. It returns the initialization

Callers 4

buildFlagsFunction · 0.92
makeFlagsFunction · 0.92
streamFlagFunction · 0.92
makeFlagsFunction · 0.92

Calls 5

KebabCaseFunction · 0.92
GoifyFunction · 0.92
jsonExampleFunction · 0.85
goifyTermsFunction · 0.85
flagTypeFunction · 0.85

Tested by

no test coverage detected