func (db *DB) GetAttachmentMeta(ctx context.Context, docID, rev, filename string) (*Attachment, error) {
	if metaer, ok := db.driverDB.(driver.AttachmentMetaer); ok {
		cType, md5sum, err := metaer.GetAttachmentMeta(ctx, docID, rev, filename)
		if err != nil {
			return nil, err
		}
		return &Attachment{
			Filename:    filename,
			ContentType: cType,
			MD5:         MD5sum(md5sum),
		}, nil
	}
	att, err := db.GetAttachment(ctx, docID, rev, filename)
	if err != nil {
		return nil, err
	}
	_ = att.Close()
	return &Attachment{
		Filename:    att.Filename,
		ContentType: att.ContentType,
		MD5:         att.MD5,
	}, nil
}
// GetAttachmentMeta returns meta data about an attachment. The attachment
// content returned will be empty.
GetAttachmentMeta returns meta data about an attachment. The attachment
content returned will be empty.
// GetAttachmentMeta returns meta data about an attachment . The attachment // content returned will be empty .
func (db *DB) GetAttachmentMeta(ctx context.Context, docID, rev, filename string) (*Attachment, error) {
	if metaer, ok := db.driverDB.(driver.AttachmentMetaer); ok {
		cType, md5sum, err := metaer.GetAttachmentMeta(ctx, docID, rev, filename)
		if err != nil {
			return nil, err
		}
		return &Attachment{
			Filename:    filename,
			ContentType: cType,
			MD5:         MD5sum(md5sum),
		}, nil
	}
	att, err := db.GetAttachment(ctx, docID, rev, filename)
	if err != nil {
		return nil, err
	}
	_ = att.Close()
	return &Attachment{
		Filename:    att.Filename,
		ContentType: att.ContentType,
		MD5:         att.MD5,
	}, nil
}
func ( db * DB ) GetAttachmentMeta ( ctx context . Context , docID , rev , filename string ) ( * Attachment , error ) { if metaer , ok := db . driverDB . ( driver . AttachmentMetaer ) ; ok { cType , md5sum , err := metaer . GetAttachmentMeta ( ctx , docID , rev , filename ) if err != nil { return nil , err } return & Attachment { Filename : filename , ContentType : cType , MD5 : MD5sum ( md5sum ) , } , nil } att , err := db . GetAttachment ( ctx , docID , rev , filename ) if err != nil { return nil , err } _ = att . Close ( ) return & Attachment { Filename : att . Filename , ContentType : att . ContentType , MD5 : att . MD5 , } , nil }
GetAttachmentMeta returns meta data about an attachment.
GetAttachmentMeta returns meta data about an attachment .