workspaces

package
v0.0.0-...-1d8daf6 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: MIT Imports: 13 Imported by: 0

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

func New

func New(srv Service) API

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

Service encapsulates use case logic for workspaces.

func NewService

func NewService(repo Repository) Service

NewService creates a new workspace service.

Jump to

Keyboard shortcuts

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