memstore

package
v0.0.0-...-d983439 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTypeAssertionFailed = errors.New("type assertion failed: could not convert interface{} to *storage.Policy")

Functions

This section is empty.

Types

type State

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

func New

func New() *State

func NewWithProjectLimit

func NewWithProjectLimit(projectLimit int) *State

func (*State) AddPolicyMembers

func (s *State) AddPolicyMembers(
	_ context.Context, policyID string, members []storage.Member) ([]storage.Member, error)

func (*State) ApplyStagedRules

func (*State) ApplyStagedRules(context.Context) error

func (*State) Close

func (s *State) Close() error

func (*State) CreatePolicy

func (s *State) CreatePolicy(_ context.Context, inputPol *storage.Policy, skipProjectsCheckOnV1PolicyMigration bool) (*storage.Policy, error)

func (*State) CreateProject

func (s *State) CreateProject(_ context.Context, project *storage.Project, addPolicies bool) (*storage.Project, error)

func (*State) CreateRole

func (s *State) CreateRole(_ context.Context, role *storage.Role, skipProjectsCheckOnV1PolicyMigration bool) (*storage.Role, error)

func (*State) CreateRule

func (s *State) CreateRule(_ context.Context, rule *storage.Rule) (*storage.Rule, error)

func (*State) DeletePolicy

func (s *State) DeletePolicy(ctx context.Context, policyID string) error

func (*State) DeleteProject

func (s *State) DeleteProject(ctx context.Context, id string) error

func (*State) DeleteRole

func (s *State) DeleteRole(ctx context.Context, roleID string) error

func (*State) DeleteRule

func (s *State) DeleteRule(ctx context.Context, projectID, ruleID string) error

func (*State) EnsureNoProjectsMissing

func (*State) EnsureNoProjectsMissing(ctx context.Context, projectIDs []string) error

func (*State) FetchAppliedRulesByProjectIDs

func (*State) FetchAppliedRulesByProjectIDs(ctx context.Context) (map[string][]*storage.Rule, error)

func (*State) GetPolicy

func (s *State) GetPolicy(_ context.Context, policyID string) (pol *storage.Policy, err error)

func (*State) GetPolicyChangeID

func (s *State) GetPolicyChangeID(_ context.Context) (string, error)

func (*State) GetPolicyChangeNotifier

func (s *State) GetPolicyChangeNotifier(ctx context.Context) (storage.PolicyChangeNotifier, error)

func (*State) GetProject

func (s *State) GetProject(_ context.Context, id string) (*storage.Project, error)

func (*State) GetRole

func (s *State) GetRole(_ context.Context, roleID string) (role *storage.Role, err error)

func (*State) GetStagedOrAppliedRule

func (s *State) GetStagedOrAppliedRule(_ context.Context, projectID, ruleID string) (*storage.Rule, error)

func (*State) ListPolicies

func (s *State) ListPolicies(context.Context) ([]*storage.Policy, error)

func (*State) ListPolicyMembers

func (s *State) ListPolicyMembers(_ context.Context, policyID string) ([]storage.Member, error)

func (*State) ListProjects

func (s *State) ListProjects(context.Context) ([]*storage.Project, error)

func (*State) ListRoles

func (s *State) ListRoles(context.Context) ([]*storage.Role, error)

func (*State) ListRules

func (s *State) ListRules(_ context.Context) ([]*storage.Rule, error)

func (*State) ListRulesForProject

func (s *State) ListRulesForProject(_ context.Context, projectID string) ([]*storage.Rule, storage.ProjectRulesStatus, error)

func (*State) ListStagedAndAppliedRules

func (s *State) ListStagedAndAppliedRules(_ context.Context) ([]*storage.Rule, error)

func (*State) PoliciesCache

func (s *State) PoliciesCache() *cache.Cache

PoliciesCache is used in testing

func (*State) ProjectsCache

func (s *State) ProjectsCache() *cache.Cache

ProjectsCache is used in testing

func (*State) PurgeSubjectFromPolicies

func (s *State) PurgeSubjectFromPolicies(_ context.Context, sub string) ([]string, error)

func (*State) RemovePolicyMembers

func (s *State) RemovePolicyMembers(ctx context.Context,
	policyID string, membersToRemove []storage.Member) ([]storage.Member, error)

func (*State) RemoveProjectFromGraveyard

func (s *State) RemoveProjectFromGraveyard(context.Context, string) error

func (*State) ReplacePolicyMembers

func (s *State) ReplacePolicyMembers(
	ctx context.Context, policyID string, members []storage.Member) ([]storage.Member, error)

func (*State) Reset

func (s *State) Reset(ctx context.Context) error

func (*State) RolesCache

func (s *State) RolesCache() *cache.Cache

RolesCache is used in testing

func (*State) RulesCache

func (s *State) RulesCache() *cache.Cache

RulesCache is used in testing

func (*State) UpdatePolicy

func (s *State) UpdatePolicy(_ context.Context, p *storage.Policy) (*storage.Policy, error)

func (*State) UpdateProject

func (s *State) UpdateProject(_ context.Context, project *storage.Project) (*storage.Project, error)

func (*State) UpdateRole

func (s *State) UpdateRole(_ context.Context, r *storage.Role) (*storage.Role, error)

func (*State) UpdateRule

func (s *State) UpdateRule(_ context.Context, rule *storage.Rule) (*storage.Rule, error)

Jump to

Keyboard shortcuts

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