Documentation ¶
Index ¶
- Variables
- type ActivityRepository
- func (r *ActivityRepository) BulkUpsert(ctx context.Context, activities []*domain.Activity) error
- func (r *ActivityRepository) Find(ctx context.Context, filter domain.ListProviderActivitiesFilter) ([]*domain.Activity, error)
- func (r *ActivityRepository) GetOne(ctx context.Context, id string) (*domain.Activity, error)
- type AppealRepository
- func (r *AppealRepository) BulkUpsert(ctx context.Context, appeals []*domain.Appeal) error
- func (r *AppealRepository) Find(ctx context.Context, filters *domain.ListAppealsFilter) ([]*domain.Appeal, error)
- func (r *AppealRepository) GetByID(ctx context.Context, id string) (*domain.Appeal, error)
- func (r *AppealRepository) Update(ctx context.Context, a *domain.Appeal) error
- type ApprovalRepository
- func (r *ApprovalRepository) AddApprover(ctx context.Context, approver *domain.Approver) error
- func (r *ApprovalRepository) BulkInsert(ctx context.Context, approvals []*domain.Approval) error
- func (r *ApprovalRepository) DeleteApprover(ctx context.Context, approvalID, email string) error
- func (r *ApprovalRepository) ListApprovals(ctx context.Context, conditions *domain.ListApprovalsFilter) ([]*domain.Approval, error)
- type GrantRepository
- func (r *GrantRepository) BulkInsert(ctx context.Context, grants []*domain.Grant) error
- func (r *GrantRepository) BulkUpsert(ctx context.Context, grants []*domain.Grant) error
- func (r *GrantRepository) GetByID(ctx context.Context, id string) (*domain.Grant, error)
- func (r *GrantRepository) List(ctx context.Context, filter domain.ListGrantsFilter) ([]domain.Grant, error)
- func (r *GrantRepository) Update(ctx context.Context, a *domain.Grant) error
- type PolicyRepository
- type ProviderRepository
- func (r *ProviderRepository) Create(ctx context.Context, p *domain.Provider) error
- func (r *ProviderRepository) Delete(ctx context.Context, id string) error
- func (r *ProviderRepository) Find(ctx context.Context) ([]*domain.Provider, error)
- func (r *ProviderRepository) GetByID(ctx context.Context, id string) (*domain.Provider, error)
- func (r *ProviderRepository) GetOne(ctx context.Context, pType, urn string) (*domain.Provider, error)
- func (r *ProviderRepository) GetTypes(ctx context.Context) ([]domain.ProviderType, error)
- func (r *ProviderRepository) Update(ctx context.Context, p *domain.Provider) error
- type ResourceRepository
- func (r *ResourceRepository) BatchDelete(ctx context.Context, ids []string) error
- func (r *ResourceRepository) BulkUpsert(ctx context.Context, resources []*domain.Resource) error
- func (r *ResourceRepository) Delete(ctx context.Context, id string) error
- func (r *ResourceRepository) Find(ctx context.Context, filter domain.ListResourcesFilter) ([]*domain.Resource, error)
- func (r *ResourceRepository) GetOne(ctx context.Context, id string) (*domain.Resource, error)
- func (r *ResourceRepository) Update(ctx context.Context, res *domain.Resource) error
- type Store
Constants ¶
This section is empty.
Variables ¶
var ( AppealStatusDefaultSort = []string{ domain.AppealStatusPending, domain.AppealStatusApproved, domain.AppealStatusRejected, domain.AppealStatusCanceled, } )
var ( ApprovalStatusDefaultSort = []string{ domain.ApprovalStatusPending, domain.ApprovalStatusApproved, domain.ApprovalStatusRejected, domain.ApprovalStatusBlocked, domain.ApprovalStatusSkipped, } )
var ( GrantStatusDefaultSort = []string{ string(domain.GrantStatusActive), string(domain.GrantStatusInactive), } )
Functions ¶
This section is empty.
Types ¶
type ActivityRepository ¶
type ActivityRepository struct {
// contains filtered or unexported fields
}
func NewActivityRepository ¶
func NewActivityRepository(db *gorm.DB) *ActivityRepository
func (*ActivityRepository) BulkUpsert ¶
func (*ActivityRepository) Find ¶
func (r *ActivityRepository) Find(ctx context.Context, filter domain.ListProviderActivitiesFilter) ([]*domain.Activity, error)
type AppealRepository ¶
type AppealRepository struct {
// contains filtered or unexported fields
}
AppealRepository talks to the store to read or insert data
func NewAppealRepository ¶
func NewAppealRepository(db *gorm.DB) *AppealRepository
NewAppealRepository returns repository struct
func (*AppealRepository) BulkUpsert ¶
BulkUpsert new record to database
func (*AppealRepository) Find ¶
func (r *AppealRepository) Find(ctx context.Context, filters *domain.ListAppealsFilter) ([]*domain.Appeal, error)
type ApprovalRepository ¶
type ApprovalRepository struct {
// contains filtered or unexported fields
}
func NewApprovalRepository ¶
func NewApprovalRepository(db *gorm.DB) *ApprovalRepository
func (*ApprovalRepository) AddApprover ¶
func (*ApprovalRepository) BulkInsert ¶
func (*ApprovalRepository) DeleteApprover ¶
func (r *ApprovalRepository) DeleteApprover(ctx context.Context, approvalID, email string) error
func (*ApprovalRepository) ListApprovals ¶
func (r *ApprovalRepository) ListApprovals(ctx context.Context, conditions *domain.ListApprovalsFilter) ([]*domain.Approval, error)
type GrantRepository ¶
type GrantRepository struct {
// contains filtered or unexported fields
}
func NewGrantRepository ¶
func NewGrantRepository(db *gorm.DB) *GrantRepository
func (*GrantRepository) BulkInsert ¶
func (*GrantRepository) BulkUpsert ¶
func (*GrantRepository) List ¶
func (r *GrantRepository) List(ctx context.Context, filter domain.ListGrantsFilter) ([]domain.Grant, error)
type PolicyRepository ¶
type PolicyRepository struct {
// contains filtered or unexported fields
}
PolicyRepository talks to the store to read or insert data
func NewPolicyRepository ¶
func NewPolicyRepository(db *gorm.DB) *PolicyRepository
NewPolicyRepository returns repository struct
type ProviderRepository ¶
type ProviderRepository struct {
// contains filtered or unexported fields
}
ProviderRepository talks to the store to read or insert data
func NewProviderRepository ¶
func NewProviderRepository(db *gorm.DB) *ProviderRepository
NewProviderRepository returns repository struct
func (*ProviderRepository) Delete ¶
func (r *ProviderRepository) Delete(ctx context.Context, id string) error
Delete record by ID
func (*ProviderRepository) GetOne ¶
func (r *ProviderRepository) GetOne(ctx context.Context, pType, urn string) (*domain.Provider, error)
GetOne returns provider by type and urn
func (*ProviderRepository) GetTypes ¶
func (r *ProviderRepository) GetTypes(ctx context.Context) ([]domain.ProviderType, error)
type ResourceRepository ¶
type ResourceRepository struct {
// contains filtered or unexported fields
}
ResourceRepository talks to the store/database to read/insert data
func NewResourceRepository ¶
func NewResourceRepository(db *gorm.DB) *ResourceRepository
NewResourceRepository returns *Repository
func (*ResourceRepository) BatchDelete ¶
func (r *ResourceRepository) BatchDelete(ctx context.Context, ids []string) error
func (*ResourceRepository) BulkUpsert ¶
BulkUpsert inserts records if the records are not exist, or updates the records if they are already exist
func (*ResourceRepository) Delete ¶
func (r *ResourceRepository) Delete(ctx context.Context, id string) error
func (*ResourceRepository) Find ¶
func (r *ResourceRepository) Find(ctx context.Context, filter domain.ListResourcesFilter) ([]*domain.Resource, error)
Find records based on filters