Documentation ¶
Index ¶
- Variables
- func Condition(meta *client.RequestMeta, condition *client.QueryMetaData, ...) error
- func GetListItemObj(listObj runtime.Object) (listPtr interface{}, itemObj runtime.Object, err error)
- func GetObjKind(objPtr runtime.Object) string
- func New(sess *mgo.Session, dbName string, codec runtime.Codec) storage.Interface
- type APIObjectVersioner
- func (a APIObjectVersioner) CompareResourceVersion(lhs, rhs runtime.Object) int
- func (a APIObjectVersioner) ObjectResourceVersion(obj runtime.Object) (uint64, error)
- func (a APIObjectVersioner) ParseListResourceVersion(resourceVersion string) (uint64, error)
- func (a APIObjectVersioner) ParseResourceVersion(resourceVersion string) (uint64, error)
- func (a APIObjectVersioner) ParseWatchResourceVersion(resourceVersion string) (uint64, error)
- func (a APIObjectVersioner) PrepareObjectForStorage(obj runtime.Object) error
- func (a APIObjectVersioner) UpdateList(obj runtime.Object, resourceVersion uint64, nextKey string, count *int64) error
- func (a APIObjectVersioner) UpdateObject(obj runtime.Object, resourceVersion uint64) error
- type Collection
- type DocObject
- type Document
Constants ¶
This section is empty.
Variables ¶
var ( //2200.01.01.00 as a forever ttl TTLForever = time.Date(2200, time.Month(1), 1, 0, 0, 0, 0, time.UTC) )
var Versioner storage.Versioner = APIObjectVersioner{}
APIObjectVersioner implements Versioner
Functions ¶
func Condition ¶
func Condition(meta *client.RequestMeta, condition *client.QueryMetaData, p storage.SelectionPredicate) error
func GetListItemObj ¶
func GetObjKind ¶
Types ¶
type APIObjectVersioner ¶
type APIObjectVersioner struct{}
APIObjectVersioner implements versioning and extracting mysql node information for objects that have an embedded ObjectMeta or ListMeta field.
func (APIObjectVersioner) CompareResourceVersion ¶
func (a APIObjectVersioner) CompareResourceVersion(lhs, rhs runtime.Object) int
CompareResourceVersion compares etcd resource versions. Outside this API they are all strings, but etcd resource versions are special, they're actually ints, so we can easily compare them.
func (APIObjectVersioner) ObjectResourceVersion ¶
func (a APIObjectVersioner) ObjectResourceVersion(obj runtime.Object) (uint64, error)
ObjectResourceVersion implements Versioner
func (APIObjectVersioner) ParseListResourceVersion ¶
func (a APIObjectVersioner) ParseListResourceVersion(resourceVersion string) (uint64, error)
ParseListResourceVersion takes a resource version argument and converts it to the etcd version. TODO: reevaluate whether it is really clearer to have both this and the Watch version of this function, since they perform the same logic.
func (APIObjectVersioner) ParseResourceVersion ¶
func (a APIObjectVersioner) ParseResourceVersion(resourceVersion string) (uint64, error)
ParseResourceVersion takes a resource version argument and converts it to the etcd version. For watch we should pass to helper.Watch(). Because resourceVersion is an opaque value, the default watch behavior for non-zero watch is to watch the next value (if you pass "1", you will see updates from "2" onwards).
func (APIObjectVersioner) ParseWatchResourceVersion ¶
func (a APIObjectVersioner) ParseWatchResourceVersion(resourceVersion string) (uint64, error)
ParseWatchResourceVersion takes a resource version argument and converts it to the etcd version we should pass to helper.Watch(). Because resourceVersion is an opaque value, the default watch behavior for non-zero watch is to watch the next value (if you pass "1", you will see updates from "2" onwards).
func (APIObjectVersioner) PrepareObjectForStorage ¶
func (a APIObjectVersioner) PrepareObjectForStorage(obj runtime.Object) error
PrepareObjectForStorage clears resource version and self link prior to writing to etcd.
func (APIObjectVersioner) UpdateList ¶
func (a APIObjectVersioner) UpdateList(obj runtime.Object, resourceVersion uint64, nextKey string, count *int64) error
UpdateList implements Versioner
func (APIObjectVersioner) UpdateObject ¶
func (a APIObjectVersioner) UpdateObject(obj runtime.Object, resourceVersion uint64) error
UpdateObject implements Versioner
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
func GetCollection ¶
func (*Collection) CreateIndex ¶
func (c *Collection) CreateIndex(meta *client.RequestMeta) error
CreateIndex by runtime object
func (*Collection) GetRequestMeta ¶
func (c *Collection) GetRequestMeta(sess *mgo.Session) *client.RequestMeta