mirror of
https://github.com/containers/podman.git
synced 2025-07-02 08:47:43 +08:00
Generate varlink API documentation automatically
Using varlink's idl parser, we generate API documentation for the podman API relying on the .varlink file as the source. Signed-off-by: baude <bbaude@redhat.com> Closes: #734 Approved by: baude
This commit is contained in:
@ -9,6 +9,7 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/containers/storage/pkg/archive"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/projectatomic/libpod/cmd/podman/batchcontainer"
|
||||
"github.com/projectatomic/libpod/cmd/podman/libpodruntime"
|
||||
@ -195,12 +196,18 @@ func (i *LibpodAPI) ListContainerChanges(call ioprojectatomicpodman.VarlinkCall,
|
||||
if err != nil {
|
||||
return call.ReplyErrorOccurred(err.Error())
|
||||
}
|
||||
|
||||
m := make(map[string]string)
|
||||
result := ioprojectatomicpodman.ContainerChanges{}
|
||||
for _, change := range changes {
|
||||
m[change.Path] = change.Kind.String()
|
||||
switch change.Kind {
|
||||
case archive.ChangeModify:
|
||||
result.Changed = append(result.Changed, change.Path)
|
||||
case archive.ChangeDelete:
|
||||
result.Deleted = append(result.Deleted, change.Path)
|
||||
case archive.ChangeAdd:
|
||||
result.Added = append(result.Added, change.Path)
|
||||
}
|
||||
}
|
||||
return call.ReplyListContainerChanges(m)
|
||||
return call.ReplyListContainerChanges(result)
|
||||
}
|
||||
|
||||
// ExportContainer ...
|
||||
|
Reference in New Issue
Block a user