Skip to content

A lightweight user management service that handles basic user operations with UUID-based identification. Core functionality includes user creation and retrieval through a clean architecture approach with domain-driven design principles.

Notifications You must be signed in to change notification settings

turkprogrammer/user-service-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

User Service API Project Overview

Architecture & Implementation

Core Components

  • Domain: User entity with UUID and Name
  • Ports: Repository interface definitions
  • Service: Business logic implementation
  • Tests: Mock-based testing with testify

Code Structure

// Domain
type User struct {
    ID   string
    Name string
}

// Ports
type UserRepository interface {
    Save(user User) error
    Get(id string) (User, error)
}

// Service
type UserService struct {
    repo UserRepository
}

func (s *UserService) CreateUser(name string) (User, error)
func (s *UserService) GetUser(id string) (User, error)

// Mock Repository
type MockUserRepository struct {
    mock.Mock
}

// Test Cases
func TestUserService_CreateUser(t *testing.T)
func TestUserService_GetUser(t *testing.T)

About

A lightweight user management service that handles basic user operations with UUID-based identification. Core functionality includes user creation and retrieval through a clean architecture approach with domain-driven design principles.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages