Skip to content

Commit 59a8fa6

Browse files
committed
docs: add description about our code structure
Document most important directories when trying to understand our project. Signed-off-by: Paul Holzinger <[email protected]>
1 parent 98e6d85 commit 59a8fa6

File tree

1 file changed

+83
-0
lines changed

1 file changed

+83
-0
lines changed

docs/CODE_STRUCTURE.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Podman Codebase structure
2+
3+
Description about important directories in our repository.
4+
5+
### cmd/
6+
7+
- each directory here builds its own binary
8+
9+
#### cmd/podman/
10+
11+
- podman cli code, cli commands and flags are defined here, we are using github.com/spf13/cobra as library for command line parsing
12+
13+
#### cmd/quadlet/
14+
15+
- quadlet cli
16+
17+
18+
### docs/
19+
20+
- sphinx based documentation for podman that is build on readthedocs (docs.podman.io)
21+
22+
#### docs/source/markdown/
23+
24+
- man pages for each podman command
25+
26+
### libpod/ (only works on linux and freebsd)
27+
- underlying core for most podman operations, defines container, pod, volume management opartions
28+
- contains the database to store these informations on disk, either sqlite or botldb (our old db format)
29+
- integrates with our other libraries such as:
30+
- containers/storage create and mount container storage
31+
- containers/buildah for building images
32+
- containers/common/libnetwork for network management
33+
34+
### pkg/
35+
36+
- various packages to do all sorts of different things
37+
38+
#### pkg/api/
39+
40+
- the HTTP REST API server code
41+
42+
#### pkg/bindings/
43+
44+
- the HTTP REST API client code
45+
- this package must have a stable API as it is for use by external consumers as well
46+
47+
#### pkg/domain/
48+
49+
- "glue" code between cli and the actual operations performed
50+
51+
##### pkg/domain/entities/
52+
53+
- the package defines two interfaces (ContainerEngine, ImageEngine) that more or less have a function for each cli command defined
54+
- it also defines a lot of types (structs) for the varoius options the functions accept
55+
56+
##### pkg/domain/infra/tunnel/
57+
58+
- implements the two interfaces for the remote mode (podman-remote) which just maps each operations to the bindings code from pkg/bindings which then talks to the remote server
59+
60+
##### pkg/domain/infra/abi/
61+
62+
- implements the two interfaces for the local mode (podman) that calls then directly into the core parts of libpod/ or our other libraries containers/{commmon,image,storage}...
63+
64+
#### pkg/libartifact/
65+
66+
- core code for the new podman artifact commands
67+
68+
#### pkg/machine/
69+
70+
- core code for podman machine commands
71+
72+
### test/
73+
74+
- Various tests suites, see the test [README.md](../test/README.md) for more details.
75+
76+
#### vendor/
77+
78+
- directory created with "go mod vendor"
79+
- this includes all go deps in our repo, DO NOT edit this directory directly, changes in dependencies must be made in their respective upstream repositories and then updated in go.mod
80+
81+
#### bin/
82+
83+
- build binaries are put here (bin/podman, bin/podman-remote, etc...)

0 commit comments

Comments
 (0)