Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildMessage ¶
func BuildMessage[T any](opts ...BuilderOptions) []*builder.MessageBuilder
Types ¶
type Builder ¶
type Builder struct {
BuilderOptions
// contains filtered or unexported fields
}
func (*Builder) BuildMessage ¶
func (b *Builder) BuildMessage(msgType reflect.Type, newFieldHook func(f *builder.FieldBuilder, rf reflect.StructField)) *builder.MessageBuilder
type BuilderOptions ¶
type BuilderOptions struct {
// Tags to use to get field names, in order of preference.
FieldNameFromTags []string
// Called for each field. The provided options can be modified before
// the field is added to the message by returning a mutator function.
EditFlagOptions func(rf reflect.StructField) func(*cli.FlagOptions)
// Called for each field. The provided comment can be modified before
// the field is added to the message.
EditFieldComment func(rf reflect.StructField, in *string)
// Called for each field. If it returns true, the field will be skipped.
SkipFieldFunc func(rf reflect.StructField) bool
CustomFieldTypes map[reflect.Type]func() *builder.FieldType
AllScalarFieldsOptional bool
}
type FlagRegistrar ¶ added in v0.11.1
Click to show internal directories.
Click to hide internal directories.