store

package
v0.0.0-...-aca7f8d Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: MPL-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleEntError

func HandleEntError(entErr error, msg string) error

func HandleValidatorError

func HandleValidatorError(err error, msg string) error

func IsConflictError

func IsConflictError(err error) bool

IsConflictError returns a boolean indicating whether the error is a conflict error.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns a boolean indicating whether the error is a not found error.

func IsServerError

func IsServerError(err error) bool

IsServerError returns a boolean indicating whether the error is a server error.

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns a boolean indicating whether the error is a validation error.

func WithClient

func WithClient(client *ent.Client) func(h *handlerConfig)

func WithContext

func WithContext(ctx context.Context) func(h *handlerConfig)

func WithOrgName

func WithOrgName(name string) func(h *handlerConfig)

func WithStore

func WithStore(s *Store) func(h *handlerConfig)

func WithTx

func WithTx(ctx context.Context, client *ent.Client, fn func(tx *ent.Tx) error) error

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

type ConflictError struct {
	Msg string
	Err error
}

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 NewHandler(opts ...func(h *handlerConfig)) (*Handler, error)

func (*Handler) Client

func (h *Handler) Client() *ent.Client

func (*Handler) CreateProject

func (h *Handler) CreateProject(req *api.ProjectCreateRequest) (*ent.Project, error)

func (*Handler) CreateRelease

func (h *Handler) CreateRelease(req *api.ReleaseCreateRequest) (*ent.Release, error)

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 (h *Handler) GetComponentOrError(client *ent.Client, id int) (*ent.Component, error)

func (*Handler) GetComponents

func (h *Handler) GetComponents(query *ComponentQuery) ([]*api.Component, error)

func (*Handler) GetEvents

func (h *Handler) GetEvents(req *api.EventGetRequest) ([]*ent.Event, 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 (h *Handler) LogArtifact(req *api.ArtifactLogRequest) (*ent.Artifact, error)

func (*Handler) PopulateStoreWithDummyData

func (h *Handler) PopulateStoreWithDummyData() error

func (*Handler) PopulateStoreWithPolicies

func (h *Handler) PopulateStoreWithPolicies() error

func (*Handler) SaveAdapter

func (h *Handler) SaveAdapter(req *api.AdapterSaveRequest) (*ent.Adapter, error)

func (*Handler) SaveCodeScan

func (h *Handler) SaveCodeScan(req *api.CodeScanRequest) (*ent.CodeScan, error)

func (*Handler) SaveComponentVulnerabilities

func (h *Handler) SaveComponentVulnerabilities(req *api.ComponentVulnerabilityRequest) error

func (*Handler) SaveEvent

func (h *Handler) SaveEvent(req *api.EventSaveRequest) (*ent.Event, error)

func (*Handler) SaveReleasePolicy

func (h *Handler) SaveReleasePolicy(req *api.ReleasePolicySaveRequest) (*ent.ReleasePolicy, error)

func (*Handler) SaveTestRun

func (h *Handler) SaveTestRun(req *api.TestRunRequest) (*ent.TestRun, error)

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 ReleaseQuery struct {
	Where *ent.ReleaseWhereInput
	Order *api.Order

	WithLog        bool
	WithViolations bool
	WithPolicies   bool
}

type ServerError

type ServerError struct {
	Msg string
	Err error
}

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 Store

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

func New

func New(bCtx *config.BubblyConfig) (*Store, error)

func (*Store) Client

func (s *Store) Client() *ent.Client

func (*Store) Close

func (s *Store) Close() error

type ValidationError

type ValidationError struct {
	Msg string
	Err error
}

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
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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