codescalersinternships / home

home repo for internships
4 stars 0 forks source link

DateTime HTTP Client - Rowan #195

Open rowangamal opened 4 months ago

rowangamal commented 4 months ago

Develop and Test HTTP Client for Datetime Server #144

Description:

Create an HTTP client in Go that consumes the datetime server APIs implemented in the previous project #144 . This client will focus on building an HTTP client development and testing.

Requirements:

  1. Client Functionality:

    • [x] Implement functions to call each datetime server endpoint
    • [x] Handle different response formats (JSON, plain text) (our previous server only had string)
    • [x] Implement proper error handling and timeouts
  2. Configuration:

    • [x] Allow configuration of server URLs and ports
    • [x] Support for environment variable configuration all allowed, extracting env then injecting into fn / (in CLI)
  3. Retry Mechanism:

  4. Testing:

    • [ ] Unit tests for client functions (canceled afterwards)
    • [x] Integration tests using a mock server
  5. Documentation:

    • [x] Provide godoc-style comments for all exported functions
    • [x] Include usage examples in the README
  6. Logging:

    • [ ] Implement structured logging for client operations (canceled afterwards)

    Optional Enhancements:

    • [x] Implement a simple CLI interface for the client

    Acceptance Criteria:

    • [ ] All tests pass and provide good coverage
    • [ ] Documentation clearly explains usage and testing procedures

    After this one You can develop the one for pokeapi