Documentation
¶
Overview ¶
Package dtprojcreator is a generated GoMock package.
Index ¶
- Constants
- Variables
- func ContextWithDatatugStore(ctx context.Context, store Store) context.Context
- func GetProjItemIDFromFileName(fileName string) (id string, suffix string)
- func GetProjectStore(ctx context.Context, storeID, projectID string) (datatug.ProjectStore, error)
- func JsonFileName(id, suffix string) string
- type BoardsStore
- type CreateFolderRequest
- type DbModelStore
- type DbModelsStore
- type DbServerStore
- type DbServersStore
- type EntitiesStore
- type EntityStore
- type FileLoadError
- type FilesLoadError
- type FoldersStore
- type MockStorage
- func (m *MockStorage) Commit(ctx context.Context, message string) error
- func (m *MockStorage) EXPECT() *MockStorageMockRecorder
- func (m *MockStorage) FileExists(ctx context.Context, filePath string) (bool, error)
- func (m *MockStorage) OpenFile(ctx context.Context, filePath string) (io.ReadCloser, error)
- func (m *MockStorage) WriteFile(ctx context.Context, filePath string, reader io.Reader) error
- type MockStorageMockRecorder
- func (mr *MockStorageMockRecorder) Commit(ctx, message any) *gomock.Call
- func (mr *MockStorageMockRecorder) FileExists(ctx, filePath any) *gomock.Call
- func (mr *MockStorageMockRecorder) OpenFile(ctx, filePath any) *gomock.Call
- func (mr *MockStorageMockRecorder) WriteFile(ctx, filePath, reader any) *gomock.Call
- type ProjectStoreDeprecated
- type ProjectStoreRef
- type QueriesStore
- type RecordsetLoader
- type RecordsetsStore
- type Store
Constants ¶
const ( RepoRootDataTugFileName = ".datatug.yaml" BoardsFolder = "boards" ProjectSummaryFileName = "datatug-project.json" DataFolder = "data" DbsFolder = "dbs" EnvDbCatalogsFolder = "catalogs" DbModelsFolder = "dbmodels" EntitiesFolder = "entities" EnvironmentsFolder = "environments" QueriesFolder = "queries" RecordsetsFolder = "recordsets" ServersFolder = "servers" SchemasFolder = "schemas" )
const ( BoardFileSuffix = "board" DbCatalogFileSuffix = "db" DbCatalogObjectFileSuffix = "objects" DbCatalogRefsFileSuffix = "refs" DbModelFileSuffix = "dbmodel" //DbSchemaFileSuffix = "schema" DbServerFileSuffix = "dbserver" RecordsetFileSuffix = "recordset" EntityFileSuffix = "entity" ServerFileSuffix = "server" ColumnsFileSuffix = "columns" QueryFileSuffix = "query" )
const (
EnvironmentSummaryFileName = "environment-summary.json"
)
const SingleProjectID = "."
SingleProjectID defines a short version of project GetID for a single project storage
Variables ¶
var NewDatatugStore = func(id string) (Store, error) { panic("var 'NewDatatugStore' is not initialized") }
NewDatatugStore creates new instance of Store for a specific storage
Functions ¶
func ContextWithDatatugStore ¶
func GetProjItemIDFromFileName ¶ added in v0.15.12
func GetProjectStore ¶ added in v0.15.0
func JsonFileName ¶ added in v0.15.12
Types ¶
type BoardsStore ¶
type BoardsStore interface {
ProjectStoreRef
CreateBoard(ctx context.Context, board datatug.Board) (*datatug.Board, error)
SaveBoard(ctx context.Context, board datatug.Board) (*datatug.Board, error)
GetBoard(ctx context.Context, id string) (board *datatug.Board, err error)
DeleteBoard(ctx context.Context, id string) (err error)
}
BoardsStore provides access to board records
type CreateFolderRequest ¶
func (CreateFolderRequest) Validate ¶
func (v CreateFolderRequest) Validate() error
type DbModelStore ¶
type DbModelStore interface {
ProjectStoreRef
ID() string
DbModels() DbModelsStore
}
type DbModelsStore ¶
type DbModelsStore interface {
DbModel(id string) DbModelStore
}
type DbServerStore ¶
type DbServerStore interface {
ID() datatug.ServerRef
// LoadDbServerSummary loads summary on DB server
LoadDbServerSummary(ctx context.Context, dbServer datatug.ServerRef) (summary *datatug.ProjDbServerSummary, err error)
SaveDbServer(ctx context.Context, dbServer datatug.ProjDbServer, project datatug.Project) (err error)
DeleteDbServer(ctx context.Context, dbServer datatug.ServerRef) (err error)
}
type DbServersStore ¶
type DbServersStore interface {
ProjectStoreRef
DbServer(id datatug.ServerRef) DbServerStore
}
type EntitiesStore ¶
type EntitiesStore interface {
ProjectStoreRef
Entity(id string) EntityStore
// LoadEntities loads entities
LoadEntities(ctx context.Context) (entities datatug.Entities, err error)
}
type EntityStore ¶
type EntityStore interface {
ID() string
Entities() EntitiesStore
// LoadEntity loads entity
LoadEntity(ctx context.Context) (entity *datatug.Entity, err error)
DeleteEntity(ctx context.Context) (err error)
SaveEntity(ctx context.Context, entity *datatug.Entity) (err error)
}
EntityStore defines DAL for entities
type FileLoadError ¶ added in v0.15.0
type FileLoadError struct {
FileName string `json:"fileName,omitempty"`
Err string `json:"err,omitempty"`
// contains filtered or unexported fields
}
func NewFileLoadError ¶ added in v0.15.0
func NewFileLoadError(fileName string, err error) FileLoadError
func (FileLoadError) Error ¶ added in v0.15.0
func (e FileLoadError) Error() string
func (FileLoadError) String ¶ added in v0.15.0
func (e FileLoadError) String() string
type FilesLoadError ¶ added in v0.15.0
type FilesLoadError struct {
// contains filtered or unexported fields
}
func NewFilesLoadError ¶ added in v0.15.0
func NewFilesLoadError(errs []FileLoadError) FilesLoadError
func (FilesLoadError) Error ¶ added in v0.15.0
func (e FilesLoadError) Error() string
func (FilesLoadError) Errors ¶ added in v0.15.0
func (e FilesLoadError) Errors() []FileLoadError
func (FilesLoadError) String ¶ added in v0.15.0
func (e FilesLoadError) String() string
type FoldersStore ¶
type MockStorage ¶ added in v0.15.12
type MockStorage struct {
// contains filtered or unexported fields
}
MockStorage is a mock of Storage interface.
func NewMockStorage ¶ added in v0.15.12
func NewMockStorage(ctrl *gomock.Controller) *MockStorage
NewMockStorage creates a new mock instance.
func (*MockStorage) Commit ¶ added in v0.15.12
func (m *MockStorage) Commit(ctx context.Context, message string) error
Commit mocks base method.
func (*MockStorage) EXPECT ¶ added in v0.15.12
func (m *MockStorage) EXPECT() *MockStorageMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockStorage) FileExists ¶ added in v0.15.12
FileExists mocks base method.
func (*MockStorage) OpenFile ¶ added in v0.15.12
func (m *MockStorage) OpenFile(ctx context.Context, filePath string) (io.ReadCloser, error)
OpenFile mocks base method.
type MockStorageMockRecorder ¶ added in v0.15.12
type MockStorageMockRecorder struct {
// contains filtered or unexported fields
}
MockStorageMockRecorder is the mock recorder for MockStorage.
func (*MockStorageMockRecorder) Commit ¶ added in v0.15.12
func (mr *MockStorageMockRecorder) Commit(ctx, message any) *gomock.Call
Commit indicates an expected call of Commit.
func (*MockStorageMockRecorder) FileExists ¶ added in v0.15.12
func (mr *MockStorageMockRecorder) FileExists(ctx, filePath any) *gomock.Call
FileExists indicates an expected call of FileExists.
type ProjectStoreDeprecated ¶ added in v0.15.0
type ProjectStoreDeprecated interface {
ProjectID() string
Folders() FoldersStore
Queries() QueriesStore
Boards() BoardsStore
Entities() EntitiesStore
DbModels() DbModelsStore
DbServers() DbServersStore
Recordsets() RecordsetsStore
SaveProject(ctx context.Context, project datatug.Project) (err error)
// LoadProject returns full DataTug project
LoadProject(ctx context.Context) (*datatug.Project, error)
// LoadProjectSummary return summary metadata about DataTug project
LoadProjectSummary(ctx context.Context) (datatug.ProjectSummary, error)
}
ProjectStoreDeprecated Deprecated: Use datatug.ProjectStore instead
type ProjectStoreRef ¶
type ProjectStoreRef interface {
Project() datatug.ProjectStore
}
type QueriesStore ¶
type QueriesStore interface {
ProjectStoreRef
CreateQuery(ctx context.Context, query datatug.QueryDefWithFolderPath) (*datatug.QueryDefWithFolderPath, error)
UpdateQuery(ctx context.Context, query datatug.QueryDef) (*datatug.QueryDefWithFolderPath, error)
GetQuery(ctx context.Context, id string) (query *datatug.QueryDefWithFolderPath, err error)
DeleteQuery(ctx context.Context, id string) (err error)
}
QueriesStore provides access to queries
type RecordsetLoader ¶
type RecordsetLoader interface {
// ID returns recordset id
ID() string
// LoadRecordsetDefinition loads recordset definition
LoadRecordsetDefinition(ctx context.Context) (dataset *datatug.RecordsetDefinition, err error)
// LoadRecordsetData loads recordset data
LoadRecordsetData(ctx context.Context, fileName string) (recordset *datatug.Recordset, err error)
}
RecordsetLoader loads recordset data
type RecordsetsStore ¶
type RecordsetsStore interface {
ProjectStoreRef
Recordset(id string) RecordsetLoader
// LoadRecordsetDefinitions loads list of recordsets summary
LoadRecordsetDefinitions(ctx context.Context) (datasets []*datatug.RecordsetDefinition, err error)
}
RecordsetsStore provides access to recordset records
type Store ¶
type Store interface {
GetProjectStore(projectID string) datatug.ProjectStore
// CreateProject creates a new DataTug project
CreateProject(ctx context.Context, request dto.CreateProjectRequest) (summary *datatug.ProjectSummary, err error)
DeleteProject(ctx context.Context, id string) error
// GetProjects returns list of projects
GetProjects(ctx context.Context) (projectBriefs []datatug.ProjectBrief, err error)
}
Store defines interface for loading & saving DataTug projects Each store can keep multiple projects. Projects can be stored locally on file system or on server on some database.
var Current Store
Current holds currently active storage interface
TODO: to be replaced with `func NewDatatugStore(id string) Store`
func NewNoOpStore ¶
func NewNoOpStore() Store