provider

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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) Delete

func (r *Repository) Delete(id uint) error

Delete record by ID

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

func (*Repository) GetOne

func (r *Repository) GetOne(pType, urn string) (*domain.Provider, error)

GetOne returns provider by type and urn

func (*Repository) Update

func (r *Repository) Update(p *domain.Provider) error

Update record by ID

type Service

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

Service handling the business logics

func NewService

NewService returns service struct

func (*Service) Create

func (s *Service) Create(p *domain.Provider) error

Create record

func (*Service) FetchResources

func (s *Service) FetchResources() error

FetchResources fetches all resources for all registered providers

func (*Service) Find

func (s *Service) Find() ([]*domain.Provider, error)

Find records

func (*Service) GrantAccess

func (s *Service) GrantAccess(a *domain.Appeal) error

func (*Service) RevokeAccess

func (s *Service) RevokeAccess(a *domain.Appeal) error

func (*Service) Update

func (s *Service) Update(p *domain.Provider) error

Update updates the non-zero value(s) only

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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