Documentation ¶
Overview ¶
nntp article storage
Index ¶
- Variables
- type FilesystemStorage
- func (fs FilesystemStorage) ArticleDir() string
- func (fs FilesystemStorage) AttachmentDir() string
- func (fs FilesystemStorage) DeleteArticle(msgid string) (err error)
- func (fs FilesystemStorage) Ensure() (err error)
- func (fs FilesystemStorage) HasArticle(msgid string) (err error)
- func (fs FilesystemStorage) StoreArticle(r io.Reader, msgid string) (fpath string, err error)
- func (fs FilesystemStorage) StoreAttachment(r io.Reader, filename string) (fpath string, err error)
- func (fs FilesystemStorage) String() string
- func (fs FilesystemStorage) TempDir() string
- type Storage
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoSuchArticle = errors.New("no such article")
Functions ¶
This section is empty.
Types ¶
type FilesystemStorage ¶
type FilesystemStorage string
filesystem storage of nntp articles and attachments
func NewFilesytemStorage ¶
func NewFilesytemStorage(dirname string) (fs FilesystemStorage, err error)
create a new filesystem storage directory ensure directory and subdirectories
func (FilesystemStorage) ArticleDir ¶
func (fs FilesystemStorage) ArticleDir() string
get the directory path for articles
func (FilesystemStorage) AttachmentDir ¶
func (fs FilesystemStorage) AttachmentDir() string
get the directory path for attachments
func (FilesystemStorage) DeleteArticle ¶
func (fs FilesystemStorage) DeleteArticle(msgid string) (err error)
func (FilesystemStorage) Ensure ¶
func (fs FilesystemStorage) Ensure() (err error)
ensure the filesystem storage exists and is well formed and read/writable
func (FilesystemStorage) HasArticle ¶
func (fs FilesystemStorage) HasArticle(msgid string) (err error)
check if we have the artilce with this message id
func (FilesystemStorage) StoreArticle ¶
store an article from a reader to disk
func (FilesystemStorage) StoreAttachment ¶
store attachment onto filesystem
func (FilesystemStorage) String ¶
func (fs FilesystemStorage) String() string
func (FilesystemStorage) TempDir ¶
func (fs FilesystemStorage) TempDir() string
get the temp file directory
type Storage ¶
type Storage interface { // store an attachment that we read from an io.Reader // filename is used to hint to store what extension to store it as // returns absolute filepath where attachment was stored and nil on success // returns emtpy string and error if an error ocurred while storing StoreAttachment(r io.Reader, filename string) (string, error) // store an article that we read from an io.Reader // message id is used to hint where the article is stored // returns absolute filepath to where the article was stored and nil on success // returns empty string and error if an error ocurred while storing StoreArticle(r io.Reader, msgid string) (string, error) // return nil if the article with the given message id exists in this storage // return ErrNoSuchArticle if it does not exist or an error if another error occured while checking HasArticle(msgid string) error // delete article from underlying storage DeleteArticle(msgid string) error // ensure the underlying storage backend is created Ensure() error }
storage for nntp articles and attachments
Click to show internal directories.
Click to hide internal directories.