raven

package
v0.0.0-...-dabce62 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2013 License: MIT Imports: 14 Imported by: 1

Documentation

Overview

Package raven is priveds a client and library for sending messages and exceptions to Sentry: http://getsentry.com

Usage:

Create a new client using the NewClient() function. The value for the DSN parameter can be obtained from the project page in the Sentry web interface. After the client has been created use the CaptureMessage method to send messages to the server.

client, err := raven.NewClient(dsn)
...
id, err := self.CaptureMessage("some text")

Index

Constants

View Source
const (
	UDP_TEMPLATE = "%s\n\n%s"
)

Variables

This section is empty.

Functions

func AuthHeader

func AuthHeader(timestamp time.Time, publicKey string) string

Compute the Sentry authentication header

Types

type Client

type Client struct {
	URL       *url.URL
	PublicKey string
	SecretKey string
	Project   string
	Logger    string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(dsn string, logger string) (self *Client, err error)

NewClient creates a new client for a server identified by the given dsn A dsn is a string in the form:

{PROTOCOL}://{PUBLIC_KEY}:{SECRET_KEY}@{HOST}/{PATH}{PROJECT_ID}

eg:

http://abcd:efgh@sentry.example.com/sentry/project1

func (*Client) Debug

func (self *Client) Debug(message ...string) (err error)

Sends a message to the sentry server with level "debug"

func (*Client) Error

func (self *Client) Error(message ...string) (err error)

Sends a message to the sentry server with level "error"

func (*Client) Fatal

func (self *Client) Fatal(message ...string) (err error)

Sends a message to the sentry server with level "fatal"

func (*Client) Info

func (self *Client) Info(message ...string) (err error)

Sends a message to the sentry server with level "info"

func (*Client) Warning

func (self *Client) Warning(message ...string) (err error)

Sends a message to the sentry server with level "warning"

type HttpClient

type HttpClient interface {
	Do(req *http.Request) (resp *http.Response, err error)
}

type HttpSentryTransport

type HttpSentryTransport struct {
	PublicKey string
	URL       *url.URL
	Project   string
	Client    HttpClient
}

func (*HttpSentryTransport) Send

func (self *HttpSentryTransport) Send(packet []byte, timestamp time.Time) (response string, err error)

type MockHttpClient

type MockHttpClient struct {
	// contains filtered or unexported fields
}

Mock of HttpClient interface

func NewMockHttpClient

func NewMockHttpClient(ctrl *gomock.Controller) *MockHttpClient

func (*MockHttpClient) Do

func (_m *MockHttpClient) Do(req *http.Request) (*http.Response, error)

func (*MockHttpClient) EXPECT

func (_m *MockHttpClient) EXPECT() *_MockHttpClientRecorder

type MockSentryTransport

type MockSentryTransport struct {
	// contains filtered or unexported fields
}

Mock of SentryTransport interface

func NewMockSentryTransport

func NewMockSentryTransport(ctrl *gomock.Controller) *MockSentryTransport

func (*MockSentryTransport) EXPECT

func (_m *MockSentryTransport) EXPECT() *_MockSentryTransportRecorder

func (*MockSentryTransport) Send

func (_m *MockSentryTransport) Send(packet []byte, timestamp time.Time) (string, error)

type SentryTransport

type SentryTransport interface {
	Send(packet []byte, timestamp time.Time) (response string, err error)
}

type UdpSentryTransport

type UdpSentryTransport struct {
	PublicKey string
	URL       *url.URL
	Client    net.Conn
}

func (*UdpSentryTransport) Send

func (self *UdpSentryTransport) Send(packet []byte, timestamp time.Time) (response string, err error)

Jump to

Keyboard shortcuts

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