Documentation ¶
Index ¶
- Variables
- type JobHandler
- type Repository
- func (r *Repository) Create(p *domain.Provider) error
- func (r *Repository) Delete(id uint) error
- func (r *Repository) Find() ([]*domain.Provider, error)
- func (r *Repository) GetByID(id uint) (*domain.Provider, error)
- func (r *Repository) GetOne(pType, urn string) (*domain.Provider, error)
- func (r *Repository) Update(p *domain.Provider) error
- type Service
- func (s *Service) Create(p *domain.Provider) error
- func (s *Service) FetchResources() error
- func (s *Service) Find() ([]*domain.Provider, error)
- func (s *Service) GrantAccess(a *domain.Appeal) error
- func (s *Service) RevokeAccess(a *domain.Appeal) error
- func (s *Service) Update(p *domain.Provider) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidProviderType is the error value if provider is unable to find the matching provider type ErrInvalidProviderType = errors.New("unable to find provider based on provider type") // ErrEmptyIDParam is the error value if the policy id is empty ErrEmptyIDParam = errors.New("id can't be empty") // ErrRecordNotFound is the error value if the designated record id is not exists ErrRecordNotFound = errors.New("record not found") ErrEmptyProviderType = errors.New("provider type can't be nil") ErrEmptyProviderURN = errors.New("provider urn can't be nil") ErrNilAppeal = errors.New("appeal can't be nil") ErrNilResource = errors.New("resource can't be nil") ErrProviderNotFound = errors.New("provider config not found") )
Functions ¶
This section is empty.
Types ¶
type JobHandler ¶
type JobHandler struct {
// contains filtered or unexported fields
}
JobHandler for cronjob
func NewJobHandler ¶
func NewJobHandler(ps domain.ProviderService) *JobHandler
NewJobHandler returns *JobHandler
func (*JobHandler) GetResources ¶
func (h *JobHandler) GetResources() error
GetResources fetches all resources for all registered providers
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository talks to the store to read or insert data
func NewRepository ¶
func NewRepository(db *gorm.DB) *Repository
NewRepository returns repository struct
func (*Repository) Create ¶
func (r *Repository) Create(p *domain.Provider) error
Create new record to database
func (*Repository) Find ¶
func (r *Repository) Find() ([]*domain.Provider, error)
Find records based on filters
func (*Repository) GetByID ¶
func (r *Repository) GetByID(id uint) (*domain.Provider, error)
GetByID record by ID
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handling the business logics
func NewService ¶
func NewService(pr domain.ProviderRepository, rs domain.ResourceService, providers []domain.ProviderInterface) *Service
NewService returns service struct
func (*Service) FetchResources ¶
FetchResources fetches all resources for all registered providers
Click to show internal directories.
Click to hide internal directories.