bug

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertLevelFromString

func ConvertLevelFromString(s string) int

ConvertLevelFromString nolint: gocyclo

func GenerateHash

func GenerateHash(data string) string

func GenerateIdentifier

func GenerateIdentifier() (string, error)

func GetLevelCrash

func GetLevelCrash() int

func GetLevelError

func GetLevelError() int

func GetLevelInfo

func GetLevelInfo() int

func GetLevelLog

func GetLevelLog() int

func GetLevelUnknown

func GetLevelUnknown() int

Types

type Bug

type Bug struct {
	agent.Agent

	File          string `json:"file"`
	Line          string `json:"line"`
	LineNumber    int    `json:"line_number"`
	FileLineHash  string `json:"file_line_hash"`
	Bug           string `json:"bug"`
	Raw           string `json:"raw"`
	BugLine       string `json:"bug_line"`
	Level         string `json:"level"`
	LevelNumber   int    `json:"level_number"`
	Hash          string `json:"hash"`
	Identifier    string `json:"identifier"`
	TimesReported int    `json:"times_reported"`

	RemoteLink   string `json:"-"`
	TicketSystem string `json:"-"`

	FirstReported time.Time
	LastReported  time.Time
}

func (*Bug) GenerateHash

func (b *Bug) GenerateHash() error

func (*Bug) GenerateIdentifier

func (b *Bug) GenerateIdentifier() error

func (*Bug) ReportedTimes

func (b *Bug) ReportedTimes(c config.Config) error

type BugRecord

type BugRecord struct {
	ID                  string      `json:"id"`
	AgentID             string      `json:"agent_id"`
	Level               string      `json:"level"`
	FileLineHash        string      `json:"file_line_hash"`
	Hash                string      `json:"hash"`
	Full                interface{} `json:"full"`
	TimesReported       string      `json:"times_reported"`
	TimesReportedNumber int         `json:"times_reported_number" dynamodbav:"-"`
	LastReportedTime    time.Time   `json:"last_reported_time" dynamodbav:"-"`
	LastReported        string      `json:"last_reported"`
	FirstReportedTime   time.Time   `json:"first_reported_time" dynamodbav:"-"`
	FirstReported       string      `json:"first_reported"`
}

type BugStorage

type BugStorage struct {
	Config config.Config
}

func NewBugStorage

func NewBugStorage(c config.Config) *BugStorage

func (BugStorage) Find

func (b BugStorage) Find(data BugRecord) ([]BugRecord, error)

func (BugStorage) FindAndStore

func (b BugStorage) FindAndStore(data BugRecord) (BugRecord, error)

func (BugStorage) Insert

func (b BugStorage) Insert(data BugRecord) error

func (BugStorage) Store

func (b BugStorage) Store(data BugRecord) error

func (BugStorage) Update

func (b BugStorage) Update(data BugRecord) error

type Log

type Log struct {
	agent.Agent

	Line        string `json:"line"`
	Level       string `json:"level"`
	LevelNumber int    `json:"level_number"`
	File        string `json:"file"`
	Log         string `json:"log"`
	Identifier  string `json:"identifier"`
	Stack       []byte `json:"stack"`
	LogFmt      string `json:"log_fmt"`
}

func (*Log) GenerateIdentifier

func (l *Log) GenerateIdentifier() error

type Process

type Process interface {
	Parse(request events.APIGatewayProxyRequest) (Response, error)
	Report() (Response, error)
	Fetch() (Response, error)
}

type ProcessBug

type ProcessBug struct {
	Config config.Config

	CommsChannel string
}

func NewBug

func NewBug(c config.Config) ProcessBug

func (ProcessBug) BugHandler

func (p ProcessBug) BugHandler(w http.ResponseWriter, r *http.Request)

func (ProcessBug) Fetch

func (p ProcessBug) Fetch() (Response, error)

func (ProcessBug) GenerateBugInfo

func (p ProcessBug) GenerateBugInfo(bug *Bug, agentID string) error

func (ProcessBug) GenerateComms

func (p ProcessBug) GenerateComms(bug *Bug) error

func (ProcessBug) GenerateTicket

func (p ProcessBug) GenerateTicket(bug *Bug) error

func (ProcessBug) Parse

func (ProcessBug) Report

func (p ProcessBug) Report() (Response, error)

type ProcessLog

type ProcessLog struct {
	Config config.Config
}

func NewLog

func NewLog(c config.Config) ProcessLog

func (ProcessLog) GenerateLogInfo

func (l ProcessLog) GenerateLogInfo(log *Log, agentID string) error

func (ProcessLog) LogHandler

func (l ProcessLog) LogHandler(w http.ResponseWriter, r *http.Request)

func (ProcessLog) StoreLog

func (l ProcessLog) StoreLog(log *Log) error

type Response

type Response struct {
	Body    string
	Headers map[string]string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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