Documentation ¶
Index ¶
- Constants
- func NewConfig() (*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 NewSentry(config *viper.Viper) (*raven.Client, error)
- type Job
- type LogrusSentryHook
- type LogrusSlackHook
- type Multiserver
- type Narada
- type SlackAttachment
- type SlackClient
- type SlackError
- type SlackField
- type SlackMessage
- type Workers
- type WorkersOptions
Constants ¶
View Source
const ( Prefix = "narada" Version = "0.0.1" )
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
Types ¶
type LogrusSentryHook ¶
type LogrusSentryHook struct {
// contains filtered or unexported fields
}
func NewLogrusSentryHook ¶
func NewLogrusSentryHook(client *raven.Client) 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 ¶
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)
type Workers ¶
type Workers struct {
// contains filtered or unexported fields
}
func NewWorkers ¶
func NewWorkers(opts WorkersOptions) (*Workers, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.