github.com/slspeek/camlistore_namedsearch@v0.0.0-20140519202248-ed6f70f7721a/cmd/camput/discard.go (about) 1 /* 2 Copyright 2014 The Camlistore Authors 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package main 18 19 import ( 20 "io" 21 "io/ioutil" 22 23 "camlistore.org/pkg/blob" 24 "camlistore.org/pkg/blobserver" 25 "camlistore.org/pkg/context" 26 ) 27 28 type discardStorage struct { 29 blobserver.NoImplStorage 30 } 31 32 func (discardStorage) ReceiveBlob(br blob.Ref, r io.Reader) (sb blob.SizedRef, err error) { 33 n, err := io.Copy(ioutil.Discard, r) 34 return blob.SizedRef{br, uint32(n)}, err 35 } 36 37 func (discardStorage) StatBlobs(dest chan<- blob.SizedRef, blobs []blob.Ref) error { 38 return nil 39 } 40 41 func (discardStorage) EnumerateBlobs(ctx *context.Context, dest chan<- blob.SizedRef, after string, limit int) error { 42 defer close(dest) 43 return nil 44 } 45 46 func (discardStorage) RemoveBlobs(blobs []blob.Ref) error { 47 return nil 48 }