client

package
v0.0.0-...-f70214e Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Decision(ctx context.Context, options sdk.DecisionOptions) (*sdk.DecisionResult, error)
	DecisionID(ctx context.Context) string
	Path(module string, rule string) string
}

func NewClient

func NewClient(sdk *sdk.OPA) Client

type MockClient

type MockClient struct {
	mock.Mock
}

MockClient is an autogenerated mock type for the Client type

func NewMockClient

func NewMockClient(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockClient

NewMockClient creates a new instance of MockClient. 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 (*MockClient) Decision

func (_m *MockClient) Decision(ctx context.Context, options sdk.DecisionOptions) (*sdk.DecisionResult, error)

Decision provides a mock function with given fields: ctx, options

func (*MockClient) DecisionID

func (_m *MockClient) DecisionID(ctx context.Context) string

DecisionID provides a mock function with given fields: ctx

func (*MockClient) EXPECT

func (_m *MockClient) EXPECT() *MockClient_Expecter

func (*MockClient) Path

func (_m *MockClient) Path(module string, rule string) string

Path provides a mock function with given fields: module, rule

type MockClient_DecisionID_Call

type MockClient_DecisionID_Call struct {
	*mock.Call
}

MockClient_DecisionID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DecisionID'

func (*MockClient_DecisionID_Call) Return

func (*MockClient_DecisionID_Call) Run

func (*MockClient_DecisionID_Call) RunAndReturn

type MockClient_Decision_Call

type MockClient_Decision_Call struct {
	*mock.Call
}

MockClient_Decision_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Decision'

func (*MockClient_Decision_Call) Return

func (*MockClient_Decision_Call) Run

func (*MockClient_Decision_Call) RunAndReturn

type MockClient_Expecter

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

func (*MockClient_Expecter) Decision

func (_e *MockClient_Expecter) Decision(ctx interface{}, options interface{}) *MockClient_Decision_Call

Decision is a helper method to define mock.On call

  • ctx context.Context
  • options sdk.DecisionOptions

func (*MockClient_Expecter) DecisionID

func (_e *MockClient_Expecter) DecisionID(ctx interface{}) *MockClient_DecisionID_Call

DecisionID is a helper method to define mock.On call

  • ctx context.Context

func (*MockClient_Expecter) Path

func (_e *MockClient_Expecter) Path(module interface{}, rule interface{}) *MockClient_Path_Call

Path is a helper method to define mock.On call

  • module string
  • rule string

type MockClient_Path_Call

type MockClient_Path_Call struct {
	*mock.Call
}

MockClient_Path_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Path'

func (*MockClient_Path_Call) Return

func (*MockClient_Path_Call) Run

func (_c *MockClient_Path_Call) Run(run func(module string, rule string)) *MockClient_Path_Call

func (*MockClient_Path_Call) RunAndReturn

func (_c *MockClient_Path_Call) RunAndReturn(run func(string, string) string) *MockClient_Path_Call

Jump to

Keyboard shortcuts

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