Documentation ¶
Overview ¶
Package cmdutil contains utility methods that are useful for command-line programs.
Index ¶
- Constants
- Variables
- func Err(a ...zero.Interface) (n int, err error)
- func Errf(format string, a ...zero.Interface) (n int, err error)
- func Errln(a ...zero.Interface) (n int, err error)
- func Fatal(a ...zero.Interface)
- func Fatalf(format string, a ...zero.Interface)
- func Fatalln(a ...zero.Interface)
- func InitSentry(opts ...SentryOption)
- func LoadEnv(filenames ...string) error
- func MustLoadEnv(filenames ...string)
- func MustNewLogger(opts ...logutil.Option) *logrus.Entry
- func NewLogger(opts ...logutil.Option) (*logrus.Entry, error)
- func NewRaven(opts ...SentryOption) *raven.Client
- func NewSentry(opts ...SentryOption) *sentry.Client
- type SentryConfig
- type SentryOption
Constants ¶
const (
EnvSentryDSN = "SENTRY_DSN"
)
Raven and Sentry-related environment variables.
Variables ¶
var FatalExitCode = 1
FatalExitCode is the exit code that all Fatal* methods exit with after printing.
Functions ¶
func Err ¶
Err is like fmt.Print, but writes to standard error.
func Errf ¶
Errf is like fmt.Printf, but writes to standard error.
func Errln ¶
Errln is like fmt.Println, but writes to standard error.
func Fatal ¶
Fatal is like Err, but exits with an error code after printing.
func Fatalf ¶
Fatalf is like Errf, but exits with an error code after printing.
func Fatalln ¶
Fatalln is like Errln, but exits with an error code after printing.
func InitSentry ¶ added in v0.4.3
func InitSentry(opts ...SentryOption)
InitSentry initializes the current sentry.Hub.
func LoadEnv ¶ added in v0.6.2
LoadEnv forwards a definition.
func MustLoadEnv ¶ added in v0.6.2
func MustLoadEnv(filenames ...string)
MustLoadEnv is like LoadEnv, but panics upon error.
func MustNewLogger ¶ added in v0.6.2
MustNewLogger is like NewLogger, but panics upon error.
func NewLogger ¶ added in v0.4.1
NewLogger forwards a definition.
func NewRaven ¶ added in v0.4.1
func NewRaven(opts ...SentryOption) *raven.Client
NewRaven creates a new raven.Client.
func NewSentry ¶ added in v0.4.2
func NewSentry(opts ...SentryOption) *sentry.Client
NewSentry creates a new sentry.Client.
Types ¶
type SentryConfig ¶ added in v0.4.3
type SentryConfig struct {
Release string
}
SentryConfig configures a raven.Client.
type SentryOption ¶ added in v0.4.2
type SentryOption func(*SentryConfig)
A SentryOption modifies a RavenConfig.
func WithRelease ¶ added in v0.4.5
func WithRelease(release string) SentryOption
WithRelease sets the release tag for a sentry.Client.