Documentation
¶
Index ¶
- func SetupSchemas(pool *pgxpool.Pool)
- type LocalState
- func (s *LocalState) AddJob(job queue.AnalyzeJob)
- func (s *LocalState) GetJobInfo(js common.JobSpec) (common.JobInfo, error)
- func (s *LocalState) GetJobList(sessionID int) ([]queue.AnalyzeJob, error)
- func (s *LocalState) GetJobSpecByRepoId(sessionId, jobRepoId int) (common.JobSpec, error)
- func (s *LocalState) GetResult(js common.JobSpec) (queue.AnalyzeResult, error)
- func (s *LocalState) GetSessionStatus(sessionID int) (common.StatusSummary, error)
- func (s *LocalState) GetStatus(js common.JobSpec) (common.Status, error)
- func (s *LocalState) NextID() int
- func (s *LocalState) SetJobInfo(js common.JobSpec, ji common.JobInfo)
- func (s *LocalState) SetResult(js common.JobSpec, analyzeResult queue.AnalyzeResult)
- func (s *LocalState) SetStatus(js common.JobSpec, status common.Status)
- type PGState
- func (s *PGState) AddJob(job queue.AnalyzeJob)
- func (s *PGState) GetJobInfo(js common.JobSpec) (common.JobInfo, error)
- func (s *PGState) GetJobList(sessionId int) ([]queue.AnalyzeJob, error)
- func (s *PGState) GetJobSpecByRepoId(sessionId, jobRepoId int) (common.JobSpec, error)
- func (s *PGState) GetRepoId(cno common.NameWithOwner) int
- func (s *PGState) GetResult(js common.JobSpec) (queue.AnalyzeResult, error)
- func (s *PGState) GetSessionStatus(sessionID int) (common.StatusSummary, error)
- func (s *PGState) GetStatus(js common.JobSpec) (common.Status, error)
- func (s *PGState) NextID() int
- func (s *PGState) SetJobInfo(js common.JobSpec, ji common.JobInfo)
- func (s *PGState) SetResult(js common.JobSpec, ar queue.AnalyzeResult)
- func (s *PGState) SetStatus(js common.JobSpec, status common.Status)
- type ServerState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupSchemas ¶ added in v0.4.5
Types ¶
type LocalState ¶
type LocalState struct {
// contains filtered or unexported fields
}
func NewLocalState ¶
func NewLocalState(startingID int) *LocalState
func (*LocalState) AddJob ¶
func (s *LocalState) AddJob(job queue.AnalyzeJob)
func (*LocalState) GetJobInfo ¶
func (*LocalState) GetJobList ¶
func (s *LocalState) GetJobList(sessionID int) ([]queue.AnalyzeJob, error)
func (*LocalState) GetJobSpecByRepoId ¶
func (s *LocalState) GetJobSpecByRepoId(sessionId, jobRepoId int) (common.JobSpec, error)
func (*LocalState) GetResult ¶
func (s *LocalState) GetResult(js common.JobSpec) (queue.AnalyzeResult, error)
func (*LocalState) GetSessionStatus ¶ added in v0.4.6
func (s *LocalState) GetSessionStatus(sessionID int) (common.StatusSummary, error)
func (*LocalState) NextID ¶
func (s *LocalState) NextID() int
func (*LocalState) SetJobInfo ¶
func (s *LocalState) SetJobInfo(js common.JobSpec, ji common.JobInfo)
func (*LocalState) SetResult ¶
func (s *LocalState) SetResult(js common.JobSpec, analyzeResult queue.AnalyzeResult)
type PGState ¶ added in v0.4.5
type PGState struct {
// contains filtered or unexported fields
}
----- PGState holds the shared connection pool
func NewPGState ¶ added in v0.4.5
func NewPGState() *PGState
func (*PGState) AddJob ¶ added in v0.4.5
func (s *PGState) AddJob(job queue.AnalyzeJob)
func (*PGState) GetJobInfo ¶ added in v0.4.5
func (*PGState) GetJobList ¶ added in v0.4.5
func (s *PGState) GetJobList(sessionId int) ([]queue.AnalyzeJob, error)
func (*PGState) GetJobSpecByRepoId ¶ added in v0.4.5
func (*PGState) GetRepoId ¶ added in v0.4.5
func (s *PGState) GetRepoId(cno common.NameWithOwner) int
GetRepoId returns a stable unique ID for a given (owner, repo). If the pair doesn't exist, it is inserted atomically.
func (*PGState) GetSessionStatus ¶ added in v0.4.5
func (s *PGState) GetSessionStatus(sessionID int) (common.StatusSummary, error)
func (*PGState) SetJobInfo ¶ added in v0.4.5
type ServerState ¶
type ServerState interface {
// NextID increments and returns the next unique ID for a session.
NextID() int
// GetResult retrieves the analysis result for the specified job.
GetResult(js common.JobSpec) (queue.AnalyzeResult, error)
// GetJobSpecByRepoId retrieves the JobSpec for the specified job Repo ID.
// TODO: fix this hacky logic
GetJobSpecByRepoId(sessionId int, jobRepoId int) (common.JobSpec, error)
// The repo id is uniquely determined by NameWithOwner
GetRepoId(owner common.NameWithOwner) int
// SetResult stores the analysis result for the specified session ID and repository.
SetResult(js common.JobSpec, ar queue.AnalyzeResult)
// GetJobList retrieves the list of analysis jobs for the specified session ID.
GetJobList(sessionId int) ([]queue.AnalyzeJob, error)
// GetJobInfo retrieves the job information for the specified job specification.
GetJobInfo(js common.JobSpec) (common.JobInfo, error)
// SetJobInfo stores the job information for the specified job specification.
SetJobInfo(js common.JobSpec, ji common.JobInfo)
// GetStatus retrieves the status of a job for the specified session ID and repository.
GetStatus(js common.JobSpec) (common.Status, error)
// GetSessionStatus retrieves the aggregated status summary for all jobs in a session.
GetSessionStatus(sessionID int) (common.StatusSummary, error)
// SetStatus stores the status of a job for the specified session ID and repository.
SetStatus(js common.JobSpec, status common.Status)
// AddJob adds an analysis job to the list of jobs for the specified session ID.
AddJob(job queue.AnalyzeJob)
}
StorageInterface defines the methods required for managing storage operations related to server state, e.g. job status, results, and artifacts.
Click to show internal directories.
Click to hide internal directories.