Initial cloud-services repo - gateway service + pkg modules

This commit is contained in:
Chris Rai
2026-01-30 23:14:52 -05:00
commit fbb820d7b3
1037 changed files with 171318 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
package mocks
import (
"fiskerinc.com/modules/common"
"fiskerinc.com/modules/validator"
"github.com/go-pg/pg/v10/orm"
)
type MockFileKeys struct {
GetResponse *common.FileKey
GetMultiResponse []common.FileKey
DBMockHelper
}
func (fk *MockFileKeys) Delete(fileID string) (orm.Result, error) {
if fileID == "" {
return nil, &validator.FieldError{
ErrorMsg: "FileID required",
}
}
return fk.ORMResponse, fk.Error
}
func (fk *MockFileKeys) Insert(filekey common.FileKey) (orm.Result, error) {
err := validator.ValidateStruct(filekey)
if err != nil {
return nil, err
}
return fk.ORMResponse, fk.Error
}
func (fk *MockFileKeys) Get(fileID string) (*common.FileKey, error) {
if fileID == "" {
return nil, &validator.FieldError{
ErrorMsg: "FileID required",
}
}
return fk.GetResponse, fk.Error
}
func (fk *MockFileKeys) GetMulti(fileIDs []string) ([]common.FileKey, error) {
return fk.GetMultiResponse, fk.Error
}