Add new camli/search package and start of interface.

This commit is contained in:
Brad Fitzpatrick 2011-03-13 16:10:15 -07:00
parent 6a661c9d42
commit 195987bb1b
3 changed files with 47 additions and 0 deletions

View File

@ -314,6 +314,9 @@ TARGET: lib/go/blobserver
- lib/go/blobref
- lib/go/testing
TARGET: lib/go/search
- lib/go/blobref
TARGET: lib/go/blobserver/handlers
- server/go/auth
- server/go/httputil

9
lib/go/search/Makefile Normal file
View File

@ -0,0 +1,9 @@
include $(GOROOT)/src/Make.inc
PREREQ=$(QUOTED_GOROOT)/pkg/$(GOOS)_$(GOARCH)/camli/blobref.a
TARG=camli/search
GOFILES=\
search.go\
include $(GOROOT)/src/Make.pkg

35
lib/go/search/search.go Normal file
View File

@ -0,0 +1,35 @@
/*
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package search
import (
"camli/blobref"
"os"
)
type Result struct {
BlobRef *blobref.BlobRef
LastModTime int64 // nanos since epoch
}
type Index interface {
// dest is closed
// limit is <= 0 for default. smallest possible default is 0
GetRecentPermanodes(dest chan *Result,
owner []*blobref.BlobRef,
limit int) os.Error
}