Documentation
¶
Index ¶
- Variables
- func ClientFromContext(ctx context.Context) *client
- func ContextWithClient(ctx context.Context, cl *client) context.Context
- func ContextWithPrincipal(ctx context.Context, principal *fencev1.UID) context.Context
- func New(state FenceState) *client
- func PrincipalFromContext(ctx context.Context) (*fencev1.UID, error)
- func UIDToString(u *fencev1.UID) string
- type AgentConfig
- type CachedState
- type FenceAgentState
- type FenceAuthzError
- type FenceState
- type FileState
- type MockFenceState
- type MockFenceState_Expecter
- type MockFenceState_IsAllowed_Call
- type MockFenceState_Refresh_Call
- func (_c *MockFenceState_Refresh_Call) Return(err error) *MockFenceState_Refresh_Call
- func (_c *MockFenceState_Refresh_Call) Run(run func(context1 context.Context)) *MockFenceState_Refresh_Call
- func (_c *MockFenceState_Refresh_Call) RunAndReturn(run func(context1 context.Context) error) *MockFenceState_Refresh_Call
- type MockFenceState_refresh_Call
Constants ¶
This section is empty.
Variables ¶
var (
ErrInvalidPrincipal = errors.New("invalid principal")
)
Functions ¶
func ClientFromContext ¶
func ContextWithPrincipal ¶
func New ¶
func New(state FenceState) *client
func UIDToString ¶
Types ¶
type AgentConfig ¶
type CachedState ¶
type CachedState struct {
// contains filtered or unexported fields
}
func NewCachedState ¶
func NewCachedState(state FenceState, refreshDuration time.Duration) (*CachedState, error)
type FenceAgentState ¶
type FenceAgentState struct {
// contains filtered or unexported fields
}
func NewAgentState ¶
func NewAgentState(cfg AgentConfig) *FenceAgentState
type FenceAuthzError ¶
type FenceAuthzError struct {
// contains filtered or unexported fields
}
func NewAuthzError ¶
func NewAuthzError(principal, action, resource *fencev1.UID) FenceAuthzError
func (FenceAuthzError) Error ¶
func (az FenceAuthzError) Error() string
type FenceState ¶
type FileState ¶
type FileState struct {
// contains filtered or unexported fields
}
func NewFileState ¶
type MockFenceState ¶
MockFenceState is an autogenerated mock type for the FenceState type
func NewMockFenceState ¶
func NewMockFenceState(t interface {
mock.TestingT
Cleanup(func())
}) *MockFenceState
NewMockFenceState creates a new instance of MockFenceState. 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 (*MockFenceState) EXPECT ¶
func (_m *MockFenceState) EXPECT() *MockFenceState_Expecter
type MockFenceState_Expecter ¶
type MockFenceState_Expecter struct {
// contains filtered or unexported fields
}
func (*MockFenceState_Expecter) IsAllowed ¶
func (_e *MockFenceState_Expecter) IsAllowed(ctx interface{}, principal interface{}, action interface{}, resource interface{}) *MockFenceState_IsAllowed_Call
IsAllowed is a helper method to define mock.On call
- ctx context.Context
- principal *fencev1.UID
- action *fencev1.UID
- resource *fencev1.UID
func (*MockFenceState_Expecter) Refresh ¶
func (_e *MockFenceState_Expecter) Refresh(context1 interface{}) *MockFenceState_Refresh_Call
Refresh is a helper method to define mock.On call
- context1 context.Context
type MockFenceState_IsAllowed_Call ¶
MockFenceState_IsAllowed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsAllowed'
func (*MockFenceState_IsAllowed_Call) Return ¶
func (_c *MockFenceState_IsAllowed_Call) Return(err error) *MockFenceState_IsAllowed_Call
func (*MockFenceState_IsAllowed_Call) Run ¶
func (_c *MockFenceState_IsAllowed_Call) Run(run func(ctx context.Context, principal *fencev1.UID, action *fencev1.UID, resource *fencev1.UID)) *MockFenceState_IsAllowed_Call
func (*MockFenceState_IsAllowed_Call) RunAndReturn ¶
func (_c *MockFenceState_IsAllowed_Call) RunAndReturn(run func(ctx context.Context, principal *fencev1.UID, action *fencev1.UID, resource *fencev1.UID) error) *MockFenceState_IsAllowed_Call
type MockFenceState_Refresh_Call ¶
MockFenceState_Refresh_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Refresh'
func (*MockFenceState_Refresh_Call) Return ¶
func (_c *MockFenceState_Refresh_Call) Return(err error) *MockFenceState_Refresh_Call
func (*MockFenceState_Refresh_Call) Run ¶
func (_c *MockFenceState_Refresh_Call) Run(run func(context1 context.Context)) *MockFenceState_Refresh_Call
func (*MockFenceState_Refresh_Call) RunAndReturn ¶
func (_c *MockFenceState_Refresh_Call) RunAndReturn(run func(context1 context.Context) error) *MockFenceState_Refresh_Call
type MockFenceState_refresh_Call ¶
MockFenceState_refresh_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'refresh'
func (*MockFenceState_refresh_Call) Return ¶
func (_c *MockFenceState_refresh_Call) Return(err error) *MockFenceState_refresh_Call
func (*MockFenceState_refresh_Call) Run ¶
func (_c *MockFenceState_refresh_Call) Run(run func()) *MockFenceState_refresh_Call
func (*MockFenceState_refresh_Call) RunAndReturn ¶
func (_c *MockFenceState_refresh_Call) RunAndReturn(run func() error) *MockFenceState_refresh_Call