Documentation ¶
Overview ¶
Package cost is a generated GoMock package.
Index ¶
- Constants
- type ChainedEnforcer
- type ChainedReporter
- type MockChainedEnforcer
- func (m *MockChainedEnforcer) Add(arg0 cost0.Cost) cost0.Report
- func (m *MockChainedEnforcer) Child(arg0 string) ChainedEnforcer
- func (m *MockChainedEnforcer) Clone() cost0.Enforcer
- func (m *MockChainedEnforcer) Close()
- func (m *MockChainedEnforcer) EXPECT() *MockChainedEnforcerMockRecorder
- func (m *MockChainedEnforcer) Limit() cost0.Limit
- func (m *MockChainedEnforcer) Reporter() cost0.EnforcerReporter
- func (m *MockChainedEnforcer) State() (cost0.Report, cost0.Limit)
- type MockChainedEnforcerMockRecorder
- func (mr *MockChainedEnforcerMockRecorder) Add(arg0 interface{}) *gomock.Call
- func (mr *MockChainedEnforcerMockRecorder) Child(arg0 interface{}) *gomock.Call
- func (mr *MockChainedEnforcerMockRecorder) Clone() *gomock.Call
- func (mr *MockChainedEnforcerMockRecorder) Close() *gomock.Call
- func (mr *MockChainedEnforcerMockRecorder) Limit() *gomock.Call
- func (mr *MockChainedEnforcerMockRecorder) Reporter() *gomock.Call
- func (mr *MockChainedEnforcerMockRecorder) State() *gomock.Call
- type MockChainedReporter
- func (m *MockChainedReporter) EXPECT() *MockChainedReporterMockRecorder
- func (m *MockChainedReporter) OnChildClose(arg0 cost0.Cost)
- func (m *MockChainedReporter) OnClose(arg0 cost0.Cost)
- func (m *MockChainedReporter) ReportCost(arg0 cost0.Cost)
- func (m *MockChainedReporter) ReportCurrent(arg0 cost0.Cost)
- func (m *MockChainedReporter) ReportOverLimit(arg0 bool)
- type MockChainedReporterMockRecorder
- func (mr *MockChainedReporterMockRecorder) OnChildClose(arg0 interface{}) *gomock.Call
- func (mr *MockChainedReporterMockRecorder) OnClose(arg0 interface{}) *gomock.Call
- func (mr *MockChainedReporterMockRecorder) ReportCost(arg0 interface{}) *gomock.Call
- func (mr *MockChainedReporterMockRecorder) ReportCurrent(arg0 interface{}) *gomock.Call
- func (mr *MockChainedReporterMockRecorder) ReportOverLimit(arg0 interface{}) *gomock.Call
Constants ¶
const ( // BlockLevel identifies per-block enforcers. BlockLevel = "block" // QueryLevel identifies per-query enforcers. QueryLevel = "query" // GlobalLevel identifies global enforcers. GlobalLevel = "global" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainedEnforcer ¶
type ChainedEnforcer interface { cost.Enforcer // Child creates a new ChainedEnforcer which rolls up to this one. Child(resourceName string) ChainedEnforcer // Close indicates that all resources have been returned for this // ChainedEnforcer. It should inform all parent enforcers that the // resources have been freed. Close() }
ChainedEnforcer is a cost.Enforcer implementation which tracks resource usage implements cost.Enforcer to enforce limits on multiple resources at once, linked together in a tree.
func NewChainedEnforcer ¶
func NewChainedEnforcer(rootResourceName string, models []cost.Enforcer) (ChainedEnforcer, error)
NewChainedEnforcer constructs a chainedEnforcer which creates children using the provided models. models[0] enforces this instance; models[1] enforces the first level of children, and so on.
func NoopChainedEnforcer ¶
func NoopChainedEnforcer() ChainedEnforcer
NoopChainedEnforcer returns a chainedEnforcer which enforces no limits and does no reporting.
type ChainedReporter ¶
type ChainedReporter interface { cost.EnforcerReporter // OnChildClose is called whenever a child of this reporter's chainedEnforcer is released. OnChildClose(currentCost cost.Cost) // OnClose is called whenever this reporter's chainedEnforcer is released. OnClose(currentCost cost.Cost) }
ChainedReporter is a listener for chainedEnforcer methods, which listens to Close events in addition to events used by cost.EnforcerReporter.
type MockChainedEnforcer ¶
type MockChainedEnforcer struct {
// contains filtered or unexported fields
}
MockChainedEnforcer is a mock of ChainedEnforcer interface
func NewMockChainedEnforcer ¶
func NewMockChainedEnforcer(ctrl *gomock.Controller) *MockChainedEnforcer
NewMockChainedEnforcer creates a new mock instance
func (*MockChainedEnforcer) Add ¶
func (m *MockChainedEnforcer) Add(arg0 cost0.Cost) cost0.Report
Add mocks base method
func (*MockChainedEnforcer) Child ¶
func (m *MockChainedEnforcer) Child(arg0 string) ChainedEnforcer
Child mocks base method
func (*MockChainedEnforcer) Clone ¶
func (m *MockChainedEnforcer) Clone() cost0.Enforcer
Clone mocks base method
func (*MockChainedEnforcer) EXPECT ¶
func (m *MockChainedEnforcer) EXPECT() *MockChainedEnforcerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockChainedEnforcer) Limit ¶
func (m *MockChainedEnforcer) Limit() cost0.Limit
Limit mocks base method
func (*MockChainedEnforcer) Reporter ¶
func (m *MockChainedEnforcer) Reporter() cost0.EnforcerReporter
Reporter mocks base method
type MockChainedEnforcerMockRecorder ¶
type MockChainedEnforcerMockRecorder struct {
// contains filtered or unexported fields
}
MockChainedEnforcerMockRecorder is the mock recorder for MockChainedEnforcer
func (*MockChainedEnforcerMockRecorder) Add ¶
func (mr *MockChainedEnforcerMockRecorder) Add(arg0 interface{}) *gomock.Call
Add indicates an expected call of Add
func (*MockChainedEnforcerMockRecorder) Child ¶
func (mr *MockChainedEnforcerMockRecorder) Child(arg0 interface{}) *gomock.Call
Child indicates an expected call of Child
func (*MockChainedEnforcerMockRecorder) Clone ¶
func (mr *MockChainedEnforcerMockRecorder) Clone() *gomock.Call
Clone indicates an expected call of Clone
func (*MockChainedEnforcerMockRecorder) Close ¶
func (mr *MockChainedEnforcerMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close
func (*MockChainedEnforcerMockRecorder) Limit ¶
func (mr *MockChainedEnforcerMockRecorder) Limit() *gomock.Call
Limit indicates an expected call of Limit
func (*MockChainedEnforcerMockRecorder) Reporter ¶
func (mr *MockChainedEnforcerMockRecorder) Reporter() *gomock.Call
Reporter indicates an expected call of Reporter
func (*MockChainedEnforcerMockRecorder) State ¶
func (mr *MockChainedEnforcerMockRecorder) State() *gomock.Call
State indicates an expected call of State
type MockChainedReporter ¶
type MockChainedReporter struct {
// contains filtered or unexported fields
}
MockChainedReporter is a mock of ChainedReporter interface
func NewMockChainedReporter ¶
func NewMockChainedReporter(ctrl *gomock.Controller) *MockChainedReporter
NewMockChainedReporter creates a new mock instance
func (*MockChainedReporter) EXPECT ¶
func (m *MockChainedReporter) EXPECT() *MockChainedReporterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockChainedReporter) OnChildClose ¶
func (m *MockChainedReporter) OnChildClose(arg0 cost0.Cost)
OnChildClose mocks base method
func (*MockChainedReporter) OnClose ¶
func (m *MockChainedReporter) OnClose(arg0 cost0.Cost)
OnClose mocks base method
func (*MockChainedReporter) ReportCost ¶
func (m *MockChainedReporter) ReportCost(arg0 cost0.Cost)
ReportCost mocks base method
func (*MockChainedReporter) ReportCurrent ¶
func (m *MockChainedReporter) ReportCurrent(arg0 cost0.Cost)
ReportCurrent mocks base method
func (*MockChainedReporter) ReportOverLimit ¶
func (m *MockChainedReporter) ReportOverLimit(arg0 bool)
ReportOverLimit mocks base method
type MockChainedReporterMockRecorder ¶
type MockChainedReporterMockRecorder struct {
// contains filtered or unexported fields
}
MockChainedReporterMockRecorder is the mock recorder for MockChainedReporter
func (*MockChainedReporterMockRecorder) OnChildClose ¶
func (mr *MockChainedReporterMockRecorder) OnChildClose(arg0 interface{}) *gomock.Call
OnChildClose indicates an expected call of OnChildClose
func (*MockChainedReporterMockRecorder) OnClose ¶
func (mr *MockChainedReporterMockRecorder) OnClose(arg0 interface{}) *gomock.Call
OnClose indicates an expected call of OnClose
func (*MockChainedReporterMockRecorder) ReportCost ¶
func (mr *MockChainedReporterMockRecorder) ReportCost(arg0 interface{}) *gomock.Call
ReportCost indicates an expected call of ReportCost
func (*MockChainedReporterMockRecorder) ReportCurrent ¶
func (mr *MockChainedReporterMockRecorder) ReportCurrent(arg0 interface{}) *gomock.Call
ReportCurrent indicates an expected call of ReportCurrent
func (*MockChainedReporterMockRecorder) ReportOverLimit ¶
func (mr *MockChainedReporterMockRecorder) ReportOverLimit(arg0 interface{}) *gomock.Call
ReportOverLimit indicates an expected call of ReportOverLimit