Documentation ¶
Overview ¶
Package sakuin
Index ¶
- Variables
- func ReadParts(r io.Reader, contentType string) (metadata json.RawMessage, object []byte, err error)
- func RunDocumentStorageTests(t TestingT, docStore DocumentStore)
- func RunObjectStorageTests(t TestingT, objStore ObjectStore)
- type Config
- type ContentTypeError
- type DocumentDoesNotExistErr
- type DocumentStore
- type InMemoryDocumentStore
- func (s *InMemoryDocumentStore) Get(ctx context.Context, id string) (map[string]interface{}, error)
- func (s *InMemoryDocumentStore) NumOfDocs() int
- func (s *InMemoryDocumentStore) Stat(ctx context.Context, id string) (*StatInfo, error)
- func (s *InMemoryDocumentStore) Upsert(ctx context.Context, id string, doc map[string]interface{}) error
- func (s *InMemoryDocumentStore) WithDocument(id string, doc map[string]interface{}) *InMemoryDocumentStore
- type InMemoryObjectStore
- func (s *InMemoryObjectStore) Get(ctx context.Context, id string) ([]byte, error)
- func (s *InMemoryObjectStore) NumOfObects() int
- func (s *InMemoryObjectStore) Put(ctx context.Context, id string, b []byte) error
- func (s *InMemoryObjectStore) Stat(ctx context.Context, id string) (*StatInfo, error)
- func (s *InMemoryObjectStore) Update(ctx context.Context, id string, b []byte) error
- func (s *InMemoryObjectStore) WithObject(id string, obj []byte) *InMemoryObjectStore
- type ObjectDoesNotExistErr
- type ObjectStore
- type Service
- func (s *Service) GetMetadata(ctx context.Context, req *pb.GetMetadataRequest) (*pb.GetMetadataResponse, error)
- func (s *Service) GetObject(ctx context.Context, req *pb.GetObjectRequest) (*pb.GetObjectResponse, error)
- func (s *Service) Index(ctx context.Context, req *pb.IndexRequest) (*pb.IndexResponse, error)
- func (s *Service) UpdateMetadata(ctx context.Context, req *pb.UpdateMetadataRequest) (*pb.UpdateMetadataResponse, error)
- func (s *Service) UpdateObject(ctx context.Context, req *pb.UpdateObjectRequest) (*pb.UpdateObjectResponse, error)
- type StatInfo
- type TestingT
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMissingBoundary = errors.New("missing boundary")
ErrMissingBoundary represents a boundary value missing in a multipart form body.
Functions ¶
func ReadParts ¶
func ReadParts(r io.Reader, contentType string) (metadata json.RawMessage, object []byte, err error)
ReadParts
func RunDocumentStorageTests ¶
func RunDocumentStorageTests(t TestingT, docStore DocumentStore)
func RunObjectStorageTests ¶
func RunObjectStorageTests(t TestingT, objStore ObjectStore)
Types ¶
type Config ¶
type Config struct { ObjectStore ObjectStore DocumentStore DocumentStore RandSrc io.Reader }
type ContentTypeError ¶
type ContentTypeError struct {
ContentType string
}
func (ContentTypeError) Error ¶
func (e ContentTypeError) Error() string
type DocumentDoesNotExistErr ¶
type DocumentDoesNotExistErr struct {
ID string
}
func (DocumentDoesNotExistErr) Error ¶
func (e DocumentDoesNotExistErr) Error() string
type DocumentStore ¶
type InMemoryDocumentStore ¶
type InMemoryDocumentStore struct {
// contains filtered or unexported fields
}
func NewInMemoryDocumentStore ¶
func NewInMemoryDocumentStore() *InMemoryDocumentStore
func (*InMemoryDocumentStore) NumOfDocs ¶
func (s *InMemoryDocumentStore) NumOfDocs() int
func (*InMemoryDocumentStore) WithDocument ¶
func (s *InMemoryDocumentStore) WithDocument(id string, doc map[string]interface{}) *InMemoryDocumentStore
type InMemoryObjectStore ¶
type InMemoryObjectStore struct {
// contains filtered or unexported fields
}
func NewInMemoryObjectStore ¶
func NewInMemoryObjectStore() *InMemoryObjectStore
func (*InMemoryObjectStore) NumOfObects ¶
func (s *InMemoryObjectStore) NumOfObects() int
func (*InMemoryObjectStore) WithObject ¶
func (s *InMemoryObjectStore) WithObject(id string, obj []byte) *InMemoryObjectStore
type ObjectDoesNotExistErr ¶
type ObjectDoesNotExistErr struct {
ID string
}
func (ObjectDoesNotExistErr) Error ¶
func (e ObjectDoesNotExistErr) Error() string
type ObjectStore ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) GetMetadata ¶
func (s *Service) GetMetadata(ctx context.Context, req *pb.GetMetadataRequest) (*pb.GetMetadataResponse, error)
func (*Service) GetObject ¶
func (s *Service) GetObject(ctx context.Context, req *pb.GetObjectRequest) (*pb.GetObjectResponse, error)
func (*Service) Index ¶
func (s *Service) Index(ctx context.Context, req *pb.IndexRequest) (*pb.IndexResponse, error)
func (*Service) UpdateMetadata ¶
func (s *Service) UpdateMetadata(ctx context.Context, req *pb.UpdateMetadataRequest) (*pb.UpdateMetadataResponse, error)
func (*Service) UpdateObject ¶
func (s *Service) UpdateObject(ctx context.Context, req *pb.UpdateObjectRequest) (*pb.UpdateObjectResponse, error)
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Package http
|
Package http |
middleware/logger
Package logger
|
Package logger |
Click to show internal directories.
Click to hide internal directories.