Documentation
¶
Index ¶
- func NewConfig(prefix string) (*viper.Viper, error)
- func NewLogger(config *viper.Viper) (*logrus.Logger, error)
- func NewMetricsInvoke(ms *Multiserver) error
- func NewNopLogger() *logrus.Logger
- func NewProfilerInvoke(ms *Multiserver) error
- func NewSentryInvoke(config *viper.Viper, lc fx.Lifecycle) error
- func WithHealthcheck(path string) serverOption
- type Healthchecker
- type LogrusSentryHook
- type LogrusSlackHook
- type Multiserver
- type Narada
- type Options
- type SlackAttachment
- type SlackClient
- type SlackError
- type SlackField
- type SlackMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConfig ¶
NewConfig creates a new configuration, by default config file will be `config.yml` in same directory you run application if you want to override it you should provide `NARADA_CONFIG` environment variable.
func NewMetricsInvoke ¶
func NewMetricsInvoke(ms *Multiserver) error
func NewNopLogger ¶
func NewProfilerInvoke ¶
func NewProfilerInvoke(ms *Multiserver) error
func NewSentryInvoke ¶ added in v0.1.2
func WithHealthcheck ¶ added in v1.1.0
func WithHealthcheck(path string) serverOption
Types ¶
type Healthchecker ¶ added in v1.1.0
type Healthchecker func() error
type LogrusSentryHook ¶
type LogrusSentryHook struct { }
func NewLogrusSentryHook ¶
func NewLogrusSentryHook() LogrusSentryHook
func (LogrusSentryHook) Levels ¶
func (h LogrusSentryHook) Levels() []logrus.Level
type LogrusSlackHook ¶
type LogrusSlackHook struct {
// contains filtered or unexported fields
}
func NewLogrusSlackHook ¶
func NewLogrusSlackHook(config *viper.Viper) LogrusSlackHook
func (LogrusSlackHook) Levels ¶
func (h LogrusSlackHook) Levels() []logrus.Level
type Multiserver ¶
type Multiserver struct {
// contains filtered or unexported fields
}
func NewMultiServers ¶
func (*Multiserver) Add ¶
func (ms *Multiserver) Add(name string, handler http.Handler, opts ...serverOption) error
func (*Multiserver) AddHealthcheck ¶ added in v1.1.0
func (ms *Multiserver) AddHealthcheck(name, path string, check Healthchecker) error
type Narada ¶
type Narada struct {
// contains filtered or unexported fields
}
func (Narada) HandleError ¶
type SlackAttachment ¶
type SlackAttachment struct { Title string `json:"title"` Fallback string `json:"fallback"` Text string `json:"text"` Pretext string `json:"pretext"` Color string `json:"color"` Fields []*SlackField `json:"fields"` }
func NewAttachment ¶
func NewAttachment() *SlackAttachment
func (*SlackAttachment) AddField ¶
func (a *SlackAttachment) AddField(f *SlackField)
type SlackClient ¶
type SlackClient struct { Url string // contains filtered or unexported fields }
func NewClient ¶
func NewClient(url string) *SlackClient
func (*SlackClient) SendMessage ¶
func (c *SlackClient) SendMessage(msg *SlackMessage) error
type SlackError ¶
func (*SlackError) Error ¶
func (e *SlackError) Error() string
type SlackField ¶
type SlackField struct { Title string `json:"title"` Value string `json:"value"` Short bool `json:"short"` }
func NewField ¶
func NewField() *SlackField
type SlackMessage ¶
type SlackMessage struct { Text string `json:"text"` Username string `json:"username"` IconUrl string `json:"icon_url"` IconEmoji string `json:"icon_emoji"` Channel string `json:"channel"` UnfurlLinks bool `json:"unfurl_links"` Attachments []*SlackAttachment `json:"attachments"` }
func (*SlackMessage) AddAttachment ¶
func (m *SlackMessage) AddAttachment(a *SlackAttachment)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.