Documentation ¶
Index ¶
- func AddBothBoolFlags(f *pflag.FlagSet, p *bool, name, short string, value bool, usage string)
- func AddBothBoolFlagsUnhidden(f *pflag.FlagSet, p *bool, name, short string, value bool, usage string)
- func CombineDateAndTime(date time.Time, t time.Time) time.Time
- func FirstCharToLower(s string) string
- func InvertUsage(usage string) string
- func MakePersistentPreRunE(validator func(*cobra.Command, []string) error) func(*cobra.Command, []string) error
- func MapSearch[K comparable, V comparable](m map[K]V, search V) *K
- func Must[T any](v T, err error) T
- func MustNot[T any](v T, err error) T
- func NewQuickFixLogFactory(logger *zerolog.Logger) quickfix.LogFactory
- func PrettyOptionValues[T any](input map[string]T) []string
- func QuickFixMessagePartSetDecimal[T quickfix.FieldWriter, T2 ~string](setter QuickFixMessagePartSetter, value T2, f func(decimal.Decimal, int32) T, ...)
- func QuickFixMessagePartSetString[T quickfix.FieldWriter, T2 ~string](setter QuickFixMessagePartSetter, value T2, f func(T2) T)
- func ReconcileBoolFlags(f *pflag.FlagSet) error
- func Search[T comparable](slice []T, search T) int
- func ValidateRequiredFlags(c *cobra.Command) error
- type QuickFixAppMessageLogger
- func (app *QuickFixAppMessageLogger) LogMessage(level zerolog.Level, message *quickfix.Message, sessionID quickfix.SessionID, ...)
- func (app *QuickFixAppMessageLogger) LogMessageType(message *quickfix.Message, sessionID quickfix.SessionID, log string)
- func (app *QuickFixAppMessageLogger) WriteField(w io.Writer, field quickfix.TagValue)
- func (app *QuickFixAppMessageLogger) WriteMessageBodyAsTable(w io.Writer, message *quickfix.Message)
- type QuickFixMessagePartSetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddBothBoolFlags ¶
AddBothBoolFlags adds the given flag in both `--foo` and `--no-foo` variants. If you do this, make sure you call ReconcileBoolFlags later to catch errors and set the relationship between the flag values. Only the flag that does the non-default behavior is visible; the other is hidden.
func AddBothBoolFlagsUnhidden ¶
func AddBothBoolFlagsUnhidden(f *pflag.FlagSet, p *bool, name, short string, value bool, usage string)
AddBothBoolFlagsUnhidden is just like AddBothBoolFlags but shows both flags.
func FirstCharToLower ¶
FirstCharToLower converts first char in given string to lowercase
func InvertUsage ¶
InvertUsage inverts the usage string with prefix "Do not"
func MakePersistentPreRunE ¶
func MakePersistentPreRunE(validator func(*cobra.Command, []string) error) func(*cobra.Command, []string) error
MakePersistentPreRunE returns a PersistentPreRunE function.
func MapSearch ¶
func MapSearch[K comparable, V comparable](m map[K]V, search V) *K
func NewQuickFixLogFactory ¶
func NewQuickFixLogFactory(logger *zerolog.Logger) quickfix.LogFactory
NewQuickFixLogFactory creates an instance of LogFactory that writes messages and events to stdout.
func PrettyOptionValues ¶
func QuickFixMessagePartSetDecimal ¶
func QuickFixMessagePartSetDecimal[T quickfix.FieldWriter, T2 ~string](setter QuickFixMessagePartSetter, value T2, f func(decimal.Decimal, int32) T, scale int32)
func QuickFixMessagePartSetString ¶
func QuickFixMessagePartSetString[T quickfix.FieldWriter, T2 ~string](setter QuickFixMessagePartSetter, value T2, f func(T2) T)
func ReconcileBoolFlags ¶
ReconcileBoolFlags sets the value of the all the "--foo" flags based on "--no-foo" if provided, and returns an error if both were provided or an explicit value of false was provided to either (as that's confusing).
func Search ¶
func Search[T comparable](slice []T, search T) int
func ValidateRequiredFlags ¶
ValidateRequiredFlags is a public version of cobra's Command.validateRequiredFlags().
Types ¶
type QuickFixAppMessageLogger ¶
type QuickFixAppMessageLogger struct { Logger *zerolog.Logger TransportDataDictionary *datadictionary.DataDictionary AppDataDictionary *datadictionary.DataDictionary }
func (*QuickFixAppMessageLogger) LogMessage ¶
func (*QuickFixAppMessageLogger) LogMessageType ¶
func (*QuickFixAppMessageLogger) WriteField ¶
func (app *QuickFixAppMessageLogger) WriteField(w io.Writer, field quickfix.TagValue)
func (*QuickFixAppMessageLogger) WriteMessageBodyAsTable ¶
func (app *QuickFixAppMessageLogger) WriteMessageBodyAsTable(w io.Writer, message *quickfix.Message)
type QuickFixMessagePartSetter ¶
type QuickFixMessagePartSetter interface {
Set(field quickfix.FieldWriter) *quickfix.FieldMap
}