policy

package
v0.7.5-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuditKeyPolicyCreate = "policy.create"
	AuditKeyPolicyUpdate = "policy.update"
)

Variables

View Source
var (
	// ErrEmptyIDParam is the error value if the policy id is empty
	ErrEmptyIDParam = errors.New("id can't be empty")
	// ErrPolicyNotFound is the error value if the designated policy not found
	ErrPolicyNotFound              = errors.New("policy not found")
	ErrIDContainsWhitespaces       = errors.New("id should not contain whitespaces")
	ErrStepNameContainsWhitespaces = errors.New("step name should not contain whitespaces")
	ErrInvalidApprovers            = errors.New("invalid approvers")
	ErrStepDependencyDoesNotExists = errors.New("step dependency does not exists")
)

Functions

func WithDryRun

func WithDryRun(ctx context.Context) context.Context

Types

type Service

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

Service handling the business logics

func NewService

func NewService(deps ServiceDeps) *Service

NewService returns service struct

func (*Service) Create

func (s *Service) Create(ctx context.Context, p *domain.Policy) error

Create record

func (*Service) Find

func (s *Service) Find(ctx context.Context) ([]*domain.Policy, error)

Find records

func (*Service) GetOne

func (s *Service) GetOne(ctx context.Context, id string, version uint) (*domain.Policy, error)

GetOne record

func (*Service) Update

func (s *Service) Update(ctx context.Context, p *domain.Policy) error

Update a record

type ServiceDeps

type ServiceDeps struct {
	Repository      repository
	ResourceService resourceService
	ProviderService providerService
	IAMManager      domain.IAMManager

	Validator   *validator.Validate
	Logger      log.Logger
	AuditLogger auditLogger
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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