Documentation
¶
Index ¶
- Constants
- Variables
- func AskBool(cmd *cobra.Command, flagName string, args *[]string, opts ...survey.AskOpt) (bool, error)
- func AskCommand(cmd *cobra.Command, def *cobra.Command, opts ...survey.AskOpt) (*cobra.Command, error)
- func AskLDAPDataInterchangeFormat(requests *ldif.LDIF, editor string) (bool, error)
- func AskMultiline(cmd *cobra.Command, flagName string, args *[]string, opts ...survey.AskOpt) (bool, error)
- func AskString(cmd *cobra.Command, flagName string, args *[]string, password bool, def string, ...) (bool, error)
- func AskStrings(cmd *cobra.Command, flagName string, options, def []string, args *[]string, ...) (bool, error)
- func CheckColors(fn func(string, ...any) string, format string, a ...any) string
- func Flush(results attributes.Maps, requests *ldif.LDIF, format string, out io.Writer) error
- func GetFieldsForBind(bindParameters *auth.BindParameters, dialOptions *auth.DialOptions) logrus.Fields
- func GetFieldsForSearch(searchArguments *client.SearchArguments) logrus.Fields
- func Is256ColorSupported() bool
- func IsColorEnabled() bool
- func IsTerminal(f *os.File) bool
- func IsTrueColorSupported() bool
- func ListSupportedFormats(quote bool) (list []string)
- func PrintlnAndExit(format string, a ...any)
- func SniffFormat(filename, format string) string
- func Stderr() *os.File
- func Stdin() *os.File
- func Stdout() *os.File
- func TerminalSize(f *os.File) (int, int, error)
- type Fields
Constants ¶
View Source
const ( CSV = "csv" DEFAULT = "default" LDIF = "ldif" YAML = "yaml" )
Variables ¶
View Source
var Logger = func() *logrus.Logger { l := logrus.New() l.SetLevel(logrus.WarnLevel) l.SetOutput(Stdout()) l.SetFormatter(&logrus.JSONFormatter{ DisableHTMLEscape: true, PrettyPrint: true, }) supererrors.RegisterCallback(func(err error) { l.SetOutput(Stderr()) if l.Level >= logrus.DebugLevel { err = tracerr.Wrap(err) var frames []string for _, frame := range err.(tracerr.Error).StackTrace() { switch ctx := frame.String(); { case strings.Contains(ctx, "supererrors.Except"), strings.Contains(ctx, "runtime.main()"), strings.Contains(ctx, "runtime.goexit()"): continue default: frames = append(frames, frame.String()) } } l.WithField("stack", frames).Fatalln(err) } l.SetFormatter(&logrus.TextFormatter{ ForceColors: IsColorEnabled(), DisableTimestamp: true, DisableLevelTruncation: true, }) l.Fatalln(err) }) return l }()
App logger (default format JSON).
Functions ¶
func AskCommand ¶
func AskMultiline ¶
func AskStrings ¶
func GetFieldsForBind ¶
func GetFieldsForBind(bindParameters *auth.BindParameters, dialOptions *auth.DialOptions) logrus.Fields
func GetFieldsForSearch ¶
func GetFieldsForSearch(searchArguments *client.SearchArguments) logrus.Fields
func Is256ColorSupported ¶
func Is256ColorSupported() bool
func IsColorEnabled ¶
func IsColorEnabled() bool
func IsTerminal ¶
func IsTrueColorSupported ¶
func IsTrueColorSupported() bool
func ListSupportedFormats ¶
func SniffFormat ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.