workspace

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderByName       = "Name"
	OrderByCreateTime = "CreatedAt"
)

Field for order.

Variables

This section is empty.

Functions

func CheckWorkspaceExist

func CheckWorkspaceExist(ctx context.Context, readModel WorkspaceReadModel, workspaceID string) *errors.AppError

Types

type GetWorkspaceByIDQuery

type GetWorkspaceByIDQuery struct {
	ID string `validate:"required"`
}

type GetWorkspaceByIDQueryHandler

type GetWorkspaceByIDQueryHandler interface {
	Handle(ctx context.Context, command *GetWorkspaceByIDQuery) (*WorkspaceItem, error)
}

func NewGetWorkspaceByIDHandler

func NewGetWorkspaceByIDHandler(workspaceReadModel WorkspaceReadModel) GetWorkspaceByIDQueryHandler

type ListWorkspacesFilter

type ListWorkspacesFilter struct {
	SearchWord string
	Exact      bool
	IDs        []string
}

type ListWorkspacesHandler

type ListWorkspacesHandler interface {
	Handle(ctx context.Context, query *ListWorkspacesQuery) ([]*WorkspaceItem, int, error)
}

func NewListWorkspacesHandler

func NewListWorkspacesHandler(workspaceReadModel WorkspaceReadModel) ListWorkspacesHandler

type ListWorkspacesQuery

type ListWorkspacesQuery struct {
	Pg     utils.Pagination
	Filter *ListWorkspacesFilter
}

type NFSWorkspaceStorage

type NFSWorkspaceStorage struct {
	MountPath string
}

type Queries

type Queries struct {
	GetWorkspaceByID GetWorkspaceByIDQueryHandler
	ListWorkspaces   ListWorkspacesHandler
}

func NewQueries

func NewQueries(workspaceReadModel WorkspaceReadModel) *Queries

type WorkspaceItem

type WorkspaceItem struct {
	ID          string
	Name        string
	Description string
	CreatedAt   time.Time
	UpdatedAt   time.Time
	Storage     WorkspaceStorage
}

type WorkspaceReadModel

type WorkspaceReadModel interface {
	ListWorkspaces(ctx context.Context, pg utils.Pagination, filter *ListWorkspacesFilter) ([]*WorkspaceItem, error)
	CountWorkspaces(ctx context.Context, filter *ListWorkspacesFilter) (int, error)
	GetWorkspaceById(ctx context.Context, id string) (*WorkspaceItem, error)
}

type WorkspaceStorage

type WorkspaceStorage struct {
	NFS *NFSWorkspaceStorage
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL