Documentation ¶
Index ¶
- type Cleaner
- type Emoji
- func (e *Emoji) All(ctx context.Context, maxRemoteDays int)
- func (e *Emoji) FixBroken(ctx context.Context) (int, error)
- func (e *Emoji) FixCacheStates(ctx context.Context) (int, error)
- func (e *Emoji) LogFixBroken(ctx context.Context)
- func (e *Emoji) LogFixCacheStates(ctx context.Context)
- func (e *Emoji) LogPruneUnused(ctx context.Context)
- func (e *Emoji) LogUncacheRemote(ctx context.Context, olderThan time.Time)
- func (e *Emoji) PruneUnused(ctx context.Context) (int, error)
- func (e *Emoji) UncacheRemote(ctx context.Context, olderThan time.Time) (int, error)
- type Media
- func (m *Media) All(ctx context.Context, maxRemoteDays int)
- func (m *Media) FixCacheStates(ctx context.Context) (int, error)
- func (m *Media) LogFixCacheStates(ctx context.Context)
- func (m *Media) LogPruneOrphaned(ctx context.Context)
- func (m *Media) LogPruneUnused(ctx context.Context)
- func (m *Media) LogUncacheRemote(ctx context.Context, olderThan time.Time)
- func (m *Media) PruneOrphaned(ctx context.Context) (int, error)
- func (m *Media) PruneUnused(ctx context.Context) (int, error)
- func (m *Media) UncacheRemote(ctx context.Context, olderThan time.Time) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cleaner ¶
type Cleaner struct {
// contains filtered or unexported fields
}
type Emoji ¶
type Emoji struct {
*Cleaner
}
Emoji encompasses a set of emoji cleanup / admin utils.
func (*Emoji) All ¶
All will execute all cleaner.Emoji utilities synchronously, including output logging. Context will be checked for `gtscontext.DryRun()` in order to actually perform the action.
func (*Emoji) FixBroken ¶
FixBroken will check all emojis for valid related models (e.g. category). Broken media will be automatically updated to remove now-missing models. Context will be checked for `gtscontext.DryRun()` to perform the action.
func (*Emoji) FixCacheStates ¶ added in v0.11.0
FixCacheStatus will check all emoji for up-to-date cache status (i.e. in storage driver). Context will be checked for `gtscontext.DryRun()` to perform the action. NOTE: this function should be updated to match media.FixCacheStat() if we ever support emoji uncaching.
func (*Emoji) LogFixBroken ¶
LogFixBroken performs Emoji.FixBroken(...), logging the start and outcome.
func (*Emoji) LogFixCacheStates ¶ added in v0.11.0
LogFixCacheStates performs Emoji.FixCacheStates(...), logging the start and outcome.
func (*Emoji) LogPruneUnused ¶ added in v0.11.0
LogPruneUnused performs Emoji.PruneUnused(...), logging the start and outcome.
func (*Emoji) LogUncacheRemote ¶ added in v0.11.0
LogUncacheRemote performs Emoji.UncacheRemote(...), logging the start and outcome.
func (*Emoji) PruneUnused ¶ added in v0.11.0
PruneUnused will delete all unused emoji media from the database and storage driver. Context will be checked for `gtscontext.DryRun()` to perform the action. NOTE: this function should be updated to match media.FixCacheStat() if we ever support emoji uncaching.
type Media ¶
type Media struct {
*Cleaner
}
Media encompasses a set of media cleanup / admin utils.
func (*Media) All ¶
All will execute all cleaner.Media utilities synchronously, including output logging. Context will be checked for `gtscontext.DryRun()` in order to actually perform the action.
func (*Media) FixCacheStates ¶
FixCacheStatus will check all media for up-to-date cache status (i.e. in storage driver). Media marked as cached, with any required files missing, will be automatically uncached. Context will be checked for `gtscontext.DryRun()` in order to actually perform the action.
func (*Media) LogFixCacheStates ¶
LogFixCacheStates performs Media.FixCacheStates(...), logging the start and outcome.
func (*Media) LogPruneOrphaned ¶
LogPruneOrphaned performs Media.PruneOrphaned(...), logging the start and outcome.
func (*Media) LogPruneUnused ¶
LogPruneUnused performs Media.PruneUnused(...), logging the start and outcome.
func (*Media) LogUncacheRemote ¶
LogUncacheRemote performs Media.UncacheRemote(...), logging the start and outcome.
func (*Media) PruneOrphaned ¶
PruneOrphaned will delete orphaned files from storage (i.e. media missing a database entry). Context will be checked for `gtscontext.DryRun()` in order to actually perform the action.
func (*Media) PruneUnused ¶
PruneUnused will delete all unused media attachments from the database and storage driver. Media is marked as unused if not attached to any status, account or account is suspended. Context will be checked for `gtscontext.DryRun()` in order to actually perform the action.