Home Download Docs Code Community
     1	/*
     2	Copyright 2011 The Perkeep 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 blobserver
    18	
    19	import (
    20		"context"
    21		"errors"
    22		"io"
    23		"os"
    24	
    25		"perkeep.org/pkg/blob"
    26	)
    27	
    28	// NoImplStorage is an implementation of Storage that returns a not
    29	// implemented error for all operations.
    30	type NoImplStorage struct{}
    31	
    32	var _ Storage = NoImplStorage{}
    33	
    34	func (NoImplStorage) Fetch(context.Context, blob.Ref) (file io.ReadCloser, size uint32, err error) {
    35		return nil, 0, os.ErrNotExist
    36	}
    37	
    38	func (NoImplStorage) ReceiveBlob(context.Context, blob.Ref, io.Reader) (sb blob.SizedRef, err error) {
    39		err = errors.New("ReceiveBlob not implemented")
    40		return
    41	}
    42	
    43	func (NoImplStorage) StatBlobs(ctx context.Context, blobs []blob.Ref, fn func(blob.SizedRef) error) error {
    44		return errors.New("Stat not implemented")
    45	}
    46	
    47	func (NoImplStorage) EnumerateBlobs(ctx context.Context, dest chan<- blob.SizedRef, after string, limit int) error {
    48		close(dest)
    49		return errors.New("EnumerateBlobs not implemented")
    50	}
    51	
    52	func (NoImplStorage) RemoveBlobs(ctx context.Context, blobs []blob.Ref) error {
    53		return errors.New("Remove not implemented")
    54	}
Website layout inspired by memcached.
Content by the authors.