]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blame - vendor/github.com/fsouza/go-dockerclient/change.go
provider: Ensured Go 1.11 in TravisCI and README
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / fsouza / go-dockerclient / change.go
CommitLineData
9b12e4fe
JC
1// Copyright 2014 go-dockerclient authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package docker
6
7import "fmt"
8
9// ChangeType is a type for constants indicating the type of change
10// in a container
11type ChangeType int
12
13const (
14 // ChangeModify is the ChangeType for container modifications
15 ChangeModify ChangeType = iota
16
17 // ChangeAdd is the ChangeType for additions to a container
18 ChangeAdd
19
20 // ChangeDelete is the ChangeType for deletions from a container
21 ChangeDelete
22)
23
24// Change represents a change in a container.
25//
26// See https://goo.gl/9GsTIF for more details.
27type Change struct {
28 Path string
29 Kind ChangeType
30}
31
32func (change *Change) String() string {
33 var kind string
34 switch change.Kind {
35 case ChangeModify:
36 kind = "C"
37 case ChangeAdd:
38 kind = "A"
39 case ChangeDelete:
40 kind = "D"
41 }
42 return fmt.Sprintf("%s %s", kind, change.Path)
43}