policy

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreatePolicyRequest

type CreatePolicyRequest struct {
	Name           string
	PolicyDocument *iam.PolicyDocument
}

CreatePolicyRequest represents a request to create a new policy

type Repository

type Repository interface {
	GetPolicy(ctx context.Context, name string) (*metadata.Policy, error)
	SavePolicy(ctx context.Context, policy *metadata.Policy) error
	DeletePolicy(ctx context.Context, name string) error
	GetPolicies(ctx context.Context) (map[string]*metadata.Policy, error)
	ListPolicyNames(ctx context.Context) ([]string, error)
}

Repository is the persistence interface required by the policy Service.

type Service

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

Service provides policy management operations

func NewService

func NewService(metadataManager Repository) *Service

NewService creates a new policy service

func (*Service) Create

func (s *Service) Create(ctx context.Context, req *CreatePolicyRequest) (*iam.Policy, error)

Create creates a new policy with validation

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, name string) error

Delete deletes a policy by name. Built-in policies cannot be deleted.

func (*Service) Get

func (s *Service) Get(ctx context.Context, name string) (*iam.Policy, error)

Get retrieves a policy by name

func (*Service) List

func (s *Service) List(ctx context.Context) (map[string]*metadata.Policy, error)

List returns all policies

func (*Service) ListNames

func (s *Service) ListNames(ctx context.Context) ([]string, error)

ListNames returns all policy names

func (*Service) Update

func (s *Service) Update(ctx context.Context, name string, req *UpdatePolicyRequest) (*iam.Policy, error)

Update updates the policy document of an existing policy

type UpdatePolicyRequest

type UpdatePolicyRequest struct {
	PolicyDocument *iam.PolicyDocument
}

UpdatePolicyRequest represents a request to update an existing policy

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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