Refactor storage to support shallow types.
Add Client to storage. Fix client resizing issues.
This commit is contained in:
@@ -9,67 +9,76 @@ type Mock struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
func (m *Mock) SessionGet(sessionId string) (*types.Session, error) {
|
||||
args := m.Called(sessionId)
|
||||
func (m *Mock) SessionGet(id string) (*types.Session, error) {
|
||||
args := m.Called(id)
|
||||
return args.Get(0).(*types.Session), args.Error(1)
|
||||
}
|
||||
|
||||
func (m *Mock) SessionGetAll() ([]*types.Session, error) {
|
||||
args := m.Called()
|
||||
return args.Get(0).([]*types.Session), args.Error(1)
|
||||
}
|
||||
func (m *Mock) SessionPut(session *types.Session) error {
|
||||
args := m.Called(session)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
func (m *Mock) SessionDelete(id string) error {
|
||||
args := m.Called(id)
|
||||
return args.Error(0)
|
||||
}
|
||||
func (m *Mock) SessionCount() (int, error) {
|
||||
args := m.Called()
|
||||
return args.Int(0), args.Error(1)
|
||||
}
|
||||
|
||||
func (m *Mock) SessionDelete(sessionId string) error {
|
||||
args := m.Called(sessionId)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
func (m *Mock) SessionGetAll() (map[string]*types.Session, error) {
|
||||
args := m.Called()
|
||||
return args.Get(0).(map[string]*types.Session), args.Error(1)
|
||||
}
|
||||
|
||||
func (m *Mock) InstanceGet(sessionId, name string) (*types.Instance, error) {
|
||||
args := m.Called(sessionId, name)
|
||||
func (m *Mock) InstanceGet(name string) (*types.Instance, error) {
|
||||
args := m.Called(name)
|
||||
return args.Get(0).(*types.Instance), args.Error(1)
|
||||
}
|
||||
|
||||
func (m *Mock) InstanceGetAllWindows() ([]*types.WindowsInstance, error) {
|
||||
args := m.Called()
|
||||
return args.Get(0).([]*types.WindowsInstance), args.Error(1)
|
||||
}
|
||||
|
||||
func (m *Mock) InstanceFindByIP(sessionId, ip string) (*types.Instance, error) {
|
||||
args := m.Called(sessionId, ip)
|
||||
return args.Get(0).(*types.Instance), args.Error(1)
|
||||
}
|
||||
|
||||
func (m *Mock) InstanceCreate(sessionId string, instance *types.Instance) error {
|
||||
args := m.Called(sessionId, instance)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
func (m *Mock) InstanceCreateWindows(instance *types.WindowsInstance) error {
|
||||
func (m *Mock) InstancePut(instance *types.Instance) error {
|
||||
args := m.Called(instance)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
func (m *Mock) InstanceDelete(sessionId, instanceName string) error {
|
||||
args := m.Called(sessionId, instanceName)
|
||||
func (m *Mock) InstanceDelete(name string) error {
|
||||
args := m.Called(name)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
func (m *Mock) InstanceDeleteWindows(sessionId, instanceId string) error {
|
||||
args := m.Called(sessionId, instanceId)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
func (m *Mock) InstanceCount() (int, error) {
|
||||
args := m.Called()
|
||||
return args.Int(0), args.Error(1)
|
||||
}
|
||||
func (m *Mock) InstanceFindBySessionId(sessionId string) ([]*types.Instance, error) {
|
||||
args := m.Called(sessionId)
|
||||
return args.Get(0).([]*types.Instance), args.Error(1)
|
||||
}
|
||||
|
||||
func (m *Mock) WindowsInstanceGetAll() ([]*types.WindowsInstance, error) {
|
||||
args := m.Called()
|
||||
return args.Get(0).([]*types.WindowsInstance), args.Error(1)
|
||||
}
|
||||
func (m *Mock) WindowsInstancePut(instance *types.WindowsInstance) error {
|
||||
args := m.Called(instance)
|
||||
return args.Error(0)
|
||||
}
|
||||
func (m *Mock) WindowsInstanceDelete(id string) error {
|
||||
args := m.Called(id)
|
||||
return args.Error(0)
|
||||
}
|
||||
func (m *Mock) ClientGet(id string) (*types.Client, error) {
|
||||
args := m.Called(id)
|
||||
return args.Get(0).(*types.Client), args.Error(1)
|
||||
}
|
||||
func (m *Mock) ClientPut(client *types.Client) error {
|
||||
args := m.Called(client)
|
||||
return args.Error(0)
|
||||
}
|
||||
func (m *Mock) ClientDelete(id string) error {
|
||||
args := m.Called(id)
|
||||
return args.Error(0)
|
||||
}
|
||||
func (m *Mock) ClientCount() (int, error) {
|
||||
args := m.Called()
|
||||
return args.Int(0), args.Error(1)
|
||||
}
|
||||
func (m *Mock) ClientFindBySessionId(sessionId string) ([]*types.Client, error) {
|
||||
args := m.Called(sessionId)
|
||||
return args.Get(0).([]*types.Client), args.Error(1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user