webrpc

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: Apache-2.0, MIT Imports: 17 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Routes

func Routes(r *mux.Router, deps *deps.Deps)

Types

type HarmonyMachineDesc

type HarmonyMachineDesc struct {
	MachineID   int64  `db:"machine_id"`
	Name        string `db:"machine_name"`
	MachineAddr string `db:"host_and_port"`
	Actors      string `db:"miners"`
}

type HarmonyTaskHistory

type HarmonyTaskHistory struct {
	TaskID int64  `db:"task_id"`
	Name   string `db:"name"`

	WorkStart time.Time `db:"work_start"`
	WorkEnd   time.Time `db:"work_end"`
	Posted    time.Time `db:"posted"`

	Result bool   `db:"result"`
	Err    string `db:"err"`

	CompletedBy     string  `db:"completed_by_host_and_port"`
	CompletedById   *int64  `db:"completed_by_machine"`
	CompletedByName *string `db:"completed_by_machine_name"`
}

type HarmonyTaskStats

type HarmonyTaskStats struct {
	Name       string `db:"name"`
	TrueCount  int    `db:"true_count"`
	FalseCount int    `db:"false_count"`
	TotalCount int    `db:"total_count"`
}

type RpcInfo

type RpcInfo struct {
	Address   string
	CLayers   []string
	Reachable bool
	SyncState string
	Version   string
}

type StorageGCMarks

type StorageGCMarks struct {
	Actor     int64  `db:"sp_id"`
	SectorNum int64  `db:"sector_num"`
	FileType  int64  `db:"sector_filetype"`
	StorageID string `db:"storage_id"`

	CreatedAt  time.Time  `db:"created_at"`
	Approved   bool       `db:"approved"`
	ApprovedAt *time.Time `db:"approved_at"`

	// db ignored
	TypeName string `db:"-"`
}

type StorageGCStats

type StorageGCStats struct {
	Actor int64 `db:"sp_id"`
	Count int   `db:"count"`
}

type StorageUseStats

type StorageUseStats struct {
	CanSeal   bool `db:"can_seal"`
	CanStore  bool `db:"can_store"`
	Available int  `db:"available"`
	Capacity  int  `db:"capacity"`

	// Ignored
	Type   string `db:"-"`
	UseStr string `db:"-"`
	CapStr string `db:"-"`
}

type WebRPC

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

func (*WebRPC) BlockDelaySecs

func (a *WebRPC) BlockDelaySecs(context.Context) (uint64, error)

func (*WebRPC) HarmonyTaskHistory

func (a *WebRPC) HarmonyTaskHistory(ctx context.Context, taskName string) ([]HarmonyTaskHistory, error)

func (*WebRPC) HarmonyTaskMachines

func (a *WebRPC) HarmonyTaskMachines(ctx context.Context, taskName string) ([]HarmonyMachineDesc, error)

func (*WebRPC) HarmonyTaskStats

func (a *WebRPC) HarmonyTaskStats(ctx context.Context) ([]HarmonyTaskStats, error)

func (*WebRPC) StorageGCApprove

func (a *WebRPC) StorageGCApprove(ctx context.Context, actor int64, sectorNum int64, fileType int64, storageID string) error

func (*WebRPC) StorageGCApproveAll

func (a *WebRPC) StorageGCApproveAll(ctx context.Context) error

func (*WebRPC) StorageGCMarks

func (a *WebRPC) StorageGCMarks(ctx context.Context) ([]StorageGCMarks, error)

func (*WebRPC) StorageGCStats

func (a *WebRPC) StorageGCStats(ctx context.Context) ([]StorageGCStats, error)

func (*WebRPC) StorageGCUnapproveAll

func (a *WebRPC) StorageGCUnapproveAll(ctx context.Context) error

func (*WebRPC) StorageUseStats

func (a *WebRPC) StorageUseStats(ctx context.Context) ([]StorageUseStats, error)

func (*WebRPC) SyncerState

func (a *WebRPC) SyncerState(ctx context.Context) ([]RpcInfo, error)

func (*WebRPC) Version

func (a *WebRPC) Version(context.Context) (string, error)

func (*WebRPC) WinStats

func (a *WebRPC) WinStats(ctx context.Context) ([]WinStats, error)

type WinStats

type WinStats struct {
	Actor       int64      `db:"sp_id"`
	Epoch       int64      `db:"epoch"`
	Block       string     `db:"mined_cid"`
	TaskID      int64      `db:"task_id"`
	SubmittedAt *time.Time `db:"submitted_at"`
	Included    *bool      `db:"included"`

	BaseComputeTime *time.Time `db:"base_compute_time"`
	MinedAt         *time.Time `db:"mined_at"`

	SubmittedAtStr string `db:"-"`
	TaskSuccess    string `db:"-"`
	IncludedStr    string `db:"-"`
	ComputeTime    string `db:"-"`
}

Jump to

Keyboard shortcuts

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