diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2018-02-07 22:17:47 +0100 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2018-02-07 22:17:47 +0100 |
| commit | a4f40bee33f2c8094d2e0315c89ded2d6b0ba95d (patch) | |
| tree | b24e1e3d49f391adcd1e2f76147d8e071ee8d958 /account.go | |
| parent | 142c2d352c26c26ad0b438977a74119b994d6775 (diff) | |
| download | go-schwift-a4f40bee33f2c8094d2e0315c89ded2d6b0ba95d.tar.gz | |
implement container listing
Tests will follow sometime later this week.
Diffstat (limited to 'account.go')
| -rw-r--r-- | account.go | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -148,4 +148,24 @@ func (a *Account) Create(headers AccountHeaders, opts *RequestOptions) error { return err } -// TODO container listing +//Containers returns a ContainerIterator that lists the containers in this +//account. The most common use case is: +// +// containers, err := account.Containers().Collect() +// +//You can extend this by configuring the iterator before collecting the results: +// +// iter := account.Containers() +// iter.Prefix = "test-" +// containers, err := iter.Collect() +// +//Or you can use a different iteration method: +// +// err := account.Containers().ForeachDetailed(func (ci ContainerInfo) error { +// log.Printf("container %s contains %d objects!\n", +// ci.Container.Name(), ci.ObjectCount) +// }) +// +func (a *Account) Containers() *ContainerIterator { + return &ContainerIterator{Account: a} +} |
