api/types: consolidate types package

To simplify use of types, we have consolidate the packages for the mount
and descriptor protobuf types into a single Go package. We also drop the
versioning from the type packages, as these types will remain the same
between versions.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
Stephen J Day
2017-06-22 19:51:26 -07:00
parent 40f2627ce1
commit 12c0daa9c9
26 changed files with 496 additions and 507 deletions

View File

@@ -25,7 +25,7 @@ import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import google_protobuf1 "github.com/golang/protobuf/ptypes/empty"
import containerd_v1_types "github.com/containerd/containerd/api/types/descriptor"
import containerd_types "github.com/containerd/containerd/api/types"
import (
context "golang.org/x/net/context"
@@ -50,9 +50,9 @@ var _ = math.Inf
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type Image struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Labels map[string]string `protobuf:"bytes,2,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
Target containerd_v1_types.Descriptor `protobuf:"bytes,3,opt,name=target" json:"target"`
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Labels map[string]string `protobuf:"bytes,2,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
Target containerd_types.Descriptor `protobuf:"bytes,3,opt,name=target" json:"target"`
}
func (m *Image) Reset() { *m = Image{} }
@@ -683,7 +683,7 @@ func (this *Image) String() string {
s := strings.Join([]string{`&Image{`,
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
`Labels:` + mapStringForLabels + `,`,
`Target:` + strings.Replace(strings.Replace(this.Target.String(), "Descriptor", "containerd_v1_types.Descriptor", 1), `&`, ``, 1) + `,`,
`Target:` + strings.Replace(strings.Replace(this.Target.String(), "Descriptor", "containerd_types.Descriptor", 1), `&`, ``, 1) + `,`,
`}`,
}, "")
return s
@@ -1662,38 +1662,38 @@ func init() {
}
var fileDescriptorImages = []byte{
// 523 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x4f, 0x6b, 0x13, 0x41,
0x14, 0xcf, 0xe4, 0xcf, 0x82, 0x2f, 0x07, 0xeb, 0x58, 0x4a, 0x58, 0x71, 0x1b, 0x16, 0x85, 0x80,
0x30, 0x6b, 0xe2, 0x45, 0x2b, 0x8a, 0x84, 0xd4, 0x2a, 0x14, 0x0f, 0x11, 0xb5, 0x78, 0xdb, 0x24,
0x2f, 0xeb, 0xd2, 0xcd, 0xce, 0xba, 0x33, 0x59, 0xc8, 0xcd, 0xef, 0xe2, 0x97, 0xc9, 0xd1, 0xa3,
0x27, 0xb5, 0xf9, 0x24, 0xb2, 0x33, 0x13, 0xbb, 0x6d, 0x8a, 0x49, 0xda, 0xdb, 0x9b, 0xe4, 0xf7,
0xef, 0xbd, 0x99, 0x7d, 0xd0, 0x0b, 0x42, 0xf9, 0x65, 0x3a, 0x60, 0x43, 0x3e, 0xf1, 0x86, 0x3c,
0x96, 0x7e, 0x18, 0x63, 0x3a, 0x2a, 0x96, 0x7e, 0x12, 0x7a, 0x02, 0xd3, 0x2c, 0x1c, 0xa2, 0xf0,
0xc2, 0x89, 0x1f, 0xa0, 0xf0, 0xb2, 0xb6, 0xa9, 0x58, 0x92, 0x72, 0xc9, 0xe9, 0xfd, 0x73, 0x3c,
0x5b, 0x62, 0x99, 0x41, 0x64, 0x6d, 0x7b, 0x37, 0xe0, 0x01, 0x57, 0x48, 0x2f, 0xaf, 0x34, 0xc9,
0xbe, 0x17, 0x70, 0x1e, 0x44, 0xe8, 0xa9, 0xd3, 0x60, 0x3a, 0xf6, 0x70, 0x92, 0xc8, 0x99, 0xf9,
0xf3, 0xf5, 0x46, 0xb9, 0xe4, 0x2c, 0x41, 0xe1, 0x8d, 0x50, 0x0c, 0xd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x87, 0x42, 0x4f, 0x40, 0x2c, 0xf3, 0xee, 0x81, 0x35, 0x0e, 0x23, 0x89,
0xa9, 0x99, 0x95, 0x39, 0xb9, 0x27, 0x40, 0x8b, 0x60, 0x13, 0xa2, 0x0b, 0x96, 0xb6, 0x68, 0x10,
0xf5, 0x5c, 0xb6, 0x49, 0x61, 0x98, 0x6e, 0x0b, 0x68, 0x0f, 0x23, 0xbc, 0x34, 0xb7, 0x2b, 0x6e,
0xac, 0xf3, 0xbd, 0x02, 0x96, 0x0e, 0x40, 0xc7, 0x50, 0x39, 0x42, 0x49, 0xd9, 0x1a, 0xbf, 0x4b,
0xef, 0xc0, 0xf6, 0x36, 0xc6, 0x9b, 0x06, 0x4f, 0xa1, 0x9a, 0xb7, 0x4d, 0xd7, 0x7d, 0x07, 0x2b,
0x83, 0xb4, 0xdb, 0x5b, 0x30, 0x8c, 0x19, 0x07, 0x4b, 0xdf, 0x34, 0x5d, 0x47, 0x5e, 0x7d, 0x68,
0x76, 0x67, 0x1b, 0x8a, 0x31, 0x7c, 0x0f, 0x96, 0x1e, 0xfd, 0x5a, 0xc3, 0xd5, 0x1b, 0xb2, 0xf7,
0x98, 0x5e, 0x57, 0x6c, 0xb9, 0xae, 0xd8, 0x61, 0xbe, 0xae, 0xba, 0x27, 0xf3, 0x33, 0xa7, 0xf4,
0xf3, 0xcc, 0x29, 0x7d, 0x5b, 0x38, 0x64, 0xbe, 0x70, 0xc8, 0x8f, 0x85, 0x43, 0xfe, 0x2c, 0x1c,
0xf2, 0xf9, 0xe5, 0x35, 0x57, 0xeb, 0x73, 0x5d, 0x0d, 0x2c, 0xe5, 0xf4, 0xe4, 0x6f, 0x00, 0x00,
0x00, 0xff, 0xff, 0xb3, 0x1d, 0x46, 0xc6, 0xa3, 0x05, 0x00, 0x00,
// 518 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x4f, 0x8b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xa6, 0xdb, 0x02, 0xda, 0xc3, 0x04, 0xaf, 0xcc, 0xed, 0x9a, 0x1b, 0xf3, 0xbf, 0x55, 0xc0,
0xd2, 0x01, 0xe8, 0x08, 0x2a, 0xc7, 0x28, 0x29, 0xdb, 0xe0, 0x77, 0xe5, 0x1d, 0xd8, 0xde, 0xd6,
0x78, 0xd3, 0xe0, 0x19, 0x54, 0x8b, 0xb6, 0xe9, 0xa6, 0x8f, 0x60, 0x6d, 0x90, 0x76, 0x7b, 0x07,
0x86, 0x31, 0xe3, 0x60, 0xe9, 0x9b, 0xa6, 0x9b, 0xc8, 0xeb, 0x0f, 0xcd, 0xf6, 0x77, 0xa1, 0x18,
0xc3, 0x77, 0x60, 0xe9, 0xd1, 0x6f, 0x34, 0x5c, 0xbf, 0x21, 0xfb, 0x80, 0xe9, 0x05, 0xc5, 0x96,
0x0b, 0x8a, 0x1d, 0x15, 0x0b, 0xaa, 0x7b, 0x3a, 0x3f, 0x77, 0x4a, 0x3f, 0xce, 0x9d, 0xd2, 0xd7,
0x85, 0x43, 0xe6, 0x0b, 0x87, 0x7c, 0x5f, 0x38, 0xe4, 0xf7, 0xc2, 0x21, 0x9f, 0x5e, 0xde, 0x70,
0x99, 0x1e, 0xea, 0xaa, 0x6f, 0x29, 0xa7, 0x67, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x1f, 0x0f,
0x7b, 0x86, 0x95, 0x05, 0x00, 0x00,
}

View File

@@ -4,7 +4,7 @@ package containerd.services.images.v1;
import "gogoproto/gogo.proto";
import "google/protobuf/empty.proto";
import "github.com/containerd/containerd/api/types/descriptor/descriptor.proto";
import "github.com/containerd/containerd/api/types/descriptor.proto";
option go_package = "github.com/containerd/containerd/api/services/images/v1;images";
@@ -37,7 +37,7 @@ service Images {
message Image {
string name = 1;
map<string, string> labels = 2;
containerd.v1.types.Descriptor target = 3 [(gogoproto.nullable) = false];
containerd.types.Descriptor target = 3 [(gogoproto.nullable) = false];
}
message GetImageRequest {