Documentation ¶
Index ¶
- Constants
- type CreateWorkspaceParam
- type Factory
- type ImportWorkspaceEvent
- type NFSStorage
- type Repository
- type Service
- type Storage
- type Workspace
- func (w *Workspace) GetCreatedAt() time.Time
- func (w *Workspace) GetDescription() string
- func (w *Workspace) GetID() string
- func (w *Workspace) GetName() string
- func (w *Workspace) GetStorage() Storage
- func (w *Workspace) GetUpdatedAt() time.Time
- func (w *Workspace) String() string
- func (w *Workspace) UpdateDescription(description string)
- func (w *Workspace) UpdateName(name string)
- type WorkspaceEvent
- type WorkspaceImportedEvent
Constants ¶
View Source
const ( WorkspaceCreated string = "WorkspaceCreated" WorkspaceDeleted string = "WorkspaceDeleted" WorkspaceImported string = "WorkspaceImported" ImportWorkspace string = "ImportWorkspace" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateWorkspaceParam ¶
type CreateWorkspaceParam struct { ID string Name string Description string Storage Storage CreatedAt time.Time UpdatedAt time.Time }
CreateWorkspaceParam use to create Workspace
type Factory ¶
type Factory struct{}
Factory workspace factory.
func NewWorkspaceFactory ¶
NewWorkspaceFactory return a workspace factory.
func (*Factory) CreateWithWorkspaceParam ¶
func (fac *Factory) CreateWithWorkspaceParam(param CreateWorkspaceParam) (*Workspace, error)
CreateWithWorkspaceParam ...
type ImportWorkspaceEvent ¶
type ImportWorkspaceEvent struct { WorkspaceID string FileName string Storage Storage Event string }
func NewImportWorkspaceEvent ¶
func NewImportWorkspaceEvent(workspaceID, fileName string, storage Storage) *ImportWorkspaceEvent
func NewImportWorkspaceEventFromPayload ¶
func NewImportWorkspaceEventFromPayload(data []byte) (*ImportWorkspaceEvent, error)
func (*ImportWorkspaceEvent) Delay ¶
func (e *ImportWorkspaceEvent) Delay() time.Duration
func (*ImportWorkspaceEvent) EventType ¶
func (e *ImportWorkspaceEvent) EventType() string
func (*ImportWorkspaceEvent) Payload ¶
func (e *ImportWorkspaceEvent) Payload() []byte
type NFSStorage ¶
type NFSStorage struct {
MountPath string
}
type Repository ¶
type Repository interface { Save(ctx context.Context, w *Workspace) error Get(ctx context.Context, id string) (*Workspace, error) Delete(ctx context.Context, w *Workspace) error }
Repository allows to get/save events from/to event store.
type Service ¶
type Service interface {
Import(ctx context.Context, workspaceID string, fileName string, storage Storage) error
}
func NewService ¶
func NewService(repo Repository, eventRepo eventbus.EventRepository, bus eventbus.EventBus, factory Factory) Service
type Storage ¶
type Storage struct {
NFS *NFSStorage
}
type Workspace ¶
type Workspace struct { ID string Name string Description string CreatedAt time.Time UpdatedAt time.Time Storage Storage }
Workspace aggregate root DO.
func (*Workspace) GetCreatedAt ¶
func (*Workspace) GetDescription ¶
func (*Workspace) GetStorage ¶
func (*Workspace) GetUpdatedAt ¶
func (*Workspace) UpdateDescription ¶
func (*Workspace) UpdateName ¶
type WorkspaceEvent ¶
func NewWorkspaceCreatedEvent ¶
func NewWorkspaceCreatedEvent(workspaceID string) *WorkspaceEvent
func NewWorkspaceDeletedEvent ¶
func NewWorkspaceDeletedEvent(workspaceID string) *WorkspaceEvent
func NewWorkspaceEventFromPayload ¶
func NewWorkspaceEventFromPayload(data []byte) (*WorkspaceEvent, error)
func (*WorkspaceEvent) Delay ¶
func (e *WorkspaceEvent) Delay() time.Duration
func (*WorkspaceEvent) EventType ¶
func (e *WorkspaceEvent) EventType() string
func (*WorkspaceEvent) Payload ¶
func (e *WorkspaceEvent) Payload() []byte
type WorkspaceImportedEvent ¶
func NewWorkspaceImportedEvent ¶
func NewWorkspaceImportedEvent(workspaceID, baseDir string) *WorkspaceImportedEvent
func NewWorkspaceImportedEventFromPayload ¶
func NewWorkspaceImportedEventFromPayload(data []byte) (*WorkspaceImportedEvent, error)
func (*WorkspaceImportedEvent) Delay ¶
func (e *WorkspaceImportedEvent) Delay() time.Duration
func (*WorkspaceImportedEvent) EventType ¶
func (e *WorkspaceImportedEvent) EventType() string
func (*WorkspaceImportedEvent) Payload ¶
func (e *WorkspaceImportedEvent) Payload() []byte
Click to show internal directories.
Click to hide internal directories.