Versions in this module Expand all Collapse all v0 v0.1.0 Jun 11, 2024 Changes in this version + var ErrBackendModelNil = errors.New("backend model can't be nil") + var ErrFailedToConvertBackendToEntity = errors.New("failed to convert backend model to entity") + var ErrFailedToConvertOrgToEntity = errors.New("failed to convert org model to entity") + var ErrFailedToConvertProjectToEntity = errors.New("failed to convert project model to entity") + var ErrFailedToConvertSourceToEntity = errors.New("failed to convert source model to entity") + var ErrFailedToGetSourceProviderType = errors.New("failed to parse source provider type") + var ErrFailedToGetSourceRemote = errors.New("failed to parse source remote") + var ErrFailedToGetStackState = errors.New("failed to parse stack state") + var ErrOrganizationModelNil = errors.New("organization model can't be nil") + var ErrProjectModelNil = errors.New("project model can't be nil") + var ErrSourceModelNil = errors.New("source model can't be nil") + var ErrStackModelNil = errors.New("stack model can't be nil") + var ErrSystemConfigModelNil = errors.New("system config model can't be nil") + var ErrWorkspaceModelNil = errors.New("workspace model can't be nil") + func CloseDB(t *testing.T, gdb *gorm.DB) + func GetMockDB() (*gorm.DB, sqlmock.Sqlmock, error) + func NewBackendRepository(db *gorm.DB) repository.BackendRepository + func NewOrganizationRepository(db *gorm.DB) repository.OrganizationRepository + func NewProjectRepository(db *gorm.DB) repository.ProjectRepository + func NewSourceRepository(db *gorm.DB) repository.SourceRepository + func NewStackRepository(db *gorm.DB) repository.StackRepository + func NewWorkspaceRepository(db *gorm.DB) repository.WorkspaceRepository + type BackendModel struct + BackendConfig v1.BackendConfig + Description string + Labels MultiString + Name string + Owners MultiString + Type string + func (m *BackendModel) FromEntity(e *entity.Backend) error + func (m *BackendModel) TableName() string + func (m *BackendModel) ToEntity() (*entity.Backend, error) + type MultiString []string + func (s *MultiString) Scan(src any) error + func (s MultiString) GormDBDataType(db *gorm.DB, field *schema.Field) string + func (s MultiString) GormDataType() string + func (s MultiString) Value() (driver.Value, error) + type OrganizationModel struct + Description string + Labels MultiString + Name string + Owners MultiString + func (m *OrganizationModel) FromEntity(e *entity.Organization) error + func (m *OrganizationModel) TableName() string + func (m *OrganizationModel) ToEntity() (*entity.Organization, error) + func (m *OrganizationModel) ToEntityWithSource(sourceEntity *entity.Source) (*entity.Organization, error) + type ProjectModel struct + Description string + Labels MultiString + Name string + Organization *OrganizationModel + OrganizationID uint + Owners MultiString + Path string + Source *SourceModel + SourceID uint + func (m *ProjectModel) FromEntity(e *entity.Project) error + func (m *ProjectModel) TableName() string + func (m *ProjectModel) ToEntity() (*entity.Project, error) + func (m *ProjectModel) ToEntityWithSourceAndOrg(sourceEntity *entity.Source, organizationEntity *entity.Organization) (*entity.Project, error) + type SourceModel struct + Description string + Labels MultiString + Owners MultiString + Remote string + SourceProvider string + func (m *SourceModel) FromEntity(e *entity.Source) error + func (m *SourceModel) TableName() string + func (m *SourceModel) ToEntity() (*entity.Source, error) + type StackModel struct + Description string + DesiredVersion string + Labels MultiString + LastSyncTimestamp time.Time + Name string + Owners MultiString + Path string + Project *ProjectModel + ProjectID uint + SyncState string + func (m *StackModel) FromEntity(e *entity.Stack) error + func (m *StackModel) TableName() string + func (m *StackModel) ToEntity(ctx context.Context) (*entity.Stack, error) + type WorkspaceModel struct + Backend *BackendModel + BackendID uint + Description string + Labels MultiString + Name string + Owners MultiString + func (m *WorkspaceModel) FromEntity(e *entity.Workspace) error + func (m *WorkspaceModel) TableName() string + func (m *WorkspaceModel) ToEntity() (*entity.Workspace, error)