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) GetAppealsTotalCount(ctx context.Context, filter *domain.ListAppealsFilter) (int64, error)
- func (r *AppealRepository) GetByID(ctx context.Context, id string) (*domain.Appeal, error)
- func (r *AppealRepository) Update(ctx context.Context, a *domain.Appeal) error
- func (r *AppealRepository) UpdateByID(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) GetApprovalsTotalCount(ctx context.Context, filter *domain.ListApprovalsFilter) (int64, error)
- func (r *ApprovalRepository) ListApprovals(ctx context.Context, filter *domain.ListApprovalsFilter) ([]*domain.Approval, error)
- type AuditLogRepository
- type CommentRepository
- 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) GetGrantsTotalCount(ctx context.Context, filter domain.ListGrantsFilter) (int64, error)
- func (r *GrantRepository) List(ctx context.Context, filter domain.ListGrantsFilter) ([]domain.Grant, error)
- func (r *GrantRepository) ListUserRoles(ctx context.Context, id string) ([]string, error)
- func (r *GrantRepository) Patch(ctx context.Context, g domain.GrantUpdate) 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) GetResourcesTotalCount(ctx context.Context, filter domain.ListResourcesFilter) (int64, 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)
func (*AppealRepository) GetAppealsTotalCount ¶ added in v0.7.5
func (r *AppealRepository) GetAppealsTotalCount(ctx context.Context, filter *domain.ListAppealsFilter) (int64, error)
func (*AppealRepository) GetByID ¶
GetByID returns appeal record by id along with the approvals and the approvers
func (*AppealRepository) UpdateByID ¶ added in v0.11.0
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) GetApprovalsTotalCount ¶ added in v0.7.5
func (r *ApprovalRepository) GetApprovalsTotalCount(ctx context.Context, filter *domain.ListApprovalsFilter) (int64, error)
func (*ApprovalRepository) ListApprovals ¶
func (r *ApprovalRepository) ListApprovals(ctx context.Context, filter *domain.ListApprovalsFilter) ([]*domain.Approval, error)
type AuditLogRepository ¶ added in v0.11.0
type AuditLogRepository struct {
// contains filtered or unexported fields
}
TODO: merge into github.com/goto/salt/audit
func NewAuditLogRepository ¶ added in v0.11.0
func NewAuditLogRepository(db *gorm.DB) *AuditLogRepository
func (*AuditLogRepository) List ¶ added in v0.11.0
func (r *AuditLogRepository) List(ctx context.Context, filter *domain.ListAuditLogFilter) ([]*audit.Log, error)
type CommentRepository ¶ added in v0.10.0
type CommentRepository struct {
// contains filtered or unexported fields
}
func NewCommentRepository ¶ added in v0.10.0
func NewCommentRepository(db *gorm.DB) *CommentRepository
func (*CommentRepository) List ¶ added in v0.10.0
func (r *CommentRepository) List(ctx context.Context, filter domain.ListCommentsFilter) ([]*domain.Comment, 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) GetGrantsTotalCount ¶ added in v0.7.5
func (r *GrantRepository) GetGrantsTotalCount(ctx context.Context, filter domain.ListGrantsFilter) (int64, error)
func (*GrantRepository) List ¶
func (r *GrantRepository) List(ctx context.Context, filter domain.ListGrantsFilter) ([]domain.Grant, error)
func (*GrantRepository) ListUserRoles ¶ added in v0.7.6
func (*GrantRepository) Patch ¶ added in v0.12.2
func (r *GrantRepository) Patch(ctx context.Context, g domain.GrantUpdate) 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
func (*ResourceRepository) GetResourcesTotalCount ¶ added in v0.7.7
func (r *ResourceRepository) GetResourcesTotalCount(ctx context.Context, filter domain.ListResourcesFilter) (int64, error)