domain

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AdminRole = "admin"
)

Variables

View Source
var (
	ErrNotFound      = errors.New("not found")
	ErrNoKubeConfig  = errors.New("kubernetes configuration not provided")
	ErrNilQueryInput = errors.New("query options is nil")
	ErrNoClient      = errors.New("kubernetes client is not initialized")
)

Functions

This section is empty.

Types

type AuditLog

type AuditLog struct {
	ID        bson.ObjectID `bson:"_id,omitempty"`
	UserID    bson.ObjectID `bson:"user_id,omitempty"`
	Action    string        `bson:"action,omitempty"`
	RequestID string        `bson:"request_id,omitempty"`
	Timestamp int64         `bson:"timestamp,omitempty"`
	IP        string        `bson:"ip,omitempty"`
}

type BaseEntity

type BaseEntity struct {
	ID          bson.ObjectID `bson:"_id,omitempty"`
	CreatedTime int64         `bson:"createdTime,omitempty"`
	UpdatedTime int64         `bson:"updatedTime,omitempty"`
	DeletedTime int64         `bson:"deletedTime,omitempty"`
	CreatorID   bson.ObjectID `bson:"creatorID,omitempty"`
	UpdaterID   bson.ObjectID `bson:"updaterID,omitempty"`
}

func NewBaseEntity

func NewBaseEntity(creatorID, updaterID *bson.ObjectID) BaseEntity

type Claims

type Claims struct {
	UID                string `json:"uid"`
	NeedChangePassword bool   `json:"needChangePassword"`
	jwt.RegisteredClaims
}

Claims represents JWT token claims

func (*Claims) GetBsonObjectUID

func (c *Claims) GetBsonObjectUID() (bson.ObjectID, error)

type Container

type Container struct {
	ContainerID string
	Name        string
	Command     []string
}

type DecisionMakerAdapter

type DecisionMakerAdapter interface {
	SendSchedulingIntent(ctx context.Context, decisionMaker *DecisionMakerPod, intents []*ScheduleIntent) error
	GetIntentMerkleRoot(ctx context.Context, decisionMaker *DecisionMakerPod) (string, error)
	DeleteSchedulingIntents(ctx context.Context, decisionMaker *DecisionMakerPod, req *DeleteIntentsRequest) error
	GetPodPIDMapping(ctx context.Context, decisionMaker *DecisionMakerPod) (*PodPIDMappingResponse, error)
}

type DecisionMakerPod

type DecisionMakerPod struct {
	NodeID string
	Port   int
	Host   string
	State  NodeState
}

func (*DecisionMakerPod) String

func (d *DecisionMakerPod) String() string

type DeleteIntentsRequest added in v1.1.0

type DeleteIntentsRequest struct {
	PodIDs []string // Delete all intents for these pods
	All    bool     // If true, deletes all intents on the decision maker
}

type EncryptedPassword

type EncryptedPassword string

func (EncryptedPassword) Cmp

func (value EncryptedPassword) Cmp(plainText string) (bool, error)

func (EncryptedPassword) MarshalBSONValue

func (value EncryptedPassword) MarshalBSONValue() (typ byte, data []byte, err error)

func (EncryptedPassword) String

func (value EncryptedPassword) String() string

func (*EncryptedPassword) UnmarshalBSONValue

func (value *EncryptedPassword) UnmarshalBSONValue(typ byte, data []byte) error

type IntentState

type IntentState int8
const (
	IntentStateUnknown IntentState = iota
	IntentStateInitialized
	IntentStateSent
)

type K8SAdapter

type K8SAdapter interface {
	QueryPods(ctx context.Context, opt *QueryPodsOptions) ([]*Pod, error)
	QueryDecisionMakerPods(ctx context.Context, opt *QueryDecisionMakerPodsOptions) ([]*DecisionMakerPod, error)
	ListNodes(ctx context.Context) ([]*Node, error)
}

type LabelSelector

type LabelSelector struct {
	Key   string `bson:"key,omitempty"`
	Value string `bson:"value,omitempty"`
}

type MockDecisionMakerAdapter

type MockDecisionMakerAdapter struct {
	mock.Mock
}

MockDecisionMakerAdapter is an autogenerated mock type for the DecisionMakerAdapter type

func NewMockDecisionMakerAdapter

func NewMockDecisionMakerAdapter(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockDecisionMakerAdapter

NewMockDecisionMakerAdapter creates a new instance of MockDecisionMakerAdapter. 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 (*MockDecisionMakerAdapter) DeleteSchedulingIntents added in v1.1.0

func (_mock *MockDecisionMakerAdapter) DeleteSchedulingIntents(ctx context.Context, decisionMaker *DecisionMakerPod, req *DeleteIntentsRequest) error

DeleteSchedulingIntents provides a mock function for the type MockDecisionMakerAdapter

func (*MockDecisionMakerAdapter) EXPECT

func (*MockDecisionMakerAdapter) GetIntentMerkleRoot added in v1.2.0

func (_mock *MockDecisionMakerAdapter) GetIntentMerkleRoot(ctx context.Context, decisionMaker *DecisionMakerPod) (string, error)

GetIntentMerkleRoot provides a mock function for the type MockDecisionMakerAdapter

func (*MockDecisionMakerAdapter) GetPodPIDMapping added in v1.2.0

func (_mock *MockDecisionMakerAdapter) GetPodPIDMapping(ctx context.Context, decisionMaker *DecisionMakerPod) (*PodPIDMappingResponse, error)

GetPodPIDMapping provides a mock function for the type MockDecisionMakerAdapter

func (*MockDecisionMakerAdapter) SendSchedulingIntent

func (_mock *MockDecisionMakerAdapter) SendSchedulingIntent(ctx context.Context, decisionMaker *DecisionMakerPod, intents []*ScheduleIntent) error

SendSchedulingIntent provides a mock function for the type MockDecisionMakerAdapter

type MockDecisionMakerAdapter_DeleteSchedulingIntents_Call added in v1.1.0

type MockDecisionMakerAdapter_DeleteSchedulingIntents_Call struct {
	*mock.Call
}

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

func (*MockDecisionMakerAdapter_DeleteSchedulingIntents_Call) Return added in v1.1.0

func (*MockDecisionMakerAdapter_DeleteSchedulingIntents_Call) Run added in v1.1.0

func (*MockDecisionMakerAdapter_DeleteSchedulingIntents_Call) RunAndReturn added in v1.1.0

type MockDecisionMakerAdapter_Expecter

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

func (*MockDecisionMakerAdapter_Expecter) DeleteSchedulingIntents added in v1.1.0

func (_e *MockDecisionMakerAdapter_Expecter) DeleteSchedulingIntents(ctx interface{}, decisionMaker interface{}, req interface{}) *MockDecisionMakerAdapter_DeleteSchedulingIntents_Call

DeleteSchedulingIntents is a helper method to define mock.On call

  • ctx context.Context
  • decisionMaker *DecisionMakerPod
  • req *DeleteIntentsRequest

func (*MockDecisionMakerAdapter_Expecter) GetIntentMerkleRoot added in v1.2.0

func (_e *MockDecisionMakerAdapter_Expecter) GetIntentMerkleRoot(ctx interface{}, decisionMaker interface{}) *MockDecisionMakerAdapter_GetIntentMerkleRoot_Call

GetIntentMerkleRoot is a helper method to define mock.On call

  • ctx context.Context
  • decisionMaker *DecisionMakerPod

func (*MockDecisionMakerAdapter_Expecter) GetPodPIDMapping added in v1.2.0

func (_e *MockDecisionMakerAdapter_Expecter) GetPodPIDMapping(ctx interface{}, decisionMaker interface{}) *MockDecisionMakerAdapter_GetPodPIDMapping_Call

GetPodPIDMapping is a helper method to define mock.On call

  • ctx context.Context
  • decisionMaker *DecisionMakerPod

func (*MockDecisionMakerAdapter_Expecter) SendSchedulingIntent

func (_e *MockDecisionMakerAdapter_Expecter) SendSchedulingIntent(ctx interface{}, decisionMaker interface{}, intents interface{}) *MockDecisionMakerAdapter_SendSchedulingIntent_Call

SendSchedulingIntent is a helper method to define mock.On call

  • ctx context.Context
  • decisionMaker *DecisionMakerPod
  • intents []*ScheduleIntent

type MockDecisionMakerAdapter_GetIntentMerkleRoot_Call added in v1.2.0

type MockDecisionMakerAdapter_GetIntentMerkleRoot_Call struct {
	*mock.Call
}

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

func (*MockDecisionMakerAdapter_GetIntentMerkleRoot_Call) Return added in v1.2.0

func (*MockDecisionMakerAdapter_GetIntentMerkleRoot_Call) Run added in v1.2.0

func (*MockDecisionMakerAdapter_GetIntentMerkleRoot_Call) RunAndReturn added in v1.2.0

type MockDecisionMakerAdapter_GetPodPIDMapping_Call added in v1.2.0

type MockDecisionMakerAdapter_GetPodPIDMapping_Call struct {
	*mock.Call
}

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

func (*MockDecisionMakerAdapter_GetPodPIDMapping_Call) Return added in v1.2.0

func (*MockDecisionMakerAdapter_GetPodPIDMapping_Call) Run added in v1.2.0

func (*MockDecisionMakerAdapter_GetPodPIDMapping_Call) RunAndReturn added in v1.2.0

type MockDecisionMakerAdapter_SendSchedulingIntent_Call

type MockDecisionMakerAdapter_SendSchedulingIntent_Call struct {
	*mock.Call
}

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

func (*MockDecisionMakerAdapter_SendSchedulingIntent_Call) Return

func (*MockDecisionMakerAdapter_SendSchedulingIntent_Call) Run

func (*MockDecisionMakerAdapter_SendSchedulingIntent_Call) RunAndReturn

type MockK8SAdapter

type MockK8SAdapter struct {
	mock.Mock
}

MockK8SAdapter is an autogenerated mock type for the K8SAdapter type

func NewMockK8SAdapter

func NewMockK8SAdapter(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockK8SAdapter

NewMockK8SAdapter creates a new instance of MockK8SAdapter. 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 (*MockK8SAdapter) EXPECT

func (*MockK8SAdapter) ListNodes added in v1.2.0

func (_mock *MockK8SAdapter) ListNodes(ctx context.Context) ([]*Node, error)

ListNodes provides a mock function for the type MockK8SAdapter

func (*MockK8SAdapter) QueryDecisionMakerPods

func (_mock *MockK8SAdapter) QueryDecisionMakerPods(ctx context.Context, opt *QueryDecisionMakerPodsOptions) ([]*DecisionMakerPod, error)

QueryDecisionMakerPods provides a mock function for the type MockK8SAdapter

func (*MockK8SAdapter) QueryPods

func (_mock *MockK8SAdapter) QueryPods(ctx context.Context, opt *QueryPodsOptions) ([]*Pod, error)

QueryPods provides a mock function for the type MockK8SAdapter

type MockK8SAdapter_Expecter

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

func (*MockK8SAdapter_Expecter) ListNodes added in v1.2.0

func (_e *MockK8SAdapter_Expecter) ListNodes(ctx interface{}) *MockK8SAdapter_ListNodes_Call

ListNodes is a helper method to define mock.On call

  • ctx context.Context

func (*MockK8SAdapter_Expecter) QueryDecisionMakerPods

func (_e *MockK8SAdapter_Expecter) QueryDecisionMakerPods(ctx interface{}, opt interface{}) *MockK8SAdapter_QueryDecisionMakerPods_Call

QueryDecisionMakerPods is a helper method to define mock.On call

  • ctx context.Context
  • opt *QueryDecisionMakerPodsOptions

func (*MockK8SAdapter_Expecter) QueryPods

func (_e *MockK8SAdapter_Expecter) QueryPods(ctx interface{}, opt interface{}) *MockK8SAdapter_QueryPods_Call

QueryPods is a helper method to define mock.On call

  • ctx context.Context
  • opt *QueryPodsOptions

type MockK8SAdapter_ListNodes_Call added in v1.2.0

type MockK8SAdapter_ListNodes_Call struct {
	*mock.Call
}

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

func (*MockK8SAdapter_ListNodes_Call) Return added in v1.2.0

func (*MockK8SAdapter_ListNodes_Call) Run added in v1.2.0

func (*MockK8SAdapter_ListNodes_Call) RunAndReturn added in v1.2.0

type MockK8SAdapter_QueryDecisionMakerPods_Call

type MockK8SAdapter_QueryDecisionMakerPods_Call struct {
	*mock.Call
}

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

func (*MockK8SAdapter_QueryDecisionMakerPods_Call) Return

func (*MockK8SAdapter_QueryDecisionMakerPods_Call) Run

func (*MockK8SAdapter_QueryDecisionMakerPods_Call) RunAndReturn

type MockK8SAdapter_QueryPods_Call

type MockK8SAdapter_QueryPods_Call struct {
	*mock.Call
}

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

func (*MockK8SAdapter_QueryPods_Call) Return

func (*MockK8SAdapter_QueryPods_Call) Run

func (*MockK8SAdapter_QueryPods_Call) RunAndReturn

type MockRepository

type MockRepository struct {
	mock.Mock
}

MockRepository is an autogenerated mock type for the Repository type

func NewMockRepository

func NewMockRepository(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockRepository

NewMockRepository creates a new instance of MockRepository. 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 (*MockRepository) BatchUpdateIntentsState

func (_mock *MockRepository) BatchUpdateIntentsState(ctx context.Context, intentIDs []bson.ObjectID, newState IntentState) error

BatchUpdateIntentsState provides a mock function for the type MockRepository

func (*MockRepository) CreateAuditLog

func (_mock *MockRepository) CreateAuditLog(ctx context.Context, log *AuditLog) error

CreateAuditLog provides a mock function for the type MockRepository

func (*MockRepository) CreatePermission

func (_mock *MockRepository) CreatePermission(ctx context.Context, permission *Permission) error

CreatePermission provides a mock function for the type MockRepository

func (*MockRepository) CreateRole

func (_mock *MockRepository) CreateRole(ctx context.Context, role *Role) error

CreateRole provides a mock function for the type MockRepository

func (*MockRepository) CreateUser

func (_mock *MockRepository) CreateUser(ctx context.Context, user *User) error

CreateUser provides a mock function for the type MockRepository

func (*MockRepository) DeleteIntents added in v1.2.0

func (_mock *MockRepository) DeleteIntents(ctx context.Context, intentIDs []bson.ObjectID) error

DeleteIntents provides a mock function for the type MockRepository

func (*MockRepository) DeleteIntentsByStrategyID added in v1.2.0

func (_mock *MockRepository) DeleteIntentsByStrategyID(ctx context.Context, strategyID bson.ObjectID) error

DeleteIntentsByStrategyID provides a mock function for the type MockRepository

func (*MockRepository) DeleteStrategy added in v1.2.0

func (_mock *MockRepository) DeleteStrategy(ctx context.Context, strategyID bson.ObjectID) error

DeleteStrategy provides a mock function for the type MockRepository

func (*MockRepository) EXPECT

func (*MockRepository) InsertIntents added in v1.2.1

func (_mock *MockRepository) InsertIntents(ctx context.Context, intents []*ScheduleIntent) error

InsertIntents provides a mock function for the type MockRepository

func (*MockRepository) InsertStrategyAndIntents

func (_mock *MockRepository) InsertStrategyAndIntents(ctx context.Context, strategy *ScheduleStrategy, intents []*ScheduleIntent) error

InsertStrategyAndIntents provides a mock function for the type MockRepository

func (*MockRepository) QueryAuditLogs

func (_mock *MockRepository) QueryAuditLogs(ctx context.Context, opt *QueryAuditLogOptions) error

QueryAuditLogs provides a mock function for the type MockRepository

func (*MockRepository) QueryIntents

func (_mock *MockRepository) QueryIntents(ctx context.Context, opt *QueryIntentOptions) error

QueryIntents provides a mock function for the type MockRepository

func (*MockRepository) QueryPermissions

func (_mock *MockRepository) QueryPermissions(ctx context.Context, opt *QueryPermissionOptions) error

QueryPermissions provides a mock function for the type MockRepository

func (*MockRepository) QueryRoles

func (_mock *MockRepository) QueryRoles(ctx context.Context, opt *QueryRoleOptions) error

QueryRoles provides a mock function for the type MockRepository

func (*MockRepository) QueryStrategies

func (_mock *MockRepository) QueryStrategies(ctx context.Context, opt *QueryStrategyOptions) error

QueryStrategies provides a mock function for the type MockRepository

func (*MockRepository) QueryUsers

func (_mock *MockRepository) QueryUsers(ctx context.Context, opt *QueryUserOptions) error

QueryUsers provides a mock function for the type MockRepository

func (*MockRepository) UpdatePermission

func (_mock *MockRepository) UpdatePermission(ctx context.Context, permission *Permission) error

UpdatePermission provides a mock function for the type MockRepository

func (*MockRepository) UpdateRole

func (_mock *MockRepository) UpdateRole(ctx context.Context, role *Role) error

UpdateRole provides a mock function for the type MockRepository

func (*MockRepository) UpdateUser

func (_mock *MockRepository) UpdateUser(ctx context.Context, user *User) error

UpdateUser provides a mock function for the type MockRepository

type MockRepository_BatchUpdateIntentsState_Call

type MockRepository_BatchUpdateIntentsState_Call struct {
	*mock.Call
}

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

func (*MockRepository_BatchUpdateIntentsState_Call) Return

func (*MockRepository_BatchUpdateIntentsState_Call) Run

func (*MockRepository_BatchUpdateIntentsState_Call) RunAndReturn

type MockRepository_CreateAuditLog_Call

type MockRepository_CreateAuditLog_Call struct {
	*mock.Call
}

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

func (*MockRepository_CreateAuditLog_Call) Return

func (*MockRepository_CreateAuditLog_Call) Run

func (*MockRepository_CreateAuditLog_Call) RunAndReturn

type MockRepository_CreatePermission_Call

type MockRepository_CreatePermission_Call struct {
	*mock.Call
}

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

func (*MockRepository_CreatePermission_Call) Return

func (*MockRepository_CreatePermission_Call) Run

func (*MockRepository_CreatePermission_Call) RunAndReturn

type MockRepository_CreateRole_Call

type MockRepository_CreateRole_Call struct {
	*mock.Call
}

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

func (*MockRepository_CreateRole_Call) Return

func (*MockRepository_CreateRole_Call) Run

func (*MockRepository_CreateRole_Call) RunAndReturn

type MockRepository_CreateUser_Call

type MockRepository_CreateUser_Call struct {
	*mock.Call
}

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

func (*MockRepository_CreateUser_Call) Return

func (*MockRepository_CreateUser_Call) Run

func (*MockRepository_CreateUser_Call) RunAndReturn

type MockRepository_DeleteIntentsByStrategyID_Call added in v1.2.0

type MockRepository_DeleteIntentsByStrategyID_Call struct {
	*mock.Call
}

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

func (*MockRepository_DeleteIntentsByStrategyID_Call) Return added in v1.2.0

func (*MockRepository_DeleteIntentsByStrategyID_Call) Run added in v1.2.0

func (*MockRepository_DeleteIntentsByStrategyID_Call) RunAndReturn added in v1.2.0

type MockRepository_DeleteIntents_Call added in v1.2.0

type MockRepository_DeleteIntents_Call struct {
	*mock.Call
}

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

func (*MockRepository_DeleteIntents_Call) Return added in v1.2.0

func (*MockRepository_DeleteIntents_Call) Run added in v1.2.0

func (*MockRepository_DeleteIntents_Call) RunAndReturn added in v1.2.0

type MockRepository_DeleteStrategy_Call added in v1.2.0

type MockRepository_DeleteStrategy_Call struct {
	*mock.Call
}

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

func (*MockRepository_DeleteStrategy_Call) Return added in v1.2.0

func (*MockRepository_DeleteStrategy_Call) Run added in v1.2.0

func (*MockRepository_DeleteStrategy_Call) RunAndReturn added in v1.2.0

type MockRepository_Expecter

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

func (*MockRepository_Expecter) BatchUpdateIntentsState

func (_e *MockRepository_Expecter) BatchUpdateIntentsState(ctx interface{}, intentIDs interface{}, newState interface{}) *MockRepository_BatchUpdateIntentsState_Call

BatchUpdateIntentsState is a helper method to define mock.On call

  • ctx context.Context
  • intentIDs []bson.ObjectID
  • newState IntentState

func (*MockRepository_Expecter) CreateAuditLog

func (_e *MockRepository_Expecter) CreateAuditLog(ctx interface{}, log interface{}) *MockRepository_CreateAuditLog_Call

CreateAuditLog is a helper method to define mock.On call

  • ctx context.Context
  • log *AuditLog

func (*MockRepository_Expecter) CreatePermission

func (_e *MockRepository_Expecter) CreatePermission(ctx interface{}, permission interface{}) *MockRepository_CreatePermission_Call

CreatePermission is a helper method to define mock.On call

  • ctx context.Context
  • permission *Permission

func (*MockRepository_Expecter) CreateRole

func (_e *MockRepository_Expecter) CreateRole(ctx interface{}, role interface{}) *MockRepository_CreateRole_Call

CreateRole is a helper method to define mock.On call

  • ctx context.Context
  • role *Role

func (*MockRepository_Expecter) CreateUser

func (_e *MockRepository_Expecter) CreateUser(ctx interface{}, user interface{}) *MockRepository_CreateUser_Call

CreateUser is a helper method to define mock.On call

  • ctx context.Context
  • user *User

func (*MockRepository_Expecter) DeleteIntents added in v1.2.0

func (_e *MockRepository_Expecter) DeleteIntents(ctx interface{}, intentIDs interface{}) *MockRepository_DeleteIntents_Call

DeleteIntents is a helper method to define mock.On call

  • ctx context.Context
  • intentIDs []bson.ObjectID

func (*MockRepository_Expecter) DeleteIntentsByStrategyID added in v1.2.0

func (_e *MockRepository_Expecter) DeleteIntentsByStrategyID(ctx interface{}, strategyID interface{}) *MockRepository_DeleteIntentsByStrategyID_Call

DeleteIntentsByStrategyID is a helper method to define mock.On call

  • ctx context.Context
  • strategyID bson.ObjectID

func (*MockRepository_Expecter) DeleteStrategy added in v1.2.0

func (_e *MockRepository_Expecter) DeleteStrategy(ctx interface{}, strategyID interface{}) *MockRepository_DeleteStrategy_Call

DeleteStrategy is a helper method to define mock.On call

  • ctx context.Context
  • strategyID bson.ObjectID

func (*MockRepository_Expecter) InsertIntents added in v1.2.1

func (_e *MockRepository_Expecter) InsertIntents(ctx interface{}, intents interface{}) *MockRepository_InsertIntents_Call

InsertIntents is a helper method to define mock.On call

  • ctx context.Context
  • intents []*ScheduleIntent

func (*MockRepository_Expecter) InsertStrategyAndIntents

func (_e *MockRepository_Expecter) InsertStrategyAndIntents(ctx interface{}, strategy interface{}, intents interface{}) *MockRepository_InsertStrategyAndIntents_Call

InsertStrategyAndIntents is a helper method to define mock.On call

  • ctx context.Context
  • strategy *ScheduleStrategy
  • intents []*ScheduleIntent

func (*MockRepository_Expecter) QueryAuditLogs

func (_e *MockRepository_Expecter) QueryAuditLogs(ctx interface{}, opt interface{}) *MockRepository_QueryAuditLogs_Call

QueryAuditLogs is a helper method to define mock.On call

  • ctx context.Context
  • opt *QueryAuditLogOptions

func (*MockRepository_Expecter) QueryIntents

func (_e *MockRepository_Expecter) QueryIntents(ctx interface{}, opt interface{}) *MockRepository_QueryIntents_Call

QueryIntents is a helper method to define mock.On call

  • ctx context.Context
  • opt *QueryIntentOptions

func (*MockRepository_Expecter) QueryPermissions

func (_e *MockRepository_Expecter) QueryPermissions(ctx interface{}, opt interface{}) *MockRepository_QueryPermissions_Call

QueryPermissions is a helper method to define mock.On call

  • ctx context.Context
  • opt *QueryPermissionOptions

func (*MockRepository_Expecter) QueryRoles

func (_e *MockRepository_Expecter) QueryRoles(ctx interface{}, opt interface{}) *MockRepository_QueryRoles_Call

QueryRoles is a helper method to define mock.On call

  • ctx context.Context
  • opt *QueryRoleOptions

func (*MockRepository_Expecter) QueryStrategies

func (_e *MockRepository_Expecter) QueryStrategies(ctx interface{}, opt interface{}) *MockRepository_QueryStrategies_Call

QueryStrategies is a helper method to define mock.On call

  • ctx context.Context
  • opt *QueryStrategyOptions

func (*MockRepository_Expecter) QueryUsers

func (_e *MockRepository_Expecter) QueryUsers(ctx interface{}, opt interface{}) *MockRepository_QueryUsers_Call

QueryUsers is a helper method to define mock.On call

  • ctx context.Context
  • opt *QueryUserOptions

func (*MockRepository_Expecter) UpdatePermission

func (_e *MockRepository_Expecter) UpdatePermission(ctx interface{}, permission interface{}) *MockRepository_UpdatePermission_Call

UpdatePermission is a helper method to define mock.On call

  • ctx context.Context
  • permission *Permission

func (*MockRepository_Expecter) UpdateRole

func (_e *MockRepository_Expecter) UpdateRole(ctx interface{}, role interface{}) *MockRepository_UpdateRole_Call

UpdateRole is a helper method to define mock.On call

  • ctx context.Context
  • role *Role

func (*MockRepository_Expecter) UpdateUser

func (_e *MockRepository_Expecter) UpdateUser(ctx interface{}, user interface{}) *MockRepository_UpdateUser_Call

UpdateUser is a helper method to define mock.On call

  • ctx context.Context
  • user *User

type MockRepository_InsertIntents_Call added in v1.2.1

type MockRepository_InsertIntents_Call struct {
	*mock.Call
}

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

func (*MockRepository_InsertIntents_Call) Return added in v1.2.1

func (*MockRepository_InsertIntents_Call) Run added in v1.2.1

func (*MockRepository_InsertIntents_Call) RunAndReturn added in v1.2.1

type MockRepository_InsertStrategyAndIntents_Call

type MockRepository_InsertStrategyAndIntents_Call struct {
	*mock.Call
}

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

func (*MockRepository_InsertStrategyAndIntents_Call) Return

func (*MockRepository_InsertStrategyAndIntents_Call) Run

func (*MockRepository_InsertStrategyAndIntents_Call) RunAndReturn

type MockRepository_QueryAuditLogs_Call

type MockRepository_QueryAuditLogs_Call struct {
	*mock.Call
}

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

func (*MockRepository_QueryAuditLogs_Call) Return

func (*MockRepository_QueryAuditLogs_Call) Run

func (*MockRepository_QueryAuditLogs_Call) RunAndReturn

type MockRepository_QueryIntents_Call

type MockRepository_QueryIntents_Call struct {
	*mock.Call
}

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

func (*MockRepository_QueryIntents_Call) Return

func (*MockRepository_QueryIntents_Call) Run

func (*MockRepository_QueryIntents_Call) RunAndReturn

type MockRepository_QueryPermissions_Call

type MockRepository_QueryPermissions_Call struct {
	*mock.Call
}

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

func (*MockRepository_QueryPermissions_Call) Return

func (*MockRepository_QueryPermissions_Call) Run

func (*MockRepository_QueryPermissions_Call) RunAndReturn

type MockRepository_QueryRoles_Call

type MockRepository_QueryRoles_Call struct {
	*mock.Call
}

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

func (*MockRepository_QueryRoles_Call) Return

func (*MockRepository_QueryRoles_Call) Run

func (*MockRepository_QueryRoles_Call) RunAndReturn

type MockRepository_QueryStrategies_Call

type MockRepository_QueryStrategies_Call struct {
	*mock.Call
}

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

func (*MockRepository_QueryStrategies_Call) Return

func (*MockRepository_QueryStrategies_Call) Run

func (*MockRepository_QueryStrategies_Call) RunAndReturn

type MockRepository_QueryUsers_Call

type MockRepository_QueryUsers_Call struct {
	*mock.Call
}

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

func (*MockRepository_QueryUsers_Call) Return

func (*MockRepository_QueryUsers_Call) Run

func (*MockRepository_QueryUsers_Call) RunAndReturn

type MockRepository_UpdatePermission_Call

type MockRepository_UpdatePermission_Call struct {
	*mock.Call
}

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

func (*MockRepository_UpdatePermission_Call) Return

func (*MockRepository_UpdatePermission_Call) Run

func (*MockRepository_UpdatePermission_Call) RunAndReturn

type MockRepository_UpdateRole_Call

type MockRepository_UpdateRole_Call struct {
	*mock.Call
}

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

func (*MockRepository_UpdateRole_Call) Return

func (*MockRepository_UpdateRole_Call) Run

func (*MockRepository_UpdateRole_Call) RunAndReturn

type MockRepository_UpdateUser_Call

type MockRepository_UpdateUser_Call struct {
	*mock.Call
}

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

func (*MockRepository_UpdateUser_Call) Return

func (*MockRepository_UpdateUser_Call) Run

func (*MockRepository_UpdateUser_Call) RunAndReturn

type MockService

type MockService struct {
	mock.Mock
}

MockService is an autogenerated mock type for the Service type

func NewMockService

func NewMockService(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockService

NewMockService creates a new instance of MockService. 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 (*MockService) ChangePassword

func (_mock *MockService) ChangePassword(ctx context.Context, user *Claims, oldPassword string, newPassword string) error

ChangePassword provides a mock function for the type MockService

func (*MockService) CreateAdminUserIfNotExists

func (_mock *MockService) CreateAdminUserIfNotExists(ctx context.Context, username string, password string) error

CreateAdminUserIfNotExists provides a mock function for the type MockService

func (*MockService) CreateNewUser

func (_mock *MockService) CreateNewUser(ctx context.Context, operator *Claims, username string, password string) error

CreateNewUser provides a mock function for the type MockService

func (*MockService) CreateRole

func (_mock *MockService) CreateRole(ctx context.Context, operator *Claims, role *Role) error

CreateRole provides a mock function for the type MockService

func (*MockService) CreateScheduleStrategy

func (_mock *MockService) CreateScheduleStrategy(ctx context.Context, operator *Claims, strategy *ScheduleStrategy) error

CreateScheduleStrategy provides a mock function for the type MockService

func (*MockService) DeleteRole

func (_mock *MockService) DeleteRole(ctx context.Context, operator *Claims, roleID string) error

DeleteRole provides a mock function for the type MockService

func (*MockService) DeleteScheduleIntents added in v1.2.0

func (_mock *MockService) DeleteScheduleIntents(ctx context.Context, operator *Claims, intentIDs []string) error

DeleteScheduleIntents provides a mock function for the type MockService

func (*MockService) DeleteScheduleStrategy added in v1.2.0

func (_mock *MockService) DeleteScheduleStrategy(ctx context.Context, operator *Claims, strategyID string) error

DeleteScheduleStrategy provides a mock function for the type MockService

func (*MockService) EXPECT

func (_m *MockService) EXPECT() *MockService_Expecter

func (*MockService) GetPodPIDMapping added in v1.2.0

func (_mock *MockService) GetPodPIDMapping(ctx context.Context, nodeID string) (*PodPIDMappingResponse, error)

GetPodPIDMapping provides a mock function for the type MockService

func (*MockService) ListNodes added in v1.2.0

func (_mock *MockService) ListNodes(ctx context.Context) ([]*Node, error)

ListNodes provides a mock function for the type MockService

func (*MockService) ListScheduleIntents

func (_mock *MockService) ListScheduleIntents(ctx context.Context, filterOpts *QueryIntentOptions) error

ListScheduleIntents provides a mock function for the type MockService

func (*MockService) ListScheduleStrategies

func (_mock *MockService) ListScheduleStrategies(ctx context.Context, filterOpts *QueryStrategyOptions) error

ListScheduleStrategies provides a mock function for the type MockService

func (*MockService) Login

func (_mock *MockService) Login(ctx context.Context, email string, password string) (string, error)

Login provides a mock function for the type MockService

func (*MockService) QueryPermissions

func (_mock *MockService) QueryPermissions(ctx context.Context, opt *QueryPermissionOptions) error

QueryPermissions provides a mock function for the type MockService

func (*MockService) QueryRoles

func (_mock *MockService) QueryRoles(ctx context.Context, opt *QueryRoleOptions) error

QueryRoles provides a mock function for the type MockService

func (*MockService) QueryUsers

func (_mock *MockService) QueryUsers(ctx context.Context, opt *QueryUserOptions) error

QueryUsers provides a mock function for the type MockService

func (*MockService) ReconcileIntents added in v1.2.1

func (_mock *MockService) ReconcileIntents(ctx context.Context) error

ReconcileIntents provides a mock function for the type MockService

func (*MockService) ResetPassword

func (_mock *MockService) ResetPassword(ctx context.Context, operator *Claims, id string, newPassword string) error

ResetPassword provides a mock function for the type MockService

func (*MockService) UpdateRole

func (_mock *MockService) UpdateRole(ctx context.Context, operator *Claims, roleID string, opt UpdateRoleOptions) error

UpdateRole provides a mock function for the type MockService

func (*MockService) UpdateUserPermissions

func (_mock *MockService) UpdateUserPermissions(ctx context.Context, operator *Claims, id string, opt UpdateUserPermissionsOptions) error

UpdateUserPermissions provides a mock function for the type MockService

func (*MockService) VerifyJWTToken

func (_mock *MockService) VerifyJWTToken(ctx context.Context, tokenString string, permissionKey PermissionKey) (Claims, RolePolicy, error)

VerifyJWTToken provides a mock function for the type MockService

type MockService_ChangePassword_Call

type MockService_ChangePassword_Call struct {
	*mock.Call
}

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

func (*MockService_ChangePassword_Call) Return

func (*MockService_ChangePassword_Call) Run

func (_c *MockService_ChangePassword_Call) Run(run func(ctx context.Context, user *Claims, oldPassword string, newPassword string)) *MockService_ChangePassword_Call

func (*MockService_ChangePassword_Call) RunAndReturn

func (_c *MockService_ChangePassword_Call) RunAndReturn(run func(ctx context.Context, user *Claims, oldPassword string, newPassword string) error) *MockService_ChangePassword_Call

type MockService_CreateAdminUserIfNotExists_Call

type MockService_CreateAdminUserIfNotExists_Call struct {
	*mock.Call
}

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

func (*MockService_CreateAdminUserIfNotExists_Call) Return

func (*MockService_CreateAdminUserIfNotExists_Call) Run

func (*MockService_CreateAdminUserIfNotExists_Call) RunAndReturn

type MockService_CreateNewUser_Call

type MockService_CreateNewUser_Call struct {
	*mock.Call
}

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

func (*MockService_CreateNewUser_Call) Return

func (*MockService_CreateNewUser_Call) Run

func (_c *MockService_CreateNewUser_Call) Run(run func(ctx context.Context, operator *Claims, username string, password string)) *MockService_CreateNewUser_Call

func (*MockService_CreateNewUser_Call) RunAndReturn

func (_c *MockService_CreateNewUser_Call) RunAndReturn(run func(ctx context.Context, operator *Claims, username string, password string) error) *MockService_CreateNewUser_Call

type MockService_CreateRole_Call

type MockService_CreateRole_Call struct {
	*mock.Call
}

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

func (*MockService_CreateRole_Call) Return

func (*MockService_CreateRole_Call) Run

func (_c *MockService_CreateRole_Call) Run(run func(ctx context.Context, operator *Claims, role *Role)) *MockService_CreateRole_Call

func (*MockService_CreateRole_Call) RunAndReturn

func (_c *MockService_CreateRole_Call) RunAndReturn(run func(ctx context.Context, operator *Claims, role *Role) error) *MockService_CreateRole_Call

type MockService_CreateScheduleStrategy_Call

type MockService_CreateScheduleStrategy_Call struct {
	*mock.Call
}

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

func (*MockService_CreateScheduleStrategy_Call) Return

func (*MockService_CreateScheduleStrategy_Call) Run

func (*MockService_CreateScheduleStrategy_Call) RunAndReturn

type MockService_DeleteRole_Call

type MockService_DeleteRole_Call struct {
	*mock.Call
}

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

func (*MockService_DeleteRole_Call) Return

func (*MockService_DeleteRole_Call) Run

func (_c *MockService_DeleteRole_Call) Run(run func(ctx context.Context, operator *Claims, roleID string)) *MockService_DeleteRole_Call

func (*MockService_DeleteRole_Call) RunAndReturn

func (_c *MockService_DeleteRole_Call) RunAndReturn(run func(ctx context.Context, operator *Claims, roleID string) error) *MockService_DeleteRole_Call

type MockService_DeleteScheduleIntents_Call added in v1.2.0

type MockService_DeleteScheduleIntents_Call struct {
	*mock.Call
}

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

func (*MockService_DeleteScheduleIntents_Call) Return added in v1.2.0

func (*MockService_DeleteScheduleIntents_Call) Run added in v1.2.0

func (*MockService_DeleteScheduleIntents_Call) RunAndReturn added in v1.2.0

func (_c *MockService_DeleteScheduleIntents_Call) RunAndReturn(run func(ctx context.Context, operator *Claims, intentIDs []string) error) *MockService_DeleteScheduleIntents_Call

type MockService_DeleteScheduleStrategy_Call added in v1.2.0

type MockService_DeleteScheduleStrategy_Call struct {
	*mock.Call
}

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

func (*MockService_DeleteScheduleStrategy_Call) Return added in v1.2.0

func (*MockService_DeleteScheduleStrategy_Call) Run added in v1.2.0

func (*MockService_DeleteScheduleStrategy_Call) RunAndReturn added in v1.2.0

type MockService_Expecter

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

func (*MockService_Expecter) ChangePassword

func (_e *MockService_Expecter) ChangePassword(ctx interface{}, user interface{}, oldPassword interface{}, newPassword interface{}) *MockService_ChangePassword_Call

ChangePassword is a helper method to define mock.On call

  • ctx context.Context
  • user *Claims
  • oldPassword string
  • newPassword string

func (*MockService_Expecter) CreateAdminUserIfNotExists

func (_e *MockService_Expecter) CreateAdminUserIfNotExists(ctx interface{}, username interface{}, password interface{}) *MockService_CreateAdminUserIfNotExists_Call

CreateAdminUserIfNotExists is a helper method to define mock.On call

  • ctx context.Context
  • username string
  • password string

func (*MockService_Expecter) CreateNewUser

func (_e *MockService_Expecter) CreateNewUser(ctx interface{}, operator interface{}, username interface{}, password interface{}) *MockService_CreateNewUser_Call

CreateNewUser is a helper method to define mock.On call

  • ctx context.Context
  • operator *Claims
  • username string
  • password string

func (*MockService_Expecter) CreateRole

func (_e *MockService_Expecter) CreateRole(ctx interface{}, operator interface{}, role interface{}) *MockService_CreateRole_Call

CreateRole is a helper method to define mock.On call

  • ctx context.Context
  • operator *Claims
  • role *Role

func (*MockService_Expecter) CreateScheduleStrategy

func (_e *MockService_Expecter) CreateScheduleStrategy(ctx interface{}, operator interface{}, strategy interface{}) *MockService_CreateScheduleStrategy_Call

CreateScheduleStrategy is a helper method to define mock.On call

  • ctx context.Context
  • operator *Claims
  • strategy *ScheduleStrategy

func (*MockService_Expecter) DeleteRole

func (_e *MockService_Expecter) DeleteRole(ctx interface{}, operator interface{}, roleID interface{}) *MockService_DeleteRole_Call

DeleteRole is a helper method to define mock.On call

  • ctx context.Context
  • operator *Claims
  • roleID string

func (*MockService_Expecter) DeleteScheduleIntents added in v1.2.0

func (_e *MockService_Expecter) DeleteScheduleIntents(ctx interface{}, operator interface{}, intentIDs interface{}) *MockService_DeleteScheduleIntents_Call

DeleteScheduleIntents is a helper method to define mock.On call

  • ctx context.Context
  • operator *Claims
  • intentIDs []string

func (*MockService_Expecter) DeleteScheduleStrategy added in v1.2.0

func (_e *MockService_Expecter) DeleteScheduleStrategy(ctx interface{}, operator interface{}, strategyID interface{}) *MockService_DeleteScheduleStrategy_Call

DeleteScheduleStrategy is a helper method to define mock.On call

  • ctx context.Context
  • operator *Claims
  • strategyID string

func (*MockService_Expecter) GetPodPIDMapping added in v1.2.0

func (_e *MockService_Expecter) GetPodPIDMapping(ctx interface{}, nodeID interface{}) *MockService_GetPodPIDMapping_Call

GetPodPIDMapping is a helper method to define mock.On call

  • ctx context.Context
  • nodeID string

func (*MockService_Expecter) ListNodes added in v1.2.0

func (_e *MockService_Expecter) ListNodes(ctx interface{}) *MockService_ListNodes_Call

ListNodes is a helper method to define mock.On call

  • ctx context.Context

func (*MockService_Expecter) ListScheduleIntents

func (_e *MockService_Expecter) ListScheduleIntents(ctx interface{}, filterOpts interface{}) *MockService_ListScheduleIntents_Call

ListScheduleIntents is a helper method to define mock.On call

  • ctx context.Context
  • filterOpts *QueryIntentOptions

func (*MockService_Expecter) ListScheduleStrategies

func (_e *MockService_Expecter) ListScheduleStrategies(ctx interface{}, filterOpts interface{}) *MockService_ListScheduleStrategies_Call

ListScheduleStrategies is a helper method to define mock.On call

  • ctx context.Context
  • filterOpts *QueryStrategyOptions

func (*MockService_Expecter) Login

func (_e *MockService_Expecter) Login(ctx interface{}, email interface{}, password interface{}) *MockService_Login_Call

Login is a helper method to define mock.On call

  • ctx context.Context
  • email string
  • password string

func (*MockService_Expecter) QueryPermissions

func (_e *MockService_Expecter) QueryPermissions(ctx interface{}, opt interface{}) *MockService_QueryPermissions_Call

QueryPermissions is a helper method to define mock.On call

  • ctx context.Context
  • opt *QueryPermissionOptions

func (*MockService_Expecter) QueryRoles

func (_e *MockService_Expecter) QueryRoles(ctx interface{}, opt interface{}) *MockService_QueryRoles_Call

QueryRoles is a helper method to define mock.On call

  • ctx context.Context
  • opt *QueryRoleOptions

func (*MockService_Expecter) QueryUsers

func (_e *MockService_Expecter) QueryUsers(ctx interface{}, opt interface{}) *MockService_QueryUsers_Call

QueryUsers is a helper method to define mock.On call

  • ctx context.Context
  • opt *QueryUserOptions

func (*MockService_Expecter) ReconcileIntents added in v1.2.1

func (_e *MockService_Expecter) ReconcileIntents(ctx interface{}) *MockService_ReconcileIntents_Call

ReconcileIntents is a helper method to define mock.On call

  • ctx context.Context

func (*MockService_Expecter) ResetPassword

func (_e *MockService_Expecter) ResetPassword(ctx interface{}, operator interface{}, id interface{}, newPassword interface{}) *MockService_ResetPassword_Call

ResetPassword is a helper method to define mock.On call

  • ctx context.Context
  • operator *Claims
  • id string
  • newPassword string

func (*MockService_Expecter) UpdateRole

func (_e *MockService_Expecter) UpdateRole(ctx interface{}, operator interface{}, roleID interface{}, opt interface{}) *MockService_UpdateRole_Call

UpdateRole is a helper method to define mock.On call

  • ctx context.Context
  • operator *Claims
  • roleID string
  • opt UpdateRoleOptions

func (*MockService_Expecter) UpdateUserPermissions

func (_e *MockService_Expecter) UpdateUserPermissions(ctx interface{}, operator interface{}, id interface{}, opt interface{}) *MockService_UpdateUserPermissions_Call

UpdateUserPermissions is a helper method to define mock.On call

  • ctx context.Context
  • operator *Claims
  • id string
  • opt UpdateUserPermissionsOptions

func (*MockService_Expecter) VerifyJWTToken

func (_e *MockService_Expecter) VerifyJWTToken(ctx interface{}, tokenString interface{}, permissionKey interface{}) *MockService_VerifyJWTToken_Call

VerifyJWTToken is a helper method to define mock.On call

  • ctx context.Context
  • tokenString string
  • permissionKey PermissionKey

type MockService_GetPodPIDMapping_Call added in v1.2.0

type MockService_GetPodPIDMapping_Call struct {
	*mock.Call
}

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

func (*MockService_GetPodPIDMapping_Call) Return added in v1.2.0

func (*MockService_GetPodPIDMapping_Call) Run added in v1.2.0

func (*MockService_GetPodPIDMapping_Call) RunAndReturn added in v1.2.0

type MockService_ListNodes_Call added in v1.2.0

type MockService_ListNodes_Call struct {
	*mock.Call
}

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

func (*MockService_ListNodes_Call) Return added in v1.2.0

func (*MockService_ListNodes_Call) Run added in v1.2.0

func (*MockService_ListNodes_Call) RunAndReturn added in v1.2.0

func (_c *MockService_ListNodes_Call) RunAndReturn(run func(ctx context.Context) ([]*Node, error)) *MockService_ListNodes_Call

type MockService_ListScheduleIntents_Call

type MockService_ListScheduleIntents_Call struct {
	*mock.Call
}

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

func (*MockService_ListScheduleIntents_Call) Return

func (*MockService_ListScheduleIntents_Call) Run

func (*MockService_ListScheduleIntents_Call) RunAndReturn

type MockService_ListScheduleStrategies_Call

type MockService_ListScheduleStrategies_Call struct {
	*mock.Call
}

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

func (*MockService_ListScheduleStrategies_Call) Return

func (*MockService_ListScheduleStrategies_Call) Run

func (*MockService_ListScheduleStrategies_Call) RunAndReturn

type MockService_Login_Call

type MockService_Login_Call struct {
	*mock.Call
}

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

func (*MockService_Login_Call) Return

func (*MockService_Login_Call) Run

func (_c *MockService_Login_Call) Run(run func(ctx context.Context, email string, password string)) *MockService_Login_Call

func (*MockService_Login_Call) RunAndReturn

func (_c *MockService_Login_Call) RunAndReturn(run func(ctx context.Context, email string, password string) (string, error)) *MockService_Login_Call

type MockService_QueryPermissions_Call

type MockService_QueryPermissions_Call struct {
	*mock.Call
}

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

func (*MockService_QueryPermissions_Call) Return

func (*MockService_QueryPermissions_Call) Run

func (*MockService_QueryPermissions_Call) RunAndReturn

type MockService_QueryRoles_Call

type MockService_QueryRoles_Call struct {
	*mock.Call
}

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

func (*MockService_QueryRoles_Call) Return

func (*MockService_QueryRoles_Call) Run

func (*MockService_QueryRoles_Call) RunAndReturn

type MockService_QueryUsers_Call

type MockService_QueryUsers_Call struct {
	*mock.Call
}

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

func (*MockService_QueryUsers_Call) Return

func (*MockService_QueryUsers_Call) Run

func (*MockService_QueryUsers_Call) RunAndReturn

type MockService_ReconcileIntents_Call added in v1.2.1

type MockService_ReconcileIntents_Call struct {
	*mock.Call
}

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

func (*MockService_ReconcileIntents_Call) Return added in v1.2.1

func (*MockService_ReconcileIntents_Call) Run added in v1.2.1

func (*MockService_ReconcileIntents_Call) RunAndReturn added in v1.2.1

type MockService_ResetPassword_Call

type MockService_ResetPassword_Call struct {
	*mock.Call
}

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

func (*MockService_ResetPassword_Call) Return

func (*MockService_ResetPassword_Call) Run

func (_c *MockService_ResetPassword_Call) Run(run func(ctx context.Context, operator *Claims, id string, newPassword string)) *MockService_ResetPassword_Call

func (*MockService_ResetPassword_Call) RunAndReturn

func (_c *MockService_ResetPassword_Call) RunAndReturn(run func(ctx context.Context, operator *Claims, id string, newPassword string) error) *MockService_ResetPassword_Call

type MockService_UpdateRole_Call

type MockService_UpdateRole_Call struct {
	*mock.Call
}

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

func (*MockService_UpdateRole_Call) Return

func (*MockService_UpdateRole_Call) Run

func (*MockService_UpdateRole_Call) RunAndReturn

func (_c *MockService_UpdateRole_Call) RunAndReturn(run func(ctx context.Context, operator *Claims, roleID string, opt UpdateRoleOptions) error) *MockService_UpdateRole_Call

type MockService_UpdateUserPermissions_Call

type MockService_UpdateUserPermissions_Call struct {
	*mock.Call
}

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

func (*MockService_UpdateUserPermissions_Call) Return

func (*MockService_UpdateUserPermissions_Call) Run

func (*MockService_UpdateUserPermissions_Call) RunAndReturn

type MockService_VerifyJWTToken_Call

type MockService_VerifyJWTToken_Call struct {
	*mock.Call
}

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

func (*MockService_VerifyJWTToken_Call) Return

func (*MockService_VerifyJWTToken_Call) Run

func (_c *MockService_VerifyJWTToken_Call) Run(run func(ctx context.Context, tokenString string, permissionKey PermissionKey)) *MockService_VerifyJWTToken_Call

func (*MockService_VerifyJWTToken_Call) RunAndReturn

func (_c *MockService_VerifyJWTToken_Call) RunAndReturn(run func(ctx context.Context, tokenString string, permissionKey PermissionKey) (Claims, RolePolicy, error)) *MockService_VerifyJWTToken_Call

type Node added in v1.2.0

type Node struct {
	Name   string            `json:"name"`
	Labels map[string]string `json:"labels,omitempty"`
	Status string            `json:"status"`
}

Node represents a Kubernetes node

type NodeState

type NodeState int8
const (
	NodeStateUnknown NodeState = iota
	NodeStateOnline
	NodeStateOffline
)

type Permission

type Permission struct {
	ID          bson.ObjectID    `bson:"_id,omitempty"`
	Key         PermissionKey    `bson:"key,omitempty"`
	Description string           `bson:"description,omitempty"`
	Resource    string           `bson:"resource,omitempty"`
	Action      PermissionAction `bson:"action,omitempty"`
}

type PermissionAction

type PermissionAction string
var (
	PermissionActionCreate PermissionAction = "create"
	PermissionActionRead   PermissionAction = "read"
	PermissionActionUpdate PermissionAction = "update"
	PermissionActionDelete PermissionAction = "delete"
)

type PermissionKey

type PermissionKey string
const (
	CreateUser             PermissionKey = "user.create"
	UserRead               PermissionKey = "user.read"
	ChangeUserPermission   PermissionKey = "user.permission.update"
	ResetUserPassword      PermissionKey = "user.password.reset"
	RoleCrete              PermissionKey = "role.create"
	RoleRead               PermissionKey = "role.read"
	RoleUpdate             PermissionKey = "role.update"
	RoleDelete             PermissionKey = "role.delete"
	PermissionRead         PermissionKey = "permission.read"
	ScheduleStrategyCreate PermissionKey = "schedule_strategy.create"
	ScheduleStrategyRead   PermissionKey = "schedule_strategy.read"
	ScheduleStrategyDelete PermissionKey = "schedule_strategy.delete"
	ScheduleIntentRead     PermissionKey = "schedule_intent.read"
	ScheduleIntentDelete   PermissionKey = "schedule_intent.delete"
	PodPIDMappingRead      PermissionKey = "pod_pid_mapping.read"
)

type Pod

type Pod struct {
	Name         string
	K8SNamespace string
	Labels       map[string]string
	PodID        string
	NodeID       string
	Containers   []Container
}

func (*Pod) LabelsToSelectors

func (p *Pod) LabelsToSelectors() []LabelSelector

type PodPIDInfo added in v1.2.0

type PodPIDInfo struct {
	PodUID    string       `json:"pod_uid"`
	PodID     string       `json:"pod_id,omitempty"`
	Processes []PodProcess `json:"processes"`
}

PodPIDInfo represents pod information with associated processes

type PodPIDMappingResponse added in v1.2.0

type PodPIDMappingResponse struct {
	Pods      []PodPIDInfo `json:"pods"`
	Timestamp string       `json:"timestamp"`
	NodeName  string       `json:"node_name"`
	NodeID    string       `json:"node_id,omitempty"`
}

PodPIDMappingResponse represents the response from Decision Maker's Pod-PID mapping API

type PodProcess added in v1.2.0

type PodProcess struct {
	PID         int    `json:"pid"`
	Command     string `json:"command"`
	PPID        int    `json:"ppid,omitempty"`
	ContainerID string `json:"container_id,omitempty"`
}

PodProcess represents a process information within a pod

type QueryAuditLogOptions

type QueryAuditLogOptions struct {
	TimestampGTE int64
	TimestampLTE int64
	UserIDs      []bson.ObjectID
	Result       []*AuditLog
}

type QueryDecisionMakerPodsOptions

type QueryDecisionMakerPodsOptions struct {
	K8SNamespace       []string
	NodeIDs            []string
	DecisionMakerLabel LabelSelector
}

type QueryIntentOptions

type QueryIntentOptions struct {
	IDs           []bson.ObjectID
	K8SNamespaces []string
	StrategyIDs   []bson.ObjectID
	States        []IntentState
	PodIDs        []string
	Result        []*ScheduleIntent
	CreatorIDs    []bson.ObjectID
}

type QueryPermissionOptions

type QueryPermissionOptions struct {
	IDs       []bson.ObjectID
	Keys      []string
	Resources []string
	Result    []*Permission
}

type QueryPodsOptions

type QueryPodsOptions struct {
	K8SNamespace   []string
	LabelSelectors []LabelSelector
	CommandRegex   string
}

type QueryRoleOptions

type QueryRoleOptions struct {
	IDs    []bson.ObjectID
	Names  []string
	Result []*Role
}

type QueryStrategyOptions

type QueryStrategyOptions struct {
	IDs           []bson.ObjectID
	K8SNamespaces []string
	Result        []*ScheduleStrategy
	CreatorIDs    []bson.ObjectID
}

type QueryUserOptions

type QueryUserOptions struct {
	IDs       []bson.ObjectID
	UserNames []string
	Result    []*User
}

type Repository

type Repository interface {
	CreateUser(ctx context.Context, user *User) error
	UpdateUser(ctx context.Context, user *User) error
	QueryUsers(ctx context.Context, opt *QueryUserOptions) error
	CreateRole(ctx context.Context, role *Role) error
	UpdateRole(ctx context.Context, role *Role) error
	QueryRoles(ctx context.Context, opt *QueryRoleOptions) error
	CreatePermission(ctx context.Context, permission *Permission) error
	UpdatePermission(ctx context.Context, permission *Permission) error
	QueryPermissions(ctx context.Context, opt *QueryPermissionOptions) error
	CreateAuditLog(ctx context.Context, log *AuditLog) error
	QueryAuditLogs(ctx context.Context, opt *QueryAuditLogOptions) error

	InsertStrategyAndIntents(ctx context.Context, strategy *ScheduleStrategy, intents []*ScheduleIntent) error
	InsertIntents(ctx context.Context, intents []*ScheduleIntent) error
	BatchUpdateIntentsState(ctx context.Context, intentIDs []bson.ObjectID, newState IntentState) error
	QueryStrategies(ctx context.Context, opt *QueryStrategyOptions) error
	QueryIntents(ctx context.Context, opt *QueryIntentOptions) error
	DeleteStrategy(ctx context.Context, strategyID bson.ObjectID) error
	DeleteIntents(ctx context.Context, intentIDs []bson.ObjectID) error
	DeleteIntentsByStrategyID(ctx context.Context, strategyID bson.ObjectID) error
}

type Role

type Role struct {
	BaseEntity  `bson:",inline"`
	Name        string       `bson:"name,omitempty"`
	Description string       `bson:"description,omitempty"`
	Policies    []RolePolicy `bson:"policies,omitempty"`
}

type RolePolicy

type RolePolicy struct {
	PermissionKey   PermissionKey `bson:"permissionKey,omitempty"`
	Self            bool          `bson:"self,omitempty"`
	K8SNamespace    string        `bson:"k8sNamespace,omitempty"`
	PolicyNamespace string        `bson:"policeNamespace,omitempty"`
}

type ScheduleIntent

type ScheduleIntent struct {
	BaseEntity    `bson:",inline"`
	StrategyID    bson.ObjectID     `bson:"strategyID,omitempty"`
	PodID         string            `bson:"podID,omitempty"`
	PodName       string            `bson:"podName,omitempty"`
	NodeID        string            `bson:"nodeID,omitempty"`
	K8sNamespace  string            `bson:"k8sNamespace,omitempty"`
	CommandRegex  string            `bson:"commandRegex,omitempty"`
	Priority      int               `bson:"priority,omitempty"`
	ExecutionTime int64             `bson:"executionTime,omitempty"`
	PodLabels     map[string]string `bson:"podLabels,omitempty"`
	State         IntentState       `bson:"state,omitempty"`
}

func NewScheduleIntent

func NewScheduleIntent(strategy *ScheduleStrategy, pod *Pod) ScheduleIntent

type ScheduleStrategy

type ScheduleStrategy struct {
	BaseEntity        `bson:",inline"`
	StrategyNamespace string          `bson:"strategyNamespace,omitempty"`
	LabelSelectors    []LabelSelector `bson:"labelSelectors,omitempty"`
	K8sNamespace      []string        `bson:"k8sNamespace,omitempty"`
	CommandRegex      string          `bson:"commandRegex,omitempty"`
	Priority          int             `bson:"priority,omitempty"`
	ExecutionTime     int64           `bson:"executionTime,omitempty"`
}

type Service

type Service interface {
	CreateNewUser(ctx context.Context, operator *Claims, username, password string) error
	CreateAdminUserIfNotExists(ctx context.Context, username, password string) error
	Login(ctx context.Context, email, password string) (token string, err error)
	ChangePassword(ctx context.Context, user *Claims, oldPassword, newPassword string) error
	ResetPassword(ctx context.Context, operator *Claims, id, newPassword string) error
	UpdateUserPermissions(ctx context.Context, operator *Claims, id string, opt UpdateUserPermissionsOptions) error
	VerifyJWTToken(ctx context.Context, tokenString string, permissionKey PermissionKey) (Claims, RolePolicy, error)
	QueryUsers(ctx context.Context, opt *QueryUserOptions) error

	CreateRole(ctx context.Context, operator *Claims, role *Role) error
	UpdateRole(ctx context.Context, operator *Claims, roleID string, opt UpdateRoleOptions) error
	DeleteRole(ctx context.Context, operator *Claims, roleID string) error
	QueryRoles(ctx context.Context, opt *QueryRoleOptions) error
	QueryPermissions(ctx context.Context, opt *QueryPermissionOptions) error

	CreateScheduleStrategy(ctx context.Context, operator *Claims, strategy *ScheduleStrategy) error
	ListScheduleStrategies(ctx context.Context, filterOpts *QueryStrategyOptions) error
	ListScheduleIntents(ctx context.Context, filterOpts *QueryIntentOptions) error
	DeleteScheduleStrategy(ctx context.Context, operator *Claims, strategyID string) error
	DeleteScheduleIntents(ctx context.Context, operator *Claims, intentIDs []string) error
	GetPodPIDMapping(ctx context.Context, nodeID string) (*PodPIDMappingResponse, error)
	ListNodes(ctx context.Context) ([]*Node, error)
	ReconcileIntents(ctx context.Context) error
}

type UpdateRoleOptions

type UpdateRoleOptions struct {
	Name        *string       `bson:"name,omitempty"`
	Description *string       `bson:"description,omitempty"`
	Policies    *[]RolePolicy `bson:"policies,omitempty"`
}

type UpdateUserPermissionsOptions

type UpdateUserPermissionsOptions struct {
	Roles  *[]string
	Status *UserStatus
}

type User

type User struct {
	BaseEntity     `bson:",inline"`
	UserName       string            `bson:"username,omitempty"`
	Password       EncryptedPassword `bson:"password,omitempty"`
	Status         UserStatus        `bson:"status,omitempty"`
	Roles          []string          `bson:"roles,omitempty"`
	PermissionKeys []string          `bson:"permissionKeys,omitempty"`
}

type UserStatus

type UserStatus int8
const (
	UserStatusActive             UserStatus = 1
	UserStatusInactive           UserStatus = 2
	UserStatusWaitChangePassword UserStatus = 3
)

Jump to

Keyboard shortcuts

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