Documentation
¶
Index ¶
- type Bucket
- func (b *Bucket) AddPatch(patch Patch) error
- func (b *Bucket) Compress() error
- func (b *Bucket) Download() error
- func (b *Bucket) Hash() error
- func (b *Bucket) Init() error
- func (b *Bucket) IsFull() (bool, error)
- func (b *Bucket) Unzip() error
- func (b *Bucket) Upload(public bool) error
- func (b *Bucket) VerifyUnzipped() error
- func (b *Bucket) VerifyZipped() error
- type Categories
- type CategoriesItem
- type Config
- type DefaultPatch
- type ErrorHandler
- type Logger
- type Master
- func (m *Master) AddPatch(patch Patch) error
- func (m *Master) CalculateWastage() (int, error)
- func (m *Master) CleanupOldFiles() error
- func (m *Master) CleanupOldLocalFiles() error
- func (m *Master) Close()
- func (m *Master) CompileList() (map[string][]string, error)
- func (m *Master) Download() error
- func (m *Master) DownloadBuckets() error
- func (m *Master) Init() error
- func (m *Master) InitCategories() error
- func (m *Master) UploadToStorageBucket() error
- type Patch
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket struct {
StorageBucketName string
RelativeFilePath string
RemoteFilePath string
Dir string
Number int
FileName string
File *os.File
ZippedFileName string
ZippedFile *os.File
IsChanged bool
IsDeleted bool
ZippedHash string
UnzippedHash string
PatchCount int
Validation func(line []string, bucket *Bucket) error
Patches []Patch
ErrorHandler ErrorHandler
Logger Logger
Storage Storage
}
func (*Bucket) VerifyUnzipped ¶
func (*Bucket) VerifyZipped ¶
type Categories ¶
type Categories struct {
StorageBucketName string
RelativeFilePath string
RemoteFilePath string
Dir string
FileName string
File *os.File
ZippedFileName string
ZippedFile *os.File
ZippedHash string
UnzippedHash string
CategoryItems []CategoriesItem
ErrorHandler ErrorHandler
Logger Logger
Storage Storage
}
func NewCategories ¶
func NewCategories( errorHandler ErrorHandler, logger Logger, storage Storage, storageBucketName, relativeFilePath, remoteFilePath, dir string, zippedHash, unzippedHash string, categoryItems []CategoriesItem, ) *Categories
func (*Categories) Compress ¶
func (c *Categories) Compress() error
func (*Categories) Download ¶
func (c *Categories) Download() error
func (*Categories) Hash ¶
func (c *Categories) Hash() error
func (*Categories) Init ¶
func (c *Categories) Init() error
func (*Categories) IsChanged ¶
func (c *Categories) IsChanged() (bool, error)
func (*Categories) Upload ¶
func (c *Categories) Upload(public bool) error
func (*Categories) Write ¶
func (c *Categories) Write() error
type CategoriesItem ¶
type DefaultPatch ¶
func (*DefaultPatch) GetAction ¶
func (d *DefaultPatch) GetAction() string
func (*DefaultPatch) GetKey ¶
func (d *DefaultPatch) GetKey() string
func (*DefaultPatch) GetValues ¶
func (d *DefaultPatch) GetValues() []string
type ErrorHandler ¶
type ErrorHandler interface {
Error(e error)
}
type Master ¶
type Master struct {
StorageBucketName string
RemoteDir string
Dir string
FileName string
Public bool
File *os.File
Categories *Categories
CategoryItems []CategoriesItem
IsChanged bool
Version string
UnixTime int64
DateTime string
Validation func(line []string, bucket *Bucket) error
Buckets []*Bucket
ErrorHandler ErrorHandler
Logger Logger
Storage Storage
}
func (*Master) CalculateWastage ¶
func (*Master) CleanupOldFiles ¶
func (*Master) CleanupOldLocalFiles ¶ added in v0.0.2
func (*Master) DownloadBuckets ¶
func (*Master) InitCategories ¶
func (*Master) UploadToStorageBucket ¶
type Storage ¶
type Storage interface {
DownloadWriter(bucket string, name string, writer io.Writer) error
GetUploadWriter(bucket string, name string) (*storage.Writer, error)
MakePublic(bucket string, name string) error
GetDownloadReader(bucket string, name string) (io.ReadCloser, error)
Ls(bucket string, dir string) ([]*storage.ObjectAttrs, error)
Delete(bucket string, filePath string) error
}
Click to show internal directories.
Click to hide internal directories.