Move status into a seperate package
This commit is contained in:
parent
4752c0fcec
commit
3fada6ad38
23 changed files with 220 additions and 197 deletions
|
|
@ -3,6 +3,7 @@ package info
|
|||
import (
|
||||
"time"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/status"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/wisski/ingredient"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/wisski/ingredient/php"
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/lazy"
|
||||
|
|
@ -13,16 +14,16 @@ type Info struct {
|
|||
ingredient.Base
|
||||
|
||||
PHP *php.PHP
|
||||
Fetchers []ingredient.Fetcher
|
||||
Fetchers []ingredient.WissKIFetcher
|
||||
|
||||
Analytics *lazy.PoolAnalytics
|
||||
}
|
||||
|
||||
// Information fetches information about this WissKI.
|
||||
// TODO: Rework this to be able to determine what kind of information is available.
|
||||
func (wisski *Info) Information(quick bool) (info ingredient.Information, err error) {
|
||||
func (wisski *Info) Information(quick bool) (info status.Information, err error) {
|
||||
// setup flags
|
||||
flags := ingredient.FetchFlags{
|
||||
flags := ingredient.FetcherFlags{
|
||||
Quick: quick,
|
||||
}
|
||||
|
||||
|
|
@ -47,7 +48,7 @@ func (wisski *Info) Information(quick bool) (info ingredient.Information, err er
|
|||
return
|
||||
}
|
||||
|
||||
func (wisski *Info) Fetch(flags ingredient.FetchFlags, info *ingredient.Information) error {
|
||||
func (wisski *Info) Fetch(flags ingredient.FetcherFlags, info *status.Information) error {
|
||||
info.Time = time.Now().UTC()
|
||||
info.Slug = wisski.Slug
|
||||
info.URL = wisski.URL().String()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package info
|
||||
|
||||
import "github.com/FAU-CDI/wisski-distillery/internal/wisski/ingredient"
|
||||
import (
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/status"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/wisski/ingredient"
|
||||
)
|
||||
|
||||
type SnapshotsFetcher struct {
|
||||
ingredient.Base
|
||||
|
|
@ -8,7 +11,7 @@ type SnapshotsFetcher struct {
|
|||
Info *Info
|
||||
}
|
||||
|
||||
func (lbr *SnapshotsFetcher) Fetch(flags ingredient.FetchFlags, info *ingredient.Information) (err error) {
|
||||
func (lbr *SnapshotsFetcher) Fetch(flags ingredient.FetcherFlags, info *status.Information) (err error) {
|
||||
if flags.Quick {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue