cmd

package
v0.0.0-...-b369aa6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var API api.API

API objects

View Source
var RootCmd = &cobra.Command{
	Use:   "mdcloud",
	Short: "Metadefender Cloud API wrapper",
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		switch formatter {
		case "json":
			logrus.SetFormatter(&logrus.JSONFormatter{})

		case "logstash":
			logrus.SetFormatter(&logstash.LogstashFormatter{})
		case "text":
			logrus.SetFormatter(&prettyf.TextFormatter{})
		}
	},
}

RootCmd represents the base command when called without any subcommands

View Source
var VERSION string

VERSION for build

Functions

func Execute

func Execute(version string)

Execute adds all child commands to the root command and sets flags appropriately.

func IsIpv4

func IsIpv4(ipAddress string) bool

Types

type PlainFmt

type PlainFmt struct {
}

func (*PlainFmt) Format

func (f *PlainFmt) Format(entry *logrus.Entry) ([]byte, error)

type Response

type Response struct{}

Response placeholder

func (*Response) Format

func (f *Response) Format(entry *logrus.Entry) ([]byte, error)

Format parses the message, returns raw json, no log

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL