pacman spins up a simple server to help manage packages and their dependencies.
Before you can build and run the server, you'll need to have go
installed.
Click here to download go, and follow any relevant setup instructions.
To run this project, compile the pacman.go file with go build pacman.go
and then run the compiled executable with ./pacman
, or do both at once with go run pacman.go
.
If initialization is successful, you'll see Listening for tcp connections at 0.0.0.0:8080
.
You can run the Go test suite with go test
.
A Dockerfile
is included.
To run pacman inside of a Docker container, run the following:
docker build -t pacman . && docker run -p 8080:8080 --init -d pacman
Messages from clients should follow this pattern:
<command>|<package>|<dependencies>\n
Where:
<command>
is mandatory, and is eitherINDEX
,REMOVE
, orQUERY
<package>
is mandatory, the name of the package referred to by the command, e.g.mysql
,openssl
,pkg-config
,postgresql
, etc.<dependencies>
is optional, and if present it will be a comma-delimited list of packages that need to be present before<package>
is installed. e.g.cmake,sphinx-doc,xz
- The message always ends with the character
\n
sample messages:
INDEX|blinky|pinky,inky,clyde\n
INDEX|miss-pacman|\n
REMOVE|blinky|\n
QUERY|blinky|\n