package
0.3.1
Repository: https://github.com/kotalco/core-api.git
Documentation: pkg.go.dev

# Functions

Count returns total number of peers 1-call service to get length of exiting peers items 2-create X-Total-Count header with the length 3-return.
Create creates IPFS peer from spec 1-Todo validate request body and return validation error 2-call ipfs peer service to create ipfs peer 2-marshall node to dto and format the response.
Delete deletes IPFS peer by name 1-get node from locals which checked and assigned by ValidatePeerExist 2-call service to delete the node 3-return ok if deleted with no errors.
Get gets a single IPFS peer by name 1-get the node validated from ValidatePeerExist method 2-marshall node to dto and format the response.
List returns all IPFS peers 1-get the pagination qs default to 0 2-call service to return peers list 3-make the pagination 3-marshall peers to the dto struct and format the response using NewResponse.
Stats returns a websocket that emits peers,pin and files stats.
Update updates IPFS peer by name from spec 1-todo validate request body and return validation errors if exits 2-get node from locals which checked and assigned by ValidatePeerExist 3-call ipfs peer service to update node which returns *ipfsv1alpha1.Peer 4-marshall node to node dto and format the response.
ValidatePeerExist validate peer by name exist acts as a validation for all handlers the needs to find ipfs peer by name 1-call service to check if node exits 2-return 404 if it's not 3-save the peer to local with the key peer to be used by the other handlers.