Add Event Registry/REST types

SGTM

On Mon, Oct 13, 2014 at 2:31 PM, Daniel Smith <notifications@github.com>
wrote:

> In pkg/registry/event/registry.go:
>
> > +
> > +// registry implements custom changes to generic.Etcd.
> > +type registry struct {
> > +	*etcdgeneric.Etcd
> > +	ttl uint64
> > +}
> > +
> > +// Create stores the object with a ttl, so that events don't stay in the system forever.
> > +func (r registry) Create(ctx api.Context, id string, obj runtime.Object) error {
> > +	err := r.Etcd.Helper.CreateObj(r.Etcd.KeyFunc(id), obj, r.ttl)
> > +	return etcderr.InterpretCreateError(err, r.Etcd.EndpointName, id)
> > +}
> > +
> > +// NewEtcdRegistry returns a registry which will store Events in the given
> > +// EtcdHelper. ttl is the time that Events will be retained by the system.
> > +func NewEtcdRegistry(h tools.EtcdHelper, ttl uint64) generic.Registry {
>
> (offline convo: resolution here is that tools.EtcdHelper should be hidden
> behind some sort of StorageHelper interface. I'll do this in a follow-up PR
> at some point.)
>
> --
> Reply to this email directly or view it on GitHub
> <https://github.com/GoogleCloudPlatform/kubernetes/pull/1700/files#r18796285>
> .
>