notice

package
v0.0.0-...-d2311c1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackTrace

type BackTrace struct {
	File   string `json:"file"`
	Line   int    `json:"line"`
	Column int    `json:"column"`
	Func   string `json:"function"`
}

BackTrace stackTrace

type Context

type Context struct {
	// エラーになったURL等
	URL string `json:"url"`

	// TODO: 未使用?
	SourceMapEnabled bool `json:"sourceMapEnabled"`

	// Where
	// Controllerなどを指定
	Component string `json:"component"`
	// Controllerのメソッド等を指定(Handler)
	Action string `json:"action"`

	// AppServerの情報
	Language string `json:"language"`
	Version  string `json:"version"`

	// User情報
	User

	RootDirectory string `json:"rootDirectory"`
}

Context context

type ErrorReport

type ErrorReport struct {
	ErrorType string      `json:"type"`
	Message   string      `json:"message"`
	Backtrace []BackTrace `json:"backtrace"`
}

ErrorReport エラー情報

type Notice

type Notice struct {
	Notifier Notifier      `json:"notifier"`
	Context  Context       `json:"context"`
	Errors   []ErrorReport `json:"errors"`

	// optional
	Env     map[string]interface{} `json:"environment"`
	Params  map[string]interface{} `json:"params"`
	Session map[string]interface{} `json:"session"`
}

Notice error内容

func NewNotice

func NewNotice(notifier Notifier, err interface{}, stack []BackTrace) *Notice

NewNotice エラー通知を作成

func (*Notice) SetEnvRuntime

func (n *Notice) SetEnvRuntime()

SetEnvRuntime setup context and env default runtime.

func (*Notice) SetHTTPRequest

func (n *Notice) SetHTTPRequest(req *http.Request)

SetHTTPRequest http.Requestの内容を通知内容に設定します

func (*Notice) SetProfiles

func (n *Notice) SetProfiles()

func (*Notice) SetRuntime

func (n *Notice) SetRuntime()

SetRuntime setup context default runtime.

func (*Notice) SetUserInfo

func (n *Notice) SetUserInfo(user User)

SetUserInfo setup context.user

func (*Notice) SetWhere

func (n *Notice) SetWhere(packageName string, methodName string)

SetWhere setup context.where

type Notifier

type Notifier struct {
	Name    string `json:"name"`
	Version string `json:"version"`
	URL     string `json:"url"`
}

Notifier error送信者

type User

type User struct {
	UserID       int64  `json:"userId"`
	UserName     string `json:"userName"`
	UserUsername string `json:"userUsername"`
	UserEmail    string `json:"userEmail"`
	UserAgent    string `json:"userAgent"`
}

Jump to

Keyboard shortcuts

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