func namespaceMod(m proto.Message, namespace string) { // pb.Query is the only type that has a name_space field. // All other namespace support in datastore is in the keys. switch m := m.(type) { case *pb.Query: if m.NameSpace == nil { m.NameSpace = &namespace } } }
func namespaceMod(m proto.Message, namespace string) { switch m := m.(type) { case *pb.MemcacheDeleteRequest: if m.NameSpace == nil { m.NameSpace = &namespace } case *pb.MemcacheGetRequest: if m.NameSpace == nil { m.NameSpace = &namespace } case *pb.MemcacheIncrementRequest: if m.NameSpace == nil { m.NameSpace = &namespace } case *pb.MemcacheSetRequest: if m.NameSpace == nil { m.NameSpace = &namespace } // MemcacheFlushRequest, MemcacheStatsRequest do not apply namespace. } }