You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lntop/ui/models/models.go

34 lines
463 B
Go

package models
import (
"context"
"github.com/edouardparis/lntop/app"
"github.com/edouardparis/lntop/network/models"
)
type Models struct {
App *app.App
Info *Info
}
func New(app *app.App) *Models {
return &Models{
App: app,
Info: &Info{},
}
}
func (m *Models) RefreshInfo(ctx context.Context) error {
info, err := m.App.Network.Info(ctx)
if err != nil {
return err
}
*m.Info = Info{info}
return nil
}
type Info struct {
*models.Info
}