Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateCreateRequest ¶
func ValidateCreateRequest(c *workspacesProto.CreateWorkspaceRequest) error
ValidateCreateRequest validates the CreateWorkspaceRequest fields.
func ValidateUpdateRequest ¶
func ValidateUpdateRequest(u *workspacesProto.UpdateWorkspaceRequest) error
Validate validates the UpdateWorkspaceRequest fields.
Types ¶
type API ¶
type API interface { grpcgw.Controller workspaces.WorkspaceServiceServer }
type Repository ¶
type Repository interface { // Get returns the workspace with the specified workspace UUID. Get(ctx context.Context, uuid string) (entity.Workspace, error) // Count returns the number of workspaces. Count(ctx context.Context) (int64, error) // Query returns the list of workspaces with the given offset and limit. Query(ctx context.Context, offset, limit int64) ([]entity.Workspace, int, error) // Create saves a new workspace in the storage. Create(ctx context.Context, workspace entity.Workspace) error // Update updates the workspace with given UUID in the storage. Update(ctx context.Context, workspace entity.Workspace) error // Delete removes the workspace with given UUID from the storage. Delete(ctx context.Context, uuid string) error }
Repository encapsulates the logic to access workspaces from the data source.
func NewRepository ¶
func NewRepository(db *db.DB) Repository
NewRepository creates a new workspace repository
type Service ¶
type Service interface { Get(ctx context.Context, uuid string) (*workspacesProto.Workspace, error) Query(ctx context.Context, offset, limit int64) (*workspacesProto.ListWorkspacesResponse, error) Count(ctx context.Context) (int64, error) Create(ctx context.Context, input *workspacesProto.CreateWorkspaceRequest) (*workspacesProto.Workspace, error) Update(ctx context.Context, input *workspacesProto.UpdateWorkspaceRequest) (*workspacesProto.Workspace, error) Delete(ctx context.Context, uuid string) (*workspacesProto.Workspace, error) }
Service encapsulates use case logic for workspaces.
func NewService ¶
func NewService(repo Repository) Service
NewService creates a new workspace service.
Click to show internal directories.
Click to hide internal directories.