Documentation ¶
Index ¶
Constants ¶
View Source
const (
ImportDataModels = "ImportDataModels"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateParam ¶
type DataModel ¶
type DataModel struct { WorkspaceID string ID string Name string Type string CreatedAt time.Time UpdatedAt time.Time Headers []string // all headers in this data model RowIDs []string // all rowIDs in this data model, only used in delete data model Rows [][]string // the row should be saved(create/update) }
type Factory ¶
type Factory struct{}
Factory workspace factory.
func NewDataModelFactory ¶
func NewDataModelFactory() *Factory
NewDataModelFactory return a workspace factory.
func (*Factory) New ¶
func (f *Factory) New(param *CreateParam) *DataModel
type ImportDataModelsEvent ¶
type ImportDataModelsEvent struct { WorkspaceID string Schemas []schema.DataModelTypedSchema ImportFileBaseDir string }
func NewImportDataModelsEvent ¶
func NewImportDataModelsEvent(workspaceID, baseDir string, schemas []schema.DataModelTypedSchema) *ImportDataModelsEvent
func NewImportDataModelsEventFromPayload ¶
func NewImportDataModelsEventFromPayload(data []byte) (*ImportDataModelsEvent, error)
func (*ImportDataModelsEvent) Delay ¶
func (e *ImportDataModelsEvent) Delay() time.Duration
func (*ImportDataModelsEvent) EventType ¶
func (e *ImportDataModelsEvent) EventType() string
func (*ImportDataModelsEvent) Payload ¶
func (e *ImportDataModelsEvent) Payload() []byte
type ImportDataModelsHandler ¶
type ImportDataModelsHandler struct {
// contains filtered or unexported fields
}
func NewImportDataModelsHandler ¶
func NewImportDataModelsHandler(repo Repository, bus eventbus.EventBus, factory *Factory) *ImportDataModelsHandler
func (*ImportDataModelsHandler) Handle ¶
func (h *ImportDataModelsHandler) Handle(ctx context.Context, event *ImportDataModelsEvent) error
type Repository ¶
type Repository interface { Save(ctx context.Context, dm *DataModel) error Get(ctx context.Context, id string) (*DataModel, error) Delete(ctx context.Context, dm *DataModel) error }
Repository allows to get/save events from/to event store.
type Service ¶
type Service interface { Get(context.Context, string) (*DataModel, error) Upsert(context.Context, *DataModel) error Create(context.Context, *DataModel) error Update(context.Context, *DataModel) error Delete(context.Context, *DataModel) error }
func NewService ¶
func NewService(repo Repository, eventbus eventbus.EventBus, factory *Factory) Service
Click to show internal directories.
Click to hide internal directories.