Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

github.com/suraneni01/petstore-api

Package Overview
Dependencies
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/suraneni01/petstore-api

Source
Go Modules
Version
v0.0.0-20220202140456-7205379c1aa6
Version published
Created
Source

Pet Store Service

Service is a lightweight proxy fot pet-store API example that additonaly handles input validation.

Project layout

cmd                  | app configuration and running

  internal           | app internal logic

    petstore         | stores client to pet-store API logic

      client_mock.go | auto-generated mock for API client
      client_test.go | unit-tests for API client
      client.go      | HTTP API client implementation
      interface.go   | declares client external contract
      models.go      | declates models and types

    server           | stores service logic

      models.go      | declares request/response models
      server_test.go | unit-tests for service
      server.go      | HTTP service implementation


vendor               \ 
go.mod                | dependencies
go.sum               /

Service Methods

GET  http://{HOST}/pets     | Return list of pets
GET  http://{HOST}/pets/id  | Return pet by id
POST http://{HOST}/pets     | Adds new pet

Run server

go run cmd/main.go

Run tests

go test -v ./...
```#� �P�E�T�S�T�O�R�E�-�A�P�I�
�
�

FAQs

Package last updated on 02 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts