Documentation ¶
Overview ¶
Package actions contains the definition of the Session which is used in all of the Hoard actions.
The actions themselves (download, merge, audit, etc.) are defined in subpackages.
Index ¶
- Constants
- type Session
- func (s *Session) Ctx() context.Context
- func (s *Session) Feed() *config.Feed
- func (s *Session) LocalAStore() storage.AStore
- func (s *Session) LocalDStore() storage.DStore
- func (s *Session) Log() *logrus.Entry
- func (s *Session) LogWithHour(h hour.Hour) *logrus.Entry
- func (s *Session) RemoteAStore() *astore.ReplicatedAStore
- func (s *Session) TempAStore() (storage.AStore, func() error)
- func (s *Session) TempDStore() (storage.DStore, func() error)
Constants ¶
const ArchivesSubDir = "archives"
const DownloadsSubDir = "downloads"
const TmpSubDir = "tmp"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session contains all the necessary pieces for performing actions in Hoard. Each action takes the Session as an input parameter and then uses the pieces it needs.
The Session is a per-feed construct. Hoard's simple model for taking advantage of multiple CPUs is to to run operations for each feed in separate goroutines. Each of these goroutines is provided with the Session corresponding to its feed.
func NewInMemorySession ¶
NewInMemorySession creates a new session in which all data is stored in-memory. This session is used for testing.
func NewSession ¶
func NewSession(feed *config.Feed, c *config.Config, log *logrus.Logger, ctx context.Context, enableMonitoring bool) *Session
NewSession creates a new Session for production code.
In this session, local stores are based on the filesystem, rooted at the provided workspace. The remote AStore is based on the remote object storage configured in the configuration file.
func (*Session) LocalAStore ¶
LocalAStore returns the AStore based on the local filesystem.
func (*Session) LocalDStore ¶
LocalDStore returns the DStore based on the local filesystem.
func (*Session) LogWithHour ¶
LogWithHour returns an object used for logging information about a specific hour in this session
func (*Session) RemoteAStore ¶
func (s *Session) RemoteAStore() *astore.ReplicatedAStore
RemoteAStore returns the AStore based on remote object storage. The boolean return value is false if not object storage has been configured - in this case, the AStore will be nil.
func (*Session) TempAStore ¶
TempDStore creates a new temporary AStore and returns its. The second return value is a closer function that must be invoked to clean up the AStore.
Directories ¶
Path | Synopsis |
---|---|
Package audit contains the audit action.
|
Package audit contains the audit action. |
Package download contains the download action.
|
Package download contains the download action. |
Package merge contains the merge action.
|
Package merge contains the merge action. |
Package pack contains the pack action.
|
Package pack contains the pack action. |
Package retrieve contains the retrieve action.
|
Package retrieve contains the retrieve action. |
Package upload contains the upload action.
|
Package upload contains the upload action. |