models

package
v0.0.0-...-de44970 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GroupStatusUnresolved         = 0
	GroupStatusResolved           = 1
	GroupStatusIgnored            = 2
	GroupStatusPendingDeletion    = 3
	GroupStatusDeletionInProgress = 4
	GroupStatusPendingMerge       = 5
	// GroupStatusMuted status will be removed in Sentry 9.0
	GroupStatusMuted = GroupStatusIgnored
)
View Source
const (
	OrganizationStatusVisible           = 0
	OrganizationStatusPendingDeletion   = 1
	OrganiztionStatusDeletionInProgress = 2
)
View Source
const (
	ProjectStatusVisible            = 0
	ProjectStatusHidden             = 1
	ProjectStatusPendingDeletion    = 2
	ProjectStatusDeletionInProgress = 3
)
View Source
const (
	TagKeyStatusVisible            = 0
	TagKeyStatusPendingDeletion    = 1
	TagKeyStatusDeletionInProgress = 2
)
View Source
const (
	TeamStatusVisible            = 0
	TeamStatusPendingDeletion    = 1
	TeamStatusDeletionInProgress = 2
)

Variables

This section is empty.

Functions

func DecodeRecord

func DecodeRecord(record map[string]interface{}, target interface{}) error

func DecodeRequest

func DecodeRequest(request map[string]interface{}, target interface{}) error

func LooksLikeShortID

func LooksLikeShortID(value string) bool

func PickleNoneDecodeHook

func PickleNoneDecodeHook(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error)

TODO Hook works but looks like we have to traverse maps and slices

func StringMapDecodeHook

func StringMapDecodeHook(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error)

func TagsDecodeHook

func TagsDecodeHook(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error)

func TimeDecodeHook

func TimeDecodeHook(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error)

Types

type Environment

type Environment struct {
	ID          int       `db:"id" json:"id,string"`
	ProjectID   int       `db:"project_id" json:"-"`
	Name        string    `db:"name" json:"name"`
	DateCreated time.Time `db:"date_added" json:"-"`
}

Environment ...

type Event

type Event struct {
	ID        int     `db:"id" json:"id,string"`
	GroupID   *int    `db:"group_id" json:"groupID,string"`
	EventID   *string `db:"message_id" json:"eventID"`
	ProjectID *int    `db:"project_id" json:"-"`
	Message   string  `db:"message" json:"-"`
	Platform  *string `db:"platform" json:"platform"`
	TimeSpent *int    `db:"time_spent" json:"-"`
	// NOTE data has NodeField type
	DetailsRefRaw *string  `db:"data" json:"-"`
	DetailsRef    *NodeRef `db:"-" json:"-"`
	// TODO check that `dateCreated` is the name for JSON
	DateCreated time.Time `db:"datetime" json:"dateCreated"`
}

Event represents an individual event.

type EventDetails

type EventDetails struct {
	Ref         int           `kv:"_ref"         in:"-"           json:"-"`
	RefVersion  int           `kv:"_ref_version" in:"-"           json:"-"`
	Server      string        `kv:"server_name"  in:"server_name" json:"-"`
	Logger      string        `kv:"logger"       in:"logger"      json:"-"`
	Level       string        `kv:"level"        in:"level"       json:"-"`
	Culprit     string        `kv:"culprit"      in:"culprit"     json:"-"`
	Platform    string        `kv:"platform"     in:"platform"    json:"-"`
	Release     *string       `kv:"release"      in:"release"     json:"release"`
	Tags        []TagKeyValue `kv:"tags"         in:"tags"        json:"tags"`
	Environment string        `kv:"environment"  in:"environment" json:"-"`
	Fingerprint []string      `kv:"fingerprint"  in:"fingerprint" json:"-"`

	Modules map[string]string      `kv:"modules" in:"modules" json:"packages"`
	Extra   map[string]interface{} `kv:"extra"   in:"extra"   json:"context"`

	// TODO those fields was not mentioned at https://docs.sentry.io/clientdev/attributes/
	Version      string            `kv:"version"  in:"-" json:"-"`
	Type         string            `kv:"type"            json:"type"`
	Size         int               `kv:"-"               json:"size"`
	Errors       []EventError      `kv:"errors"   in:"-" json:"errors"`
	ReceivedTime time.Time         `kv:"received" in:"-" json:"dateReceived"`
	Metadata     map[string]string `kv:"metadata" in:"-" json:"metadata"`
	UserReport   *string           `kv:"-"               json:"userReport"`
}

func (*EventDetails) DecodeRecord

func (event *EventDetails) DecodeRecord(record map[string]interface{}) error

type EventError

type EventError struct {
	Type  EventErrorType
	Name  string
	Value interface{}
}

type EventErrorType

type EventErrorType string
const (
	EventErrorInvalidData       EventErrorType = "invalid_data"
	EventErrorInvalidAttribute  EventErrorType = "invalid_attribute"
	EventErrorValueTooLong      EventErrorType = "value_too_long"
	EventErrorUnknownError      EventErrorType = "unknown_error"
	EventErrorSecurityViolation EventErrorType = "security_violation"
	EventErrorRestrictedIP      EventErrorType = "restricted_ip"

	EventErrorJSGenericFetchError        EventErrorType = "js_generic_fetch_error"
	EventErrorJSInvalidHTTPCode          EventErrorType = "js_invalid_http_code"
	EventErrorJSInvalidContent           EventErrorType = "js_invalid_content"
	EventErrorJSNoColumn                 EventErrorType = "js_no_column"
	EventErrorJSMissingSource            EventErrorType = "js_no_source"
	EventErrorJSInvalidSourceMap         EventErrorType = "js_invalid_source"
	EventErrorJSTooManyRemoteSources     EventErrorType = "js_too_many_sources"
	EventErrorJSInvalidSourceEncoding    EventErrorType = "js_invalid_source_encoding"
	EventErrorJSInvalidSourceMapLocation EventErrorType = "js_invalid_sourcemap_location"
	EventErrorJSTooLarge                 EventErrorType = "js_too_large"
	EventErrorJSFetchTimeout             EventErrorType = "js_fetch_timeout"

	EventErrorNativeNoCrashedThread EventErrorType = "native_no_crashed_thread"
	EventErrorNativeInternalFailure EventErrorType = "native_internal_failure"
	EventErrorNativeNoSymsynd       EventErrorType = "native_no_symsynd"
)

type EventMapping

type EventMapping struct {
	ID          int       `db:"id" json:"id,string"`
	ProjectID   int       `db:"project_id" json:"-"`
	GroupID     int       `db:"group_id" json:"-"`
	EventID     string    `db:"event_id" json:"-"`
	DateCreated time.Time `db:"date_added" json:"-"`
}

EventMapping ...

type Group

type Group struct {
	ID        int       `db:"id" json:"id,string"`
	Logger    string    `db:"logger" json:"-"`
	Level     int       `db:"level" json:"-"`
	Message   string    `db:"message" json:"title"`
	Culprit   *string   `db:"view" json:"culprit"`
	Status    int       `db:"status" json:"-"`
	TimesSeen int       `db:"times_seen" json:"-"`
	LastSeen  time.Time `db:"last_seen" json:"lastSeen"`
	FirstSeen time.Time `db:"first_seen" json:"firstSeen"`
	// Data is a GzippedDictField
	Data           *string    `db:"data" json:"-"`
	Score          int        `db:"score" json:"-"`
	ProjectID      *int       `db:"project_id" json:"-"`
	TimeSpentTotal int        `db:"time_spent_total" json:"-"`
	TimeSpentCount int        `db:"time_spent_count" json:"-"`
	ResolvedAt     *time.Time `db:"resolved_at" json:"-"`
	ActiveAt       *time.Time `db:"active_at" json:"-"`
	IsPublic       *bool      `db:"is_public" json:"isPublic"`
	Platform       *string    `db:"platform" json:"-"`
	NumComments    *int       `db:"num_comments" json:"numComments"`
	FirstReleaseID *int       `db:"first_release_id" json:"-"`
	ShortID        *int       `db:"short_id" json:"-"`
}

Group is an aggregated message which summarizes a set of Events.

type Identifier

type Identifier interface {
	KeyAlias() string
	KeyCanonical() string
}

type NodeBlob

type NodeBlob struct {
	ID          string    `db:"id"`
	Data        string    `db:"data"`
	DateCreated time.Time `db:"timestamp"`
}

type NodeRef

type NodeRef struct {
	NodeID string `kv:"node_id"`
}

type Organization

type Organization struct {
	ID          int       `db:"id" json:"id,string"`
	Name        string    `db:"name" json:"name"`
	Slug        string    `db:"slug" json:"slug"`
	Status      int       `db:"status" json:"-"`
	Flags       int       `db:"flags" json:"-"`
	DefaultRole string    `db:"default_role" json:"-"`
	DateCreated time.Time `db:"date_added" json:"dateCreated"`
}

Organization represents a group of individuals which maintain ownership of projects.

type OrganizationMember

type OrganizationMember struct {
	ID              int       `db:"id" json:"id,string"`
	OrganizationID  int       `db:"organization_id" json:"organizationId"`
	UserID          int       `db:"user_id" json:"userId"`
	Type            int       `db:"type" json:"type"`
	DateCreated     time.Time `db:"date_added" json:"dateCreated"`
	Email           *string   `db:"email" json:"email"`
	HasGlobalAccess bool      `db:"has_global_access" json:"hasGlobalAccess"`
	Flags           int64     `db:"flags" json:"flags"`
	Counter         int       `db:"counter" json:"counter"`
	Role            string    `db:"role" json:"role"`
	Token           *string   `db:"token" json:"token"`
}

OrganizationMember identifies relationships between teams and users. Users listed as team members are considered to have access to all projects and could be thought of as team owners (though their access level may not) be set to ownership.

type OrganizationMemberTeam

type OrganizationMemberTeam struct {
	ID                   int  `db:"id" json:"id,string"`
	OrganizationMemberID int  `db:"organizationmember_id" json:"organizationmemberId"`
	TeamID               int  `db:"team_id" json:"teamId"`
	IsActive             bool `db:"is_active" json:"isActive"`
}

type Project

type Project struct {
	ID             int       `db:"id" json:"id,string"`
	TeamID         int       `db:"team_id" json:"-"`
	OrganizationID int       `db:"organization_id" json:"-"`
	Name           string    `db:"name" json:"name"`
	Slug           string    `db:"slug" json:"slug"`
	Public         bool      `db:"public" json:"isPublic"`
	Status         int       `db:"status" json:"-"`
	FirstEvent     time.Time `db:"first_event" json:"firstEvent"`
	DateCreated    time.Time `db:"date_added" json:"dateCreated"`
}

Project is a permission based namespace which generally is the top level entry point for all data.

type RecordDecoder

type RecordDecoder interface {
	DecodeRecord(map[string]interface{}) error
}

type RequestDecoder

type RequestDecoder interface {
	DecodeRequest(map[string]interface{}) error
}

type SavedSearch

type SavedSearch struct {
	ID          int       `db:"id" json:"id,string"`
	ProjectID   int       `db:"project_id" json:"-"`
	Name        string    `db:"name" json:"name"`
	Query       string    `db:"query" json:"query"`
	DateCreated time.Time `db:"date_added" json:"dateCreated"`
	IsDefault   bool      `db:"is_default" json:"isDefault"`
}

SavedSearch is a model for saved search query.

type TagKey

type TagKey struct {
	ID           int     `db:"id" json:"id,string"`
	ProjectID    int     `db:"project_id" json:"-"`
	Key          string  `db:"key" json:"key"`
	UniqueValues int     `db:"values_seen" json:"uniqueValues"`
	Name         *string `db:"label" json:"name"`
	Status       int     `db:"status" json:"-"`
}

TagKey stores references to available filters keys.

func (*TagKey) PostGet

func (tag *TagKey) PostGet()

type TagKeyValue

type TagKeyValue struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Team

type Team struct {
	ID             int       `db:"id" json:"id,string"`
	Slug           string    `db:"slug" json:"slug"`
	Name           string    `db:"name" json:"name"`
	OrganizationID int       `db:"organization_id" json:"-"`
	Status         int       `db:"status" json:"-"`
	DateCreated    time.Time `db:"date_added" json:"dateCreated"`
}

Team represents a group of individuals which maintain ownership of projects.

type User

type User struct {
	ID       int    `db:"id" json:"id,string"`
	Username string `db:"username" json:"username"`
	// This column is called first_name for legacy reasons, but it is the entire
	// display name
	Name               string    `db:"first_name" json:"name"`
	Email              string    `db:"email" json:"email"`
	IsStaff            bool      `db:"is_staff" json:"-"`
	IsActive           bool      `db:"is_active" json:"-"`
	IsSuperuser        bool      `db:"is_superuser" json:"-"`
	IsManaged          bool      `db:"is_managed" json:"-"`
	IsPasswordExpired  bool      `db:"is_password_expired" json:"-"`
	LastPasswordChange time.Time `db:"last_password_change" json:"-"`
	Password           string    `db:"password" json:"-"`
	LastLogin          time.Time `db:"last_login" json:"-"`
	DateCreated        time.Time `db:"date_joined" json:"-"`
}

func (*User) PostGet

func (user *User) PostGet()

Jump to

Keyboard shortcuts

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