Documentation ¶
Index ¶
- func HandleEntError(entErr error, msg string) error
- func HandleValidatorError(err error, msg string) error
- func IsConflictError(err error) bool
- func IsNotFound(err error) bool
- func IsServerError(err error) bool
- func IsValidationError(err error) bool
- func WithClient(client *ent.Client) func(h *handlerConfig)
- func WithContext(ctx context.Context) func(h *handlerConfig)
- func WithOrgName(name string) func(h *handlerConfig)
- func WithStore(s *Store) func(h *handlerConfig)
- func WithTx(ctx context.Context, client *ent.Client, fn func(tx *ent.Tx) error) error
- func WithUserID(userID string) func(h *handlerConfig)
- func WithValidator(validator *validator.Validate) func(h *handlerConfig)
- type AdapterQuery
- type ComponentQuery
- type ConflictError
- type Handler
- func (h *Handler) Client() *ent.Client
- func (h *Handler) CreateProject(req *api.ProjectCreateRequest) (*ent.Project, error)
- func (h *Handler) CreateRelease(req *api.ReleaseCreateRequest) (*ent.Release, error)
- func (h *Handler) EvaluateReleasePolicies(releaseID int) ([]*ent.ReleasePolicyViolation, error)
- func (h *Handler) GetAdapters(query *AdapterQuery) ([]*api.Adapter, error)
- func (h *Handler) GetComponentOrError(client *ent.Client, id int) (*ent.Component, error)
- func (h *Handler) GetComponents(query *ComponentQuery) ([]*api.Component, error)
- func (h *Handler) GetEvents(req *api.EventGetRequest) ([]*ent.Event, error)
- func (h *Handler) GetProjects(query *ProjectQuery) ([]*api.Project, error)
- func (h *Handler) GetReleasePolicies(query *ReleasePolicyQuery) ([]*api.ReleasePolicy, error)
- func (h *Handler) GetReleases(query *ReleaseQuery) ([]*api.Release, error)
- func (h *Handler) GetVulnerabilityOrCreate(client *ent.Client, vuln *api.Vulnerability) (*ent.Vulnerability, error)
- func (h *Handler) GetVulnerabilityReviews(query *VulnerabilityReviewQuery) ([]*api.VulnerabilityReview, error)
- func (h *Handler) LogArtifact(req *api.ArtifactLogRequest) (*ent.Artifact, error)
- func (h *Handler) PopulateStoreWithDummyData() error
- func (h *Handler) PopulateStoreWithPolicies() error
- func (h *Handler) SaveAdapter(req *api.AdapterSaveRequest) (*ent.Adapter, error)
- func (h *Handler) SaveCodeScan(req *api.CodeScanRequest) (*ent.CodeScan, error)
- func (h *Handler) SaveComponentVulnerabilities(req *api.ComponentVulnerabilityRequest) error
- func (h *Handler) SaveEvent(req *api.EventSaveRequest) (*ent.Event, error)
- func (h *Handler) SaveReleasePolicy(req *api.ReleasePolicySaveRequest) (*ent.ReleasePolicy, error)
- func (h *Handler) SaveTestRun(req *api.TestRunRequest) (*ent.TestRun, error)
- func (h *Handler) SaveVulnerabilityReview(req *api.VulnerabilityReviewSaveRequest) (*ent.VulnerabilityReview, error)
- func (h *Handler) UpdateReleasePolicy(req *api.ReleasePolicyUpdateRequest) (*ent.ReleasePolicy, error)
- func (h *Handler) UpdateVulnerabilityReview(req *api.VulnerabilityReviewUpdateRequest) (*ent.VulnerabilityReview, error)
- type NotFoundError
- type ProjectQuery
- type ReleasePolicyQuery
- type ReleaseQuery
- type ServerError
- type Store
- type ValidationError
- type VulnerabilityReviewQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleEntError ¶
func HandleValidatorError ¶
func IsConflictError ¶
IsConflictError returns a boolean indicating whether the error is a conflict error.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsServerError ¶
IsServerError returns a boolean indicating whether the error is a server error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func WithClient ¶
func WithContext ¶
func WithOrgName ¶
func WithOrgName(name string) func(h *handlerConfig)
func WithUserID ¶
func WithUserID(userID string) func(h *handlerConfig)
func WithValidator ¶
func WithValidator(validator *validator.Validate) func(h *handlerConfig)
Types ¶
type AdapterQuery ¶
type AdapterQuery struct {
Where *ent.AdapterWhereInput
}
type ComponentQuery ¶
type ComponentQuery struct {
Where *ent.ComponentWhereInput
}
type ConflictError ¶
ConflictError returns when validating a request fails
func NewConflictError ¶
func NewConflictError(err error, msg string) *ConflictError
func (*ConflictError) Error ¶
func (e *ConflictError) Error() string
Error implements the error interface.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) CreateProject ¶
func (*Handler) CreateRelease ¶
func (*Handler) EvaluateReleasePolicies ¶
func (h *Handler) EvaluateReleasePolicies(releaseID int) ([]*ent.ReleasePolicyViolation, error)
func (*Handler) GetAdapters ¶
func (h *Handler) GetAdapters(query *AdapterQuery) ([]*api.Adapter, error)
func (*Handler) GetComponentOrError ¶
func (*Handler) GetComponents ¶
func (h *Handler) GetComponents(query *ComponentQuery) ([]*api.Component, error)
func (*Handler) GetProjects ¶
func (h *Handler) GetProjects(query *ProjectQuery) ([]*api.Project, error)
func (*Handler) GetReleasePolicies ¶
func (h *Handler) GetReleasePolicies(query *ReleasePolicyQuery) ([]*api.ReleasePolicy, error)
func (*Handler) GetReleases ¶
func (h *Handler) GetReleases(query *ReleaseQuery) ([]*api.Release, error)
func (*Handler) GetVulnerabilityOrCreate ¶
func (h *Handler) GetVulnerabilityOrCreate(client *ent.Client, vuln *api.Vulnerability) (*ent.Vulnerability, error)
func (*Handler) GetVulnerabilityReviews ¶
func (h *Handler) GetVulnerabilityReviews(query *VulnerabilityReviewQuery) ([]*api.VulnerabilityReview, error)
func (*Handler) LogArtifact ¶
func (*Handler) PopulateStoreWithDummyData ¶
func (*Handler) PopulateStoreWithPolicies ¶
func (*Handler) SaveAdapter ¶
func (*Handler) SaveCodeScan ¶
func (*Handler) SaveComponentVulnerabilities ¶
func (h *Handler) SaveComponentVulnerabilities(req *api.ComponentVulnerabilityRequest) error
func (*Handler) SaveReleasePolicy ¶
func (h *Handler) SaveReleasePolicy(req *api.ReleasePolicySaveRequest) (*ent.ReleasePolicy, error)
func (*Handler) SaveTestRun ¶
func (*Handler) SaveVulnerabilityReview ¶
func (h *Handler) SaveVulnerabilityReview(req *api.VulnerabilityReviewSaveRequest) (*ent.VulnerabilityReview, error)
func (*Handler) UpdateReleasePolicy ¶
func (h *Handler) UpdateReleasePolicy(req *api.ReleasePolicyUpdateRequest) (*ent.ReleasePolicy, error)
func (*Handler) UpdateVulnerabilityReview ¶
func (h *Handler) UpdateVulnerabilityReview(req *api.VulnerabilityReviewUpdateRequest) (*ent.VulnerabilityReview, error)
type NotFoundError ¶
type NotFoundError struct { Err error // contains filtered or unexported fields }
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func NewNotFoundError ¶
func NewNotFoundError(err error, msg string, a ...interface{}) *NotFoundError
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type ProjectQuery ¶
type ProjectQuery struct {
Where *ent.ProjectWhereInput
}
type ReleasePolicyQuery ¶
type ReleasePolicyQuery struct { Where *ent.ReleasePolicyWhereInput WithAffects bool }
type ReleaseQuery ¶
type ServerError ¶
ServerError returns when an unexpected error happened on the server
func NewServerError ¶
func NewServerError(err error, msg string) *ServerError
func (*ServerError) Error ¶
func (e *ServerError) Error() string
Error implements the error interface.
type ValidationError ¶
ValidationError returns when validating a request fails
func NewValidationError ¶
func NewValidationError(err error, msg string) *ValidationError
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
type VulnerabilityReviewQuery ¶
type VulnerabilityReviewQuery struct { Where *ent.VulnerabilityReviewWhereInput WithProjects bool WithRepos bool }