示例#1
0
func (self *metadataStruct) TypedGetterSetter(id bucket.Id) (
	ret *metadata.TypedGetterSetter, err error) {
	readerWriter, err := self.GetterSetter(id)
	if err != nil {
		return
	}
	return metadata.NewTyped(readerWriter), nil
}
示例#2
0
func validateSystemChange(change metadata.SingleValueGetterSetter) (err error) {
	changeDetector := metadata.ChangeDetector(change)
	switch changeDetector.Change() {
	case metadata.Change_PutReceiver:
		typed := metadata.NewTyped(&change)
		// If everything is ok, we can read them
		_, err = typed.PutReceivers()
	default:
		err = errors.New(fmt.Sprintf("Key %v is not known to the system. "+
			"Change rejected.", change.Key))
	}
	return
}
示例#3
0
func (self *metadataStruct) NewMemoryTypedReaderWriter(
	memoryMetadata metadata.MemoryMetadata) (readerWriter *metadata.TypedGetterSetter) {
	return metadata.NewTyped(&memoryMetadata)
}