store

package
v0.0.0-...-f6774a9 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const GITHUB_ERROR_CONTEXT_LINES = 5
View Source
const LIMIT = 10

Number of results per page

View Source
const MAX_ERROR_KILLSWITCH = 5
View Source
const MAX_ISSUE_TITLE_LENGTH = 200
View Source
const SERVICE_LIMIT = 10

Number of results per page

Variables

This section is empty.

Functions

func AssertRecordFound

func AssertRecordFound(result *gorm.DB) error

func CacheServiceKey

func CacheServiceKey(name string, projectID int) string

Types

type ListErrorObjectsParams

type ListErrorObjectsParams struct {
	After  *string
	Before *string
	Query  string
}

type ListServicesParams

type ListServicesParams struct {
	After  *string
	Before *string
	Query  *string
}

type Store

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

func NewStore

func NewStore(db *gorm.DB, redis *redis.Client, integrationsClient *integrations.Client, storageClient storage.Client, dataSyncQueue kafka_queue.MessageQueue, clickhouseClient *clickhouse.Client) *Store

func (*Store) BuildIssueTitleAndDescription

func (store *Store) BuildIssueTitleAndDescription(title string, description *string) (string, string)

func (*Store) CreateErrorGroupActivityLog

func (store *Store) CreateErrorGroupActivityLog(ctx context.Context,
	params model.ErrorGroupActivityLog) error

func (*Store) DeleteServiceCache

func (store *Store) DeleteServiceCache(ctx context.Context, name string, projectID int) error

func (*Store) EnhanceTrace

func (store *Store) EnhanceTrace(ctx context.Context, trace *privateModel.ErrorTrace, service *model.Service, serviceVersion string, ignoredFiles []string, gitHubClient github.ClientInterface) (*privateModel.ErrorTrace, bool, bool)

returns (1) trace to be use, (2) if the trace was attempted to be enhanced, and (3) if the trace was successfully enhanced

func (*Store) EnhanceTraceWithGitHub

func (store *Store) EnhanceTraceWithGitHub(ctx context.Context, trace *privateModel.ErrorTrace, service *model.Service, serviceVersion string, fileName string, gitHubClient github.ClientInterface) (*privateModel.ErrorTrace, error)

func (*Store) EnhancedStackTrace

func (store *Store) EnhancedStackTrace(ctx context.Context, stackTrace string, workspace *model.Workspace, project *model.Project, errorObj *model.ErrorObject, validateService *model.Service) (*string, []*privateModel.ErrorTrace, error)

should always return error stacktrace, returned error will be logged, return enhanced stacktrace string when successfully enhanced

func (*Store) ExpandedStackTrace

func (store *Store) ExpandedStackTrace(ctx context.Context, lines []string, lineNumber int) (*string, *string, *string, error)

func (*Store) FetchFileFromGitHub

func (store *Store) FetchFileFromGitHub(ctx context.Context, trace *privateModel.ErrorTrace, service *model.Service, fileName string, serviceVersion string, gitHubClient github.ClientInterface) (*string, error)

func (*Store) FindProjectsWithAutoResolveSetting

func (store *Store) FindProjectsWithAutoResolveSetting() ([]*model.ProjectFilterSettings, error)

func (*Store) FindService

func (store *Store) FindService(ctx context.Context, projectID int, name string) (*model.Service, error)

func (*Store) GetAllWorkspaceSettings

func (store *Store) GetAllWorkspaceSettings(ctx context.Context, workspaceID int) (*model.AllWorkspaceSettings, error)

func (*Store) GetAllWorkspaceSettingsByProject

func (store *Store) GetAllWorkspaceSettingsByProject(ctx context.Context, projectID int) (*model.AllWorkspaceSettings, error)

func (*Store) GetErrorGroupActivityLogs

func (store *Store) GetErrorGroupActivityLogs(errorGroupID int) ([]model.ErrorGroupActivityLog, error)

func (*Store) GetOAuth

func (store *Store) GetOAuth(ctx context.Context, id string) (*model.OAuthClientStore, error)

func (*Store) GetProject

func (store *Store) GetProject(ctx context.Context, id int) (*model.Project, error)

func (*Store) GetProjectFilterSettings

func (store *Store) GetProjectFilterSettings(ctx context.Context, projectID int, opts ...redis.Option) (*model.ProjectFilterSettings, error)

func (*Store) GetSession

func (store *Store) GetSession(ctx context.Context, sessionID int) (*model.Session, error)

func (*Store) GetSessionFromSecureID

func (store *Store) GetSessionFromSecureID(ctx context.Context, secureID string) (*model.Session, error)

func (*Store) GetSystemConfiguration

func (store *Store) GetSystemConfiguration(ctx context.Context) (*model.SystemConfiguration, error)

func (*Store) GetWorkspace

func (store *Store) GetWorkspace(ctx context.Context, id int) (*model.Workspace, error)

func (*Store) GetWorkspaceAdminCount

func (store *Store) GetWorkspaceAdminCount(ctx context.Context, id int) (int64, error)

func (*Store) GitHubEnhancedStackTrace

func (store *Store) GitHubEnhancedStackTrace(ctx context.Context, stackTrace []*privateModel.ErrorTrace, workspace *model.Workspace, project *model.Project, errorObj *model.ErrorObject, validateService *model.Service) ([]*privateModel.ErrorTrace, error)

func (*Store) GitHubFilePath

func (store *Store) GitHubFilePath(ctx context.Context, fileName string, buildPrefix *string, gitHubPrefix *string) string

func (*Store) GitHubGitSHA

func (store *Store) GitHubGitSHA(ctx context.Context, gitHubRepoPath string, serviceVersion string, gitHubClient github.ClientInterface) (*string, error)

func (*Store) ListErrorObjects

func (store *Store) ListErrorObjects(errorGroup model.ErrorGroup, params ListErrorObjectsParams) (privateModel.ErrorObjectConnection, error)

func (*Store) ListServices

func (store *Store) ListServices(project model.Project, params ListServicesParams) (privateModel.ServiceConnection, error)

func (*Store) StructuredStackTrace

func (store *Store) StructuredStackTrace(ctx context.Context, stackTrace string) ([]*privateModel.ErrorTrace, error)

func (*Store) UpdateErrorGroupStateByAdmin

func (store *Store) UpdateErrorGroupStateByAdmin(ctx context.Context,
	admin model.Admin, params UpdateErrorGroupParams) (*model.ErrorGroup, error)

func (*Store) UpdateErrorGroupStateBySystem

func (store *Store) UpdateErrorGroupStateBySystem(ctx context.Context,
	params UpdateErrorGroupParams) error

func (*Store) UpdateProjectFilterSettings

func (store *Store) UpdateProjectFilterSettings(ctx context.Context, projectID int, updates UpdateProjectFilterSettingsParams) (*model.ProjectFilterSettings, error)

func (*Store) UpdateServiceErrorState

func (store *Store) UpdateServiceErrorState(ctx context.Context, serviceID int, errorDetails []string) error

func (*Store) UpsertService

func (store *Store) UpsertService(ctx context.Context, project model.Project, name string, attributes map[string]string) (*model.Service, error)

type UpdateErrorGroupParams

type UpdateErrorGroupParams struct {
	ID           int
	State        privateModel.ErrorState
	SnoozedUntil *time.Time
}

type UpdateProjectFilterSettingsParams

type UpdateProjectFilterSettingsParams struct {
	AutoResolveStaleErrorsDayInterval *int
	FilterSessionsWithoutError        *bool
	Sampling                          *modelInputs.SamplingInput
}

Jump to

Keyboard shortcuts

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