Documentation
¶
Index ¶
- Variables
- func NewBaderStore(db *badger.DB) *badgerDataStore
- func NewSqlDatastore(db *bun.DB) *sqlDataStore
- func Validate()
- type Base
- type DataStore
- type Entity
- type MockDataStore
- type MockDataStore_Expecter
- type MockDataStore_addEntity_Call
- func (_c *MockDataStore_addEntity_Call) Return(err error) *MockDataStore_addEntity_Call
- func (_c *MockDataStore_addEntity_Call) Run(run func(ctx context.Context, entity *fencev1.Entity)) *MockDataStore_addEntity_Call
- func (_c *MockDataStore_addEntity_Call) RunAndReturn(run func(ctx context.Context, entity *fencev1.Entity) error) *MockDataStore_addEntity_Call
- type MockDataStore_addPolicy_Call
- func (_c *MockDataStore_addPolicy_Call) Return(err error) *MockDataStore_addPolicy_Call
- func (_c *MockDataStore_addPolicy_Call) Run(run func(ctx context.Context, id string, content string)) *MockDataStore_addPolicy_Call
- func (_c *MockDataStore_addPolicy_Call) RunAndReturn(run func(ctx context.Context, id string, content string) error) *MockDataStore_addPolicy_Call
- type MockDataStore_deleteEntity_Call
- func (_c *MockDataStore_deleteEntity_Call) Return(err error) *MockDataStore_deleteEntity_Call
- func (_c *MockDataStore_deleteEntity_Call) Run(run func(ctx context.Context, uid *fencev1.UID)) *MockDataStore_deleteEntity_Call
- func (_c *MockDataStore_deleteEntity_Call) RunAndReturn(run func(ctx context.Context, uid *fencev1.UID) error) *MockDataStore_deleteEntity_Call
- type MockDataStore_deletePolicy_Call
- func (_c *MockDataStore_deletePolicy_Call) Return(err error) *MockDataStore_deletePolicy_Call
- func (_c *MockDataStore_deletePolicy_Call) Run(run func(ctx context.Context, id string)) *MockDataStore_deletePolicy_Call
- func (_c *MockDataStore_deletePolicy_Call) RunAndReturn(run func(ctx context.Context, id string) error) *MockDataStore_deletePolicy_Call
- type MockDataStore_getEntities_Call
- func (_c *MockDataStore_getEntities_Call) Return(entitys []*fencev1.Entity, err error) *MockDataStore_getEntities_Call
- func (_c *MockDataStore_getEntities_Call) Run(run func(ctx context.Context)) *MockDataStore_getEntities_Call
- func (_c *MockDataStore_getEntities_Call) RunAndReturn(run func(ctx context.Context) ([]*fencev1.Entity, error)) *MockDataStore_getEntities_Call
- type MockDataStore_getEntityMap_Call
- func (_c *MockDataStore_getEntityMap_Call) Return(v cedar.EntityMap, err error) *MockDataStore_getEntityMap_Call
- func (_c *MockDataStore_getEntityMap_Call) Run(run func(ctx context.Context)) *MockDataStore_getEntityMap_Call
- func (_c *MockDataStore_getEntityMap_Call) RunAndReturn(run func(ctx context.Context) (cedar.EntityMap, error)) *MockDataStore_getEntityMap_Call
- type MockDataStore_getPolicies_Call
- func (_c *MockDataStore_getPolicies_Call) Return(policys []*fencev1.Policy, err error) *MockDataStore_getPolicies_Call
- func (_c *MockDataStore_getPolicies_Call) Run(run func(ctx context.Context)) *MockDataStore_getPolicies_Call
- func (_c *MockDataStore_getPolicies_Call) RunAndReturn(run func(ctx context.Context) ([]*fencev1.Policy, error)) *MockDataStore_getPolicies_Call
- type MockDataStore_getPolicySet_Call
- func (_c *MockDataStore_getPolicySet_Call) Return(policySet *cedar.PolicySet, err error) *MockDataStore_getPolicySet_Call
- func (_c *MockDataStore_getPolicySet_Call) Run(run func(ctx context.Context)) *MockDataStore_getPolicySet_Call
- func (_c *MockDataStore_getPolicySet_Call) RunAndReturn(run func(ctx context.Context) (*cedar.PolicySet, error)) *MockDataStore_getPolicySet_Call
- type MockDataStore_getPolicy_Call
- func (_c *MockDataStore_getPolicy_Call) Return(policy *cedar.Policy, err error) *MockDataStore_getPolicy_Call
- func (_c *MockDataStore_getPolicy_Call) Run(run func(ctx context.Context, id string)) *MockDataStore_getPolicy_Call
- func (_c *MockDataStore_getPolicy_Call) RunAndReturn(run func(ctx context.Context, id string) (*cedar.Policy, error)) *MockDataStore_getPolicy_Call
- type Policy
- type Service
- func (s *Service) CreateEntities(ctx context.Context, req *fencev1.CreateEntitiesRequest) (*fencev1.CreateEntitiesResponse, error)
- func (s *Service) CreatePolicies(ctx context.Context, req *fencev1.CreatePoliciesRequest) (*fencev1.CreatePoliciesResponse, error)
- func (s *Service) DeleteEntity(ctx context.Context, req *fencev1.DeleteEntityRequest) (*fencev1.DeleteEntityResponse, error)
- func (s *Service) DeletePolicy(ctx context.Context, req *fencev1.DeletePolicyRequest) (*fencev1.DeletePolicyResponse, error)
- func (s *Service) GetEntity(context.Context, *fencev1.GetEntityRequest) (*fencev1.GetEntityResponse, error)
- func (s *Service) GetPolicy(ctx context.Context, req *fencev1.GetPolicyRequest) (*fencev1.GetPolicyResponse, error)
- func (s *Service) IsAllowed(ctx context.Context, req *fencev1.IsAllowedRequest) (*fencev1.IsAllowedResponse, error)
- func (s *Service) ListEntities(ctx context.Context, req *fencev1.ListEntitiesRequest) (*fencev1.ListEntitiesResponse, error)
- func (s *Service) ListPolicies(ctx context.Context, _ *fencev1.ListPoliciesRequest) (*fencev1.ListPoliciesResponse, error)
- type UID
Constants ¶
This section is empty.
Variables ¶
var ( ErrEntityNotFound = errors.New("entity not found") ErrPolicyNotFound = errors.New("policy not found") ErrPolicyAlreadyExists = errors.New("policy already exists") )
var (
ErrEntityAlreadyExists = errors.New("entity already exists")
)
Functions ¶
func NewBaderStore ¶
func NewSqlDatastore ¶
Types ¶
type Entity ¶
type MockDataStore ¶
MockDataStore is an autogenerated mock type for the DataStore type
func NewMockDataStore ¶
func NewMockDataStore(t interface {
mock.TestingT
Cleanup(func())
}) *MockDataStore
NewMockDataStore creates a new instance of MockDataStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockDataStore) EXPECT ¶
func (_m *MockDataStore) EXPECT() *MockDataStore_Expecter
type MockDataStore_Expecter ¶
type MockDataStore_Expecter struct {
// contains filtered or unexported fields
}
type MockDataStore_addEntity_Call ¶
MockDataStore_addEntity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'addEntity'
func (*MockDataStore_addEntity_Call) Return ¶
func (_c *MockDataStore_addEntity_Call) Return(err error) *MockDataStore_addEntity_Call
func (*MockDataStore_addEntity_Call) Run ¶
func (_c *MockDataStore_addEntity_Call) Run(run func(ctx context.Context, entity *fencev1.Entity)) *MockDataStore_addEntity_Call
func (*MockDataStore_addEntity_Call) RunAndReturn ¶
func (_c *MockDataStore_addEntity_Call) RunAndReturn(run func(ctx context.Context, entity *fencev1.Entity) error) *MockDataStore_addEntity_Call
type MockDataStore_addPolicy_Call ¶
MockDataStore_addPolicy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'addPolicy'
func (*MockDataStore_addPolicy_Call) Return ¶
func (_c *MockDataStore_addPolicy_Call) Return(err error) *MockDataStore_addPolicy_Call
func (*MockDataStore_addPolicy_Call) Run ¶
func (_c *MockDataStore_addPolicy_Call) Run(run func(ctx context.Context, id string, content string)) *MockDataStore_addPolicy_Call
func (*MockDataStore_addPolicy_Call) RunAndReturn ¶
func (_c *MockDataStore_addPolicy_Call) RunAndReturn(run func(ctx context.Context, id string, content string) error) *MockDataStore_addPolicy_Call
type MockDataStore_deleteEntity_Call ¶
MockDataStore_deleteEntity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'deleteEntity'
func (*MockDataStore_deleteEntity_Call) Return ¶
func (_c *MockDataStore_deleteEntity_Call) Return(err error) *MockDataStore_deleteEntity_Call
func (*MockDataStore_deleteEntity_Call) Run ¶
func (_c *MockDataStore_deleteEntity_Call) Run(run func(ctx context.Context, uid *fencev1.UID)) *MockDataStore_deleteEntity_Call
func (*MockDataStore_deleteEntity_Call) RunAndReturn ¶
func (_c *MockDataStore_deleteEntity_Call) RunAndReturn(run func(ctx context.Context, uid *fencev1.UID) error) *MockDataStore_deleteEntity_Call
type MockDataStore_deletePolicy_Call ¶
MockDataStore_deletePolicy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'deletePolicy'
func (*MockDataStore_deletePolicy_Call) Return ¶
func (_c *MockDataStore_deletePolicy_Call) Return(err error) *MockDataStore_deletePolicy_Call
func (*MockDataStore_deletePolicy_Call) Run ¶
func (_c *MockDataStore_deletePolicy_Call) Run(run func(ctx context.Context, id string)) *MockDataStore_deletePolicy_Call
func (*MockDataStore_deletePolicy_Call) RunAndReturn ¶
func (_c *MockDataStore_deletePolicy_Call) RunAndReturn(run func(ctx context.Context, id string) error) *MockDataStore_deletePolicy_Call
type MockDataStore_getEntities_Call ¶
MockDataStore_getEntities_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'getEntities'
func (*MockDataStore_getEntities_Call) Return ¶
func (_c *MockDataStore_getEntities_Call) Return(entitys []*fencev1.Entity, err error) *MockDataStore_getEntities_Call
func (*MockDataStore_getEntities_Call) Run ¶
func (_c *MockDataStore_getEntities_Call) Run(run func(ctx context.Context)) *MockDataStore_getEntities_Call
func (*MockDataStore_getEntities_Call) RunAndReturn ¶
func (_c *MockDataStore_getEntities_Call) RunAndReturn(run func(ctx context.Context) ([]*fencev1.Entity, error)) *MockDataStore_getEntities_Call
type MockDataStore_getEntityMap_Call ¶
MockDataStore_getEntityMap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'getEntityMap'
func (*MockDataStore_getEntityMap_Call) Return ¶
func (_c *MockDataStore_getEntityMap_Call) Return(v cedar.EntityMap, err error) *MockDataStore_getEntityMap_Call
func (*MockDataStore_getEntityMap_Call) Run ¶
func (_c *MockDataStore_getEntityMap_Call) Run(run func(ctx context.Context)) *MockDataStore_getEntityMap_Call
func (*MockDataStore_getEntityMap_Call) RunAndReturn ¶
func (_c *MockDataStore_getEntityMap_Call) RunAndReturn(run func(ctx context.Context) (cedar.EntityMap, error)) *MockDataStore_getEntityMap_Call
type MockDataStore_getPolicies_Call ¶
MockDataStore_getPolicies_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'getPolicies'
func (*MockDataStore_getPolicies_Call) Return ¶
func (_c *MockDataStore_getPolicies_Call) Return(policys []*fencev1.Policy, err error) *MockDataStore_getPolicies_Call
func (*MockDataStore_getPolicies_Call) Run ¶
func (_c *MockDataStore_getPolicies_Call) Run(run func(ctx context.Context)) *MockDataStore_getPolicies_Call
func (*MockDataStore_getPolicies_Call) RunAndReturn ¶
func (_c *MockDataStore_getPolicies_Call) RunAndReturn(run func(ctx context.Context) ([]*fencev1.Policy, error)) *MockDataStore_getPolicies_Call
type MockDataStore_getPolicySet_Call ¶
MockDataStore_getPolicySet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'getPolicySet'
func (*MockDataStore_getPolicySet_Call) Return ¶
func (_c *MockDataStore_getPolicySet_Call) Return(policySet *cedar.PolicySet, err error) *MockDataStore_getPolicySet_Call
func (*MockDataStore_getPolicySet_Call) Run ¶
func (_c *MockDataStore_getPolicySet_Call) Run(run func(ctx context.Context)) *MockDataStore_getPolicySet_Call
func (*MockDataStore_getPolicySet_Call) RunAndReturn ¶
func (_c *MockDataStore_getPolicySet_Call) RunAndReturn(run func(ctx context.Context) (*cedar.PolicySet, error)) *MockDataStore_getPolicySet_Call
type MockDataStore_getPolicy_Call ¶
MockDataStore_getPolicy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'getPolicy'
func (*MockDataStore_getPolicy_Call) Return ¶
func (_c *MockDataStore_getPolicy_Call) Return(policy *cedar.Policy, err error) *MockDataStore_getPolicy_Call
func (*MockDataStore_getPolicy_Call) Run ¶
func (_c *MockDataStore_getPolicy_Call) Run(run func(ctx context.Context, id string)) *MockDataStore_getPolicy_Call
func (*MockDataStore_getPolicy_Call) RunAndReturn ¶
func (_c *MockDataStore_getPolicy_Call) RunAndReturn(run func(ctx context.Context, id string) (*cedar.Policy, error)) *MockDataStore_getPolicy_Call
type Policy ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) CreateEntities ¶
func (s *Service) CreateEntities(ctx context.Context, req *fencev1.CreateEntitiesRequest) (*fencev1.CreateEntitiesResponse, error)
func (*Service) CreatePolicies ¶
func (s *Service) CreatePolicies(ctx context.Context, req *fencev1.CreatePoliciesRequest) (*fencev1.CreatePoliciesResponse, error)
func (*Service) DeleteEntity ¶
func (s *Service) DeleteEntity(ctx context.Context, req *fencev1.DeleteEntityRequest) (*fencev1.DeleteEntityResponse, error)
func (*Service) DeletePolicy ¶
func (s *Service) DeletePolicy(ctx context.Context, req *fencev1.DeletePolicyRequest) (*fencev1.DeletePolicyResponse, error)
func (*Service) GetEntity ¶
func (s *Service) GetEntity(context.Context, *fencev1.GetEntityRequest) (*fencev1.GetEntityResponse, error)
func (*Service) GetPolicy ¶
func (s *Service) GetPolicy(ctx context.Context, req *fencev1.GetPolicyRequest) (*fencev1.GetPolicyResponse, error)
func (*Service) IsAllowed ¶
func (s *Service) IsAllowed(ctx context.Context, req *fencev1.IsAllowedRequest) (*fencev1.IsAllowedResponse, error)
func (*Service) ListEntities ¶
func (s *Service) ListEntities(ctx context.Context, req *fencev1.ListEntitiesRequest) (*fencev1.ListEntitiesResponse, error)
func (*Service) ListPolicies ¶
func (s *Service) ListPolicies(ctx context.Context, _ *fencev1.ListPoliciesRequest) (*fencev1.ListPoliciesResponse, error)