Merge pull request #239 from jlhawn/event_target_update

notifications: update notification event Target fields
This commit is contained in:
Stephen Day 2015-03-06 16:45:06 -08:00
commit f0ccdd448f
6 changed files with 89 additions and 55 deletions

View file

@ -98,10 +98,12 @@ type Layer interface {
io.ReadSeeker
io.Closer
// Digest returns the unique digest of the blob, which is the tarsum for
// layers.
// Digest returns the unique digest of the blob.
Digest() digest.Digest
// Length returns the length in bytes of the blob.
Length() int64
// CreatedAt returns the time this layer was created.
CreatedAt() time.Time
}
@ -137,3 +139,24 @@ type SignatureService interface {
// Put stores the signature for the provided digest.
Put(dgst digest.Digest, signatures ...[]byte) error
}
// Descriptor describes targeted content. Used in conjunction with a blob
// store, a descriptor can be used to fetch, store and target any kind of
// blob. The struct also describes the wire protocol format. Fields should
// only be added but never changed.
type Descriptor struct {
// MediaType describe the type of the content. All text based formats are
// encoded as utf-8.
MediaType string `json:"mediaType,omitempty"`
// Length in bytes of content.
Length int64 `json:"length,omitempty"`
// Digest uniquely identifies the content. A byte stream can be verified
// against against this digest.
Digest digest.Digest `json:"digest,omitempty"`
// NOTE: Before adding a field here, please ensure that all
// other options have been exhausted. Much of the type relationships
// depend on the simplicity of this type.
}