status: Rename Information => WissKI
This commit is contained in:
parent
3fada6ad38
commit
57f2fe8c86
16 changed files with 21 additions and 21 deletions
|
|
@ -65,7 +65,7 @@ func (home *Home) homeRender() ([]byte, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
context.Instances = make([]status.Information, len(wissKIs))
|
||||
context.Instances = make([]status.WissKI, len(wissKIs))
|
||||
|
||||
// determine their infos
|
||||
var eg errgroup.Group
|
||||
|
|
@ -86,7 +86,7 @@ func (home *Home) homeRender() ([]byte, error) {
|
|||
}
|
||||
|
||||
type HomeContext struct {
|
||||
Instances []status.Information
|
||||
Instances []status.WissKI
|
||||
|
||||
Time time.Time
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ var indexTemplate = static.AssetsControlIndex.MustParseShared(
|
|||
|
||||
type indexContext struct {
|
||||
status.Distillery
|
||||
Instances []status.Information
|
||||
Instances []status.WissKI
|
||||
}
|
||||
|
||||
func (info *Info) index(r *http.Request) (idx indexContext, err error) {
|
||||
|
|
@ -31,7 +31,7 @@ func (info *Info) index(r *http.Request) (idx indexContext, err error) {
|
|||
|
||||
// Status produces a new observation of the distillery, and a new information of all instances
|
||||
// The information on all instances is passed the given quick flag.
|
||||
func (info *Info) Status(QuickInformation bool) (target status.Distillery, information []status.Information, err error) {
|
||||
func (info *Info) Status(QuickInformation bool) (target status.Distillery, information []status.WissKI, err error) {
|
||||
var group errgroup.Group
|
||||
|
||||
group.Go(func() error {
|
||||
|
|
@ -42,7 +42,7 @@ func (info *Info) Status(QuickInformation bool) (target status.Distillery, infor
|
|||
}
|
||||
|
||||
// get all of their info!
|
||||
information = make([]status.Information, len(all))
|
||||
information = make([]status.WissKI, len(all))
|
||||
for i, instance := range all {
|
||||
{
|
||||
i := i
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ type instanceContext struct {
|
|||
Time time.Time
|
||||
|
||||
Instance models.Instance
|
||||
Info status.Information
|
||||
Info status.WissKI
|
||||
}
|
||||
|
||||
func (info *Info) instance(r *http.Request) (is instanceContext, err error) {
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ import (
|
|||
"github.com/FAU-CDI/wisski-distillery/internal/phpx"
|
||||
)
|
||||
|
||||
// Information provides information about a single WissKI
|
||||
type Information struct {
|
||||
// WissKI provides information about a single WissKI
|
||||
type WissKI struct {
|
||||
Time time.Time // Time this info was built
|
||||
|
||||
Slug string // slug
|
||||
|
|
@ -70,7 +70,7 @@ type LastRebuildFetcher struct {
|
|||
Barrel *Barrel
|
||||
}
|
||||
|
||||
func (lbr *LastRebuildFetcher) Fetch(flags ingredient.FetcherFlags, info *status.Information) (err error) {
|
||||
func (lbr *LastRebuildFetcher) Fetch(flags ingredient.FetcherFlags, info *status.WissKI) (err error) {
|
||||
info.LastRebuild, _ = lbr.Barrel.LastRebuild()
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ type LastCronFetcher struct {
|
|||
Drush *Drush
|
||||
}
|
||||
|
||||
func (lbr *LastCronFetcher) Fetch(flags ingredient.FetcherFlags, info *status.Information) (err error) {
|
||||
func (lbr *LastCronFetcher) Fetch(flags ingredient.FetcherFlags, info *status.WissKI) (err error) {
|
||||
if flags.Quick {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ type LastUpdateFetcher struct {
|
|||
Drush *Drush
|
||||
}
|
||||
|
||||
func (lbr *LastUpdateFetcher) Fetch(flags ingredient.FetcherFlags, info *status.Information) (err error) {
|
||||
func (lbr *LastUpdateFetcher) Fetch(flags ingredient.FetcherFlags, info *status.WissKI) (err error) {
|
||||
info.LastUpdate, err = lbr.Drush.LastUpdate()
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ type RunningFetcher struct {
|
|||
Barrel *Barrel
|
||||
}
|
||||
|
||||
func (rf *RunningFetcher) Fetch(flags ingredient.FetcherFlags, info *status.Information) (err error) {
|
||||
func (rf *RunningFetcher) Fetch(flags ingredient.FetcherFlags, info *status.WissKI) (err error) {
|
||||
info.Running, err = rf.Barrel.Running()
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ func (ssh *SSH) Keys() ([]ssh.PublicKey, error) {
|
|||
return sshx.ParseAllKeys(bytes), nil
|
||||
}
|
||||
|
||||
func (sshx *SSH) Fetch(flags ingredient.FetcherFlags, info *status.Information) error {
|
||||
func (sshx *SSH) Fetch(flags ingredient.FetcherFlags, info *status.WissKI) error {
|
||||
if flags.Quick {
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ type WissKIFetcher interface {
|
|||
|
||||
// Fetch fetches information from this ingredient and writes it into target.
|
||||
// Distinct WissKIFetchers must write into distinct fields.
|
||||
Fetch(flags FetcherFlags, target *status.Information) error
|
||||
Fetch(flags FetcherFlags, target *status.WissKI) error
|
||||
}
|
||||
|
||||
// FetcherFlags describes options for a WissKIFetcher
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ type Info struct {
|
|||
|
||||
// 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 status.Information, err error) {
|
||||
func (wisski *Info) Information(quick bool) (info status.WissKI, err error) {
|
||||
// setup flags
|
||||
flags := ingredient.FetcherFlags{
|
||||
Quick: quick,
|
||||
|
|
@ -48,7 +48,7 @@ func (wisski *Info) Information(quick bool) (info status.Information, err error)
|
|||
return
|
||||
}
|
||||
|
||||
func (wisski *Info) Fetch(flags ingredient.FetcherFlags, info *status.Information) error {
|
||||
func (wisski *Info) Fetch(flags ingredient.FetcherFlags, info *status.WissKI) error {
|
||||
info.Time = time.Now().UTC()
|
||||
info.Slug = wisski.Slug
|
||||
info.URL = wisski.URL().String()
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ type SnapshotsFetcher struct {
|
|||
Info *Info
|
||||
}
|
||||
|
||||
func (lbr *SnapshotsFetcher) Fetch(flags ingredient.FetcherFlags, info *status.Information) (err error) {
|
||||
func (lbr *SnapshotsFetcher) Fetch(flags ingredient.FetcherFlags, info *status.WissKI) (err error) {
|
||||
if flags.Quick {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ func (lock *Locker) Locked() (locked bool) {
|
|||
return
|
||||
}
|
||||
|
||||
func (locker *Locker) Fetch(flags ingredient.FetcherFlags, info *status.Information) (err error) {
|
||||
func (locker *Locker) Fetch(flags ingredient.FetcherFlags, info *status.WissKI) (err error) {
|
||||
info.Locked = locker.Locked()
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ func (pathbuilder *Pathbuilder) GetAll(server *phpx.Server) (pathbuilders map[st
|
|||
return
|
||||
}
|
||||
|
||||
func (pathbuilder *Pathbuilder) Fetch(flags ingredient.FetcherFlags, info *status.Information) (err error) {
|
||||
func (pathbuilder *Pathbuilder) Fetch(flags ingredient.FetcherFlags, info *status.WissKI) (err error) {
|
||||
if flags.Quick {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ func (wisski *Prefixes) Update() error {
|
|||
return prefix.SetAll(wisski.MStore, prefixes...)
|
||||
}
|
||||
|
||||
func (prefixes *Prefixes) Fetch(flags ingredient.FetcherFlags, info *status.Information) (err error) {
|
||||
func (prefixes *Prefixes) Fetch(flags ingredient.FetcherFlags, info *status.WissKI) (err error) {
|
||||
info.NoPrefixes = prefixes.NoPrefix()
|
||||
if flags.Quick {
|
||||
// quick mode: grab only the cached prefixes
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ func (stats *Stats) Get(server *phpx.Server) (data status.Statistics, err error)
|
|||
return
|
||||
}
|
||||
|
||||
func (stats *Stats) Fetch(flags ingredient.FetcherFlags, info *status.Information) (err error) {
|
||||
func (stats *Stats) Fetch(flags ingredient.FetcherFlags, info *status.WissKI) (err error) {
|
||||
if flags.Quick {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue