loaders

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActorLoader

type ActorLoader interface {
	Actors(ctx context.Context) ([]*model.Actor, error)
	Actor(ctx context.Context, address types.Address) (*model.Actor, error)
}

type AlertLoader

type AlertLoader interface {
	Alerts(ctx context.Context) ([]*model.Alert, error)
	SubAlerts(ctx context.Context, offset int) (<-chan *model.Alert, error)
}

type ConfigLoader

type ConfigLoader interface {
	Config(ctx context.Context, layer string) (*model.Config, error)
	Configs(ctx context.Context) ([]*model.Config, error)
	ConfigUsed(ctx context.Context, layer string) ([]*model.MachineDetail, error)
}

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

func NewLoader

func NewLoader(db *db.HarmonyDB, cacheSize int) *Loader

func (*Loader) Actor

func (l *Loader) Actor(ctx context.Context, address types.Address) (*model.Actor, error)

func (*Loader) Actors

func (l *Loader) Actors(ctx context.Context) ([]*model.Actor, error)

func (*Loader) AggregateTaskHistory

func (l *Loader) AggregateTaskHistory(ctx context.Context, startTime, endTime time.Time) ([]*TaskHistory, error)

func (*Loader) Alerts

func (l *Loader) Alerts(ctx context.Context) ([]*model.Alert, error)

func (*Loader) Config

func (l *Loader) Config(ctx context.Context, layer string) (*model.Config, error)

func (*Loader) ConfigUsed

func (l *Loader) ConfigUsed(ctx context.Context, layer string) ([]*model.MachineDetail, error)

func (*Loader) Configs

func (l *Loader) Configs(ctx context.Context) ([]*model.Config, error)

Configs is the resolver for the configs field.

func (*Loader) Machine

func (l *Loader) Machine(ctx context.Context, id int) (*model.Machine, error)

func (*Loader) MachineByHostPort added in v0.0.4

func (l *Loader) MachineByHostPort(ctx context.Context, hostPort string) (*model.Machine, error)

func (*Loader) MachineDetails

func (l *Loader) MachineDetails(ctx context.Context) ([]*model.MachineDetail, error)

func (*Loader) MachineStorages added in v0.0.4

func (l *Loader) MachineStorages(ctx context.Context, hostPort string) ([]*model.StoragePath, error)

func (*Loader) Machines

func (l *Loader) Machines(ctx context.Context) ([]*model.Machine, error)

func (*Loader) MiningSummaryByDay

func (l *Loader) MiningSummaryByDay(ctx context.Context, start, end time.Time) ([]*model.MiningSummaryDay, error)

func (*Loader) OpenSectorPieces

func (l *Loader) OpenSectorPieces(ctx context.Context) ([]*model.OpenSectorPiece, error)

func (*Loader) Pipelines

func (l *Loader) Pipelines(ctx context.Context) ([]*model.Pipeline, error)

func (*Loader) PipelinesSummary

func (l *Loader) PipelinesSummary(ctx context.Context) ([]*model.PipelineSummary, error)

func (*Loader) SectorEvents

func (l *Loader) SectorEvents(ctx context.Context, actor types.ActorID, sectorNumber int) ([]*model.TaskHistory, error)

func (*Loader) SectorLocations

func (l *Loader) SectorLocations(ctx context.Context, actor types.ActorID, sectorNumber int) ([]*model.SectorLocation, error)

func (*Loader) SectorMeta

func (l *Loader) SectorMeta(ctx context.Context, actor types.ActorID, sectorNumber int) (*model.SectorMeta, error)

func (*Loader) SectorMetas

func (l *Loader) SectorMetas(ctx context.Context, actor *types.ActorID, offset int, limit int) ([]*model.SectorMeta, error)

func (*Loader) SectorPieces

func (l *Loader) SectorPieces(ctx context.Context, actor types.ActorID, sectorNumber int) ([]*model.SectorMetaPiece, error)

func (*Loader) SectorTasks

func (l *Loader) SectorTasks(ctx context.Context, actor types.ActorID, sectorNumber int) ([]*model.Task, error)

func (*Loader) SectorsCount

func (l *Loader) SectorsCount(ctx context.Context, actor *types.ActorID) (int, error)

func (*Loader) StoragePaths

func (l *Loader) StoragePaths(ctx context.Context) ([]*model.StoragePath, error)

func (*Loader) StorageStats

func (l *Loader) StorageStats(ctx context.Context) ([]*model.StorageStats, error)

func (*Loader) SubAlerts

func (l *Loader) SubAlerts(ctx context.Context, offset int) (<-chan *model.Alert, error)

func (*Loader) SubCompletedTask

func (l *Loader) SubCompletedTask(ctx context.Context, hostPort *string, last int) (<-chan *model.TaskHistory, error)

func (*Loader) SubNewTask

func (l *Loader) SubNewTask(ctx context.Context, hostID *int, last int) (<-chan *model.Task, error)

func (*Loader) Task

func (l *Loader) Task(ctx context.Context, id int) (*model.Task, error)

func (*Loader) TaskAggregatesByDay

func (l *Loader) TaskAggregatesByDay(_ context.Context, start, end time.Time) ([]*model.TaskAggregate, error)

func (*Loader) TaskAggregatesByHour

func (l *Loader) TaskAggregatesByHour(_ context.Context, start, end time.Time) ([]*model.TaskAggregate, error)

func (*Loader) TaskAggregatesByTask

func (l *Loader) TaskAggregatesByTask(_ context.Context, start, end time.Time) ([]*model.TaskNameAggregate, error)

func (*Loader) TaskHistories

func (l *Loader) TaskHistories(ctx context.Context, offset int, limit int) ([]*model.TaskHistory, error)

TaskHistories is the resolver for the taskHistories field.

func (*Loader) TaskHistoriesAggregate added in v0.0.2

func (l *Loader) TaskHistoriesAggregate(ctx context.Context, start, end time.Time, interval model.TaskHistoriesAggregateInterval) ([]*model.TaskAggregate, error)

func (*Loader) TaskHistoriesCount

func (l *Loader) TaskHistoriesCount(ctx context.Context, start, end time.Time, machine, name *string, success *bool) (int, error)

TaskHistoriesCount Count the number of task histories between start and end time

func (*Loader) Tasks

func (l *Loader) Tasks(ctx context.Context) ([]*model.Task, error)

func (*Loader) TasksCount

func (l *Loader) TasksCount(ctx context.Context) (int, error)

TasksCount returns the number of running tasks in the database.

type MachineLoader

type MachineLoader interface {
	Machine(ctx context.Context, id int) (*model.Machine, error)
	MachineByHostPort(ctx context.Context, hostPort string) (*model.Machine, error)
	Machines(ctx context.Context) ([]*model.Machine, error)
	MachineDetails(ctx context.Context) ([]*model.MachineDetail, error)
	MachineStorages(ctx context.Context, hostPort string) ([]*model.StoragePath, error)
}

type PipelineLoader

type PipelineLoader interface {
	Pipeline(ctx context.Context, id int) (*model.Pipeline, error)
	Pipelines(ctx context.Context) ([]*model.Pipeline, error)
}

type SectorLoader

type SectorLoader interface {
	SectorMetas(ctx context.Context, actor *types.ActorID, offset int, limit int) ([]*model.SectorMeta, error)
	SectorMeta(ctx context.Context, actor types.ActorID, sectorNumber int) (*model.SectorMeta, error)
	SectorsCount(ctx context.Context, actor *types.ActorID) (int, error)
	SectorLocations(ctx context.Context, actor types.ActorID, sectorNumber int) ([]*model.SectorLocation, error)
	SectorPieces(ctx context.Context, actor types.ActorID, sectorNumber int) ([]*model.SectorMetaPiece, error)
	SectorEvents(ctx context.Context, actor types.ActorID, sectorNumber int) ([]*model.TaskHistory, error)
	SectorTasks(ctx context.Context, actor types.ActorID, sectorNumber int) ([]*model.Task, error)
}

type StorageLoader

type StorageLoader interface {
	StoragePaths(ctx context.Context) ([]*model.StoragePath, error)
	StorageStats(ctx context.Context) ([]*model.StorageStats, error)
}

type TaskHistory

type TaskHistory struct {
	Hour    time.Time
	Name    string
	Total   int
	Success int
	Failure int
}

type TaskHistoryLoader

type TaskHistoryLoader interface {
	TaskHistories(ctx context.Context, offset int, limit int) ([]*model.TaskHistory, error)
	SubCompletedTask(ctx context.Context, hostPort *string, last int) (<-chan *model.TaskHistory, error)
	TaskHistoriesCount(ctx context.Context, start, end time.Time, name *string) (int, error)
}

type TaskLoader

type TaskLoader interface {
	Task(ctx context.Context, id int) (*model.Task, error)
	Tasks(ctx context.Context) ([]*model.Task, error)
	TasksCount(ctx context.Context) (int, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL